Skip to content

Commit 6473787

Browse files
authored
Merge pull request #2478 from quentin/macos14
Add CI job for Apple ARM
2 parents d3661e5 + eaff312 commit 6473787

File tree

10 files changed

+85
-16
lines changed

10 files changed

+85
-16
lines changed

.github/actions/cmake-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414
using: "composite"
1515
steps:
1616
- name: checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

1919
- name: setup-env
2020
run: |

.github/workflows/CI-Tests.yml

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: checkout
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 2
1919

@@ -31,7 +31,7 @@ jobs:
3131
chunks: ${{ steps.set-test-ids.outputs.chunks }}
3232
steps:
3333
- name: checkout
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
3535
- id: set-test-ids
3636
uses: ./.github/actions/set-test-ids
3737
with:
@@ -54,7 +54,7 @@ jobs:
5454

5555
steps:
5656
- name: checkout
57-
uses: actions/checkout@v3
57+
uses: actions/checkout@v4
5858

5959
- name: install-lcov
6060
if: ${{ matrix.domain == '32bit' }}
@@ -123,7 +123,7 @@ jobs:
123123
xcode-version: '13.4'
124124

125125
- name: checkout
126-
uses: actions/checkout@v3
126+
uses: actions/checkout@v4
127127

128128
- name: install-deps
129129
run: sh/setup/install_macos_deps.sh
@@ -135,6 +135,39 @@ jobs:
135135
n-chunks: ${{ needs.Test-Setup.outputs.n-chunks }}
136136
chunk: ${{ matrix.chunk }}
137137

138+
AppleM-CMake:
139+
needs: Test-Setup
140+
timeout-minutes: 150
141+
142+
name: AppleM-CMake (chunk ${{ matrix.chunk }})
143+
144+
strategy:
145+
fail-fast: false
146+
matrix:
147+
chunk: ${{ fromJSON(needs.Test-Setup.outputs.chunks) }}
148+
149+
runs-on: macos-14
150+
151+
steps:
152+
- name: Select XCode version
153+
uses: maxim-lobanov/setup-xcode@v1
154+
with:
155+
xcode-version: '15.2'
156+
157+
- name: checkout
158+
uses: actions/checkout@v4
159+
160+
- name: install-deps
161+
run: sh/setup/install_macos_arm_deps.sh
162+
163+
- name: cmake-test-64bit
164+
uses: ./.github/actions/cmake-test
165+
with:
166+
# disable openmp on ARM architecture, see souffle-lang/souffle#2476
167+
cmake-flags: -DSOUFFLE_DOMAIN_64BIT=ON -DSOUFFLE_USE_OPENMP=OFF
168+
n-chunks: ${{ needs.Test-Setup.outputs.n-chunks }}
169+
chunk: ${{ matrix.chunk }}
170+
138171
Memory-Check:
139172
needs: Test-Setup
140173
timeout-minutes: 150
@@ -150,7 +183,7 @@ jobs:
150183

151184
steps:
152185
- name: checkout
153-
uses: actions/checkout@v3
186+
uses: actions/checkout@v4
154187

155188
- name: install-deps
156189
run: sudo sh/setup/install_ubuntu_deps.sh
@@ -170,7 +203,7 @@ jobs:
170203

171204
steps:
172205
- name: checkout
173-
uses: actions/checkout@v3
206+
uses: actions/checkout@v4
174207
with:
175208
fetch-depth: 0
176209

.github/workflows/VS-CI-Tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
Windows-CMake-MSVC:
1717
runs-on: windows-2019
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020

2121
- name: Dependencies Cache
2222
uses: actions/cache@v3

.github/workflows/create-packages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3030
with:
3131
fetch-depth: 0
3232

@@ -57,7 +57,7 @@ jobs:
5757
runs-on: ubuntu-latest
5858
steps:
5959
- name: Checkout
60-
uses: actions/checkout@v3
60+
uses: actions/checkout@v4
6161
with:
6262
fetch-depth: 0
6363

@@ -133,7 +133,7 @@ jobs:
133133
runs-on: ubuntu-18.04
134134
steps:
135135
- name: Checkout
136-
uses: actions/checkout@v3
136+
uses: actions/checkout@v4
137137
with:
138138
fetch-depth: 0
139139
clean: false

.github/workflows/populate-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
with:
2323
submodules: 'recursive'
2424

