Skip to content

Commit

Permalink
Fix CI for macos
Browse files Browse the repository at this point in the history
Due to compiler bugs present in the latest version of clang on macos:

Roll back macos version used by github actions from `macos-latest`
(`macos-14`) to `macos-13`: Some modulo operations were failing,
such as `-1 % -1` when compiler optimizations were enabled

Disable `-Wliteral-range` for test-math.c on macos, because it was
falsely raised for `isnan`, `isinf`, and `isfinite ` macros.

JerryScript-DCO-1.0-Signed-off-by: Máté Tokodi [email protected]
  • Loading branch information
matetokodi committed May 23, 2024
1 parent 47bd5d4 commit ef70e53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gh-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- run: $RUNNER -q --jerry-tests --buildoptions=--compile-flag=-m32,--cpointer-32bit=on --build-debug

OSX_x86-64_Build_Correctness_Unit_Tests:
runs-on: macos-latest
runs-on: macos-13
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
Expand All @@ -67,7 +67,7 @@ jobs:
- run: $RUNNER -q --unittests

OSX_x86-64_Build_Correctness_Unit_Tests_Debug:
runs-on: macos-latest
runs-on: macos-13
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
Expand Down
3 changes: 3 additions & 0 deletions tests/unit-math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ foreach(SOURCE_UNIT_TEST_MAIN ${SOURCE_UNIT_TEST_MAIN_MODULES})
add_executable(${TARGET_NAME} ${SOURCE_UNIT_TEST_MAIN})
set_property(TARGET ${TARGET_NAME} PROPERTY LINK_FLAGS "${LINKER_FLAGS_COMMON}")
set_property(TARGET ${TARGET_NAME} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests")
if("${PLATFORM}" STREQUAL "DARWIN")
set_property(TARGET ${TARGET_NAME} PROPERTY COMPILE_OPTIONS "-Wno-literal-range")
endif()

target_link_libraries(${TARGET_NAME} jerry-math)

Expand Down

0 comments on commit ef70e53

Please sign in to comment.