sh/setup/install_macos_arm_deps.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Install MACOS dependencies on a Github Action VM
4+
5+
# Enable debugging and logging of shell operations
6+
# that are executed.
7+
set -e
8+
set -x
9+
10+
# Install requirements of MAC OS X
11+
brew install libtool mcpp swig bison libffi
12+
brew install gcc@13
13+
brew link gcc@13
14+
15+
echo "/usr/local/opt/bison/bin:$PATH" >> $GITHUB_PATH
16+
echo 'PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig/"' >> $GITHUB_ENV
17+
echo 'CC=gcc-13' >> $GITHUB_ENV
18+
echo 'CXX=g++-13' >> $GITHUB_ENV
19+
20+
set +e
21+
set +x

src/CMakeLists.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,16 @@ if (MSVC)
421421
target_compile_definitions(souffleprof PUBLIC USE_CUSTOM_GETOPTLONG)
422422
endif (MSVC)
423423

424-
424+
if (APPLE)
425+
if ("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
426+
# work around a known issue with xcode15 linker
427+
# c++ exceptions handling is broken otherwise
428+
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,-ld_classic")
429+
target_link_options(libsouffle PUBLIC "-ld_classic")
430+
target_link_options(compiled PUBLIC "-ld_classic")
431+
target_link_options(souffleprof PUBLIC "-ld_classic")
432+
endif()
433+
endif()
425434

426435
# --------------------------------------------------
427436
# Substitutions for souffle-compile.py
@@ -437,6 +446,7 @@ set(SOUFFLE_COMPILED_DEBUG_CXX_FLAGS ${CMAKE_CXX_FLAGS_DEBUG})
437446
get_target_property(SOUFFLE_COMPILED_DEFS compiled COMPILE_DEFINITIONS)
438447
get_target_property(SOUFFLE_COMPILED_OPTS compiled COMPILE_OPTIONS)
439448
get_target_property(SOUFFLE_COMPILED_INCS compiled INCLUDE_DIRECTORIES)
449+
get_property(SOUFFLE_COMPILED_LINK_OPTS TARGET compiled PROPERTY LINK_OPTIONS)
440450

441451
set(SOUFFLE_COMPILED_LIBS "")
442452
set(SOUFFLE_COMPILED_RPATHS "")
@@ -524,7 +534,10 @@ endif ()
524534

525535
list(JOIN SOUFFLE_COMPILED_OPTS " " SOUFFLE_COMPILED_CXX_OPTIONS)
526536

527-
list(JOIN SOUFFLE_COMPILED_LIBS " " SOUFFLE_COMPILED_LINK_OPTIONS)
537+
list(JOIN SOUFFLE_COMPILED_LIBS " " SOUFFLE_COMPILED_LINK_OPTIONS1)
538+
list(JOIN SOUFFLE_COMPILED_LINK_OPTS " " SOUFFLE_COMPILED_LINK_OPTIONS2)
539+
set(SOUFFLE_COMPILED_LINK_OPTIONS "")
540+
string(APPEND SOUFFLE_COMPILED_LINK_OPTIONS " ${SOUFFLE_COMPILED_LINK_OPTIONS1}" " ${SOUFFLE_COMPILED_LINK_OPTIONS2}")
528541

529542
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
530543
set(SOUFFLE_COMPILED_LINK_OPTIONS "/link ${SOUFFLE_COMPILED_LINK_OPTIONS}")

src/interpreter/Engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ RamDomain Engine::execute(const Node* node, Context& ctxt) {
775775
std::string sub_str;
776776
try {
777777
sub_str = str.substr(idx, len);
778-
} catch (...) {
778+
} catch (std::out_of_range&) {
779779
std::cerr << "warning: wrong index position provided by substr(\"";
780780
std::cerr << str << "\"," << (int32_t)idx << "," << (int32_t)len << ") functor.\n";
781781
}

src/synthesiser/Synthesiser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2812,7 +2812,7 @@ void Synthesiser::generateCode(GenDb& db, const std::string& id, bool& withShare
28122812
wrapper.setNextArg("std::size_t", "idx");
28132813
wrapper.setNextArg("std::size_t", "len");
28142814
wrapper.body() << "std::string result; \n"
2815-
<< "try { result = str.substr(idx,len); } catch(...) { \n"
2815+
<< "try { result = str.substr(idx,len); } catch(std::out_of_range&) { \n"
28162816
<< " std::cerr << \"warning: wrong index position provided by substr(\\\"\";\n"
28172817
<< " std::cerr << str << \"\\\",\" << (int32_t)idx << \",\" << (int32_t)len << "
28182818
"\") functor.\\n\";\n"

tests/profile/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ function(SOUFFLE_POSITIVE_PROF_TEST TEST_NAME)
119119
endfunction()
120120

121121
if (NOT MSVC)
122+
if (NOT (APPLE AND ("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")))
122123
souffle_positive_prof_test(lrg_attr_id)
123124
souffle_positive_prof_test(recursive)
125+
endif()
124126
endif ()

0 commit comments

Comments
 (0)