Skip to content

Commit 494f118

Browse files
committed
Rework: separate cpu from arch, pass LLVM CPU names directly
Instead of trying to map -march values to LLVM CPU names in CMake, add a separate cpu parameter (Makefile) / -Cpu parameter (make.ps1) that takes the LLVM CPU name directly. This matches the pattern corral already uses and the existing cross_cpu in our own Makefile. CI scripts and workflows now pass the correct LLVM CPU name for each platform: x86-64 for x86-64, apple-m1 for macOS arm64, generic for Linux and Windows arm64.
1 parent 99a7aec commit 494f118

16 files changed

Lines changed: 54 additions & 50 deletions

.ci-scripts/arm64-nightly.bash

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ if [[ -z "${TRIPLE_OS}" ]]; then
2424
exit 1
2525
fi
2626

27+
if [[ -z "${CPU}" ]]; then
28+
echo -e "\e[31mLLVM CPU name needs to be set in CPU."
29+
echo -e "Exiting.\e[0m"
30+
exit 1
31+
fi
32+
2733
TODAY=$(date +%Y%m%d)
2834

2935
# Compiler target parameters
@@ -54,7 +60,7 @@ ASSET_DESCRIPTION="https://github.com/ponylang/ponyc"
5460

5561
# Build pony installation
5662
echo "Building ponyc installation..."
57-
make configure arch=${PROCESSOR} build_flags=-j${MAKE_PARALLELISM} \
63+
make configure arch=${PROCESSOR} cpu=${CPU} build_flags=-j${MAKE_PARALLELISM} \
5864
version="${PONY_VERSION}"
5965
make build version="${PONY_VERSION}"
6066
make install arch=${PROCESSOR} prefix="${BUILD_PREFIX}" symlink=no version="${PONY_VERSION}"

.ci-scripts/arm64-release.bash

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ if [[ -z "${TRIPLE_OS}" ]]; then
2424
exit 1
2525
fi
2626

27+
if [[ -z "${CPU}" ]]; then
28+
echo -e "\e[31mLLVM CPU name needs to be set in CPU."
29+
echo -e "Exiting.\e[0m"
30+
exit 1
31+
fi
32+
2733
# Compiler target parameters
2834
MACHINE=arm64
2935
PROCESSOR=armv8-a
@@ -51,7 +57,7 @@ ASSET_DESCRIPTION="https://github.com/ponylang/ponyc"
5157

5258
# Build pony installation
5359
echo "Building ponyc installation..."
54-
make configure arch=${PROCESSOR} build_flags=-j${MAKE_PARALLELISM}
60+
make configure arch=${PROCESSOR} cpu=${CPU} build_flags=-j${MAKE_PARALLELISM}
5561
make build
5662
make install arch=${PROCESSOR} prefix="${BUILD_PREFIX}" symlink=no
5763

.ci-scripts/x86-64-nightly.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ASSET_DESCRIPTION="https://github.com/ponylang/ponyc"
5353

5454
# Build pony installation
5555
echo "Building ponyc installation..."
56-
make configure arch=${ARCH} build_flags=-j${MAKE_PARALLELISM} \
56+
make configure arch=${ARCH} cpu=${ARCH} build_flags=-j${MAKE_PARALLELISM} \
5757
version="${PONY_VERSION}"
5858
make build version="${PONY_VERSION}"
5959
make install arch=${ARCH} prefix="${BUILD_PREFIX}" symlink=no version="${PONY_VERSION}"

.ci-scripts/x86-64-release.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ASSET_DESCRIPTION="https://github.com/ponylang/ponyc"
5050

5151
# Build pony installation
5252
echo "Building ponyc installation..."
53-
make configure arch=${ARCH} build_flags=-j${MAKE_PARALLELISM}
53+
make configure arch=${ARCH} cpu=${ARCH} build_flags=-j${MAKE_PARALLELISM}
5454
make build
5555
make install arch=${ARCH} prefix="${BUILD_PREFIX}" symlink=no
5656

.github/workflows/nightlies.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ jobs:
164164
-e CLOUDSMITH_API_KEY=${{ secrets.CLOUDSMITH_API_KEY }} \
165165
-e TRIPLE_VENDOR=${{ matrix.triple-vendor }} \
166166
-e TRIPLE_OS=${{ matrix.triple-os }} \
167+
-e CPU=generic \
167168
${{ matrix.image }} \
168169
bash .ci-scripts/arm64-nightly.bash
169170
- name: Send alert on failure
@@ -258,6 +259,7 @@ jobs:
258259
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
259260
TRIPLE_VENDOR: apple
260261
TRIPLE_OS: darwin
262+
CPU: apple-m1
261263
- name: Send alert on failure
262264
if: ${{ failure() }}
263265
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
@@ -304,7 +306,7 @@ jobs:
304306
lib/llvm/src/compiler-rt/lib/builtins
305307
key: libs-windows-2025-${{ hashFiles('make.ps1', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
306308
- name: Configure
307-
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version nightly
309+
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version nightly -Cpu x86-64
308310
- name: Build
309311
run: .\make.ps1 -Command build -Config Release -Prefix "build\install\release" -Version nightly
310312
- name: Install
@@ -358,7 +360,7 @@ jobs:
358360
lib/llvm/src/compiler-rt/lib/builtins
359361
key: libs-windows-11-arm-${{ hashFiles('make.ps1', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
360362
- name: Configure
361-
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version nightly -Arch ARM64
363+
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version nightly -Arch ARM64 -Cpu generic
362364
- name: Build
363365
run: .\make.ps1 -Command build -Config Release -Prefix "build\install\release" -Version nightly
364366
- name: Install

.github/workflows/ponyc-tier2.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ jobs:
243243
run: make libs build_flags=-j8
244244
- name: Build Debug Runtime
245245
run: |
246-
make configure arch=x86-64 config=debug
246+
make configure arch=x86-64 cpu=x86-64 config=debug
247247
make build config=debug
248248
- name: Test with Debug Runtime
249249
run: make test-ci-core config=debug test_full_program_timeout=180
250250
- name: Build Release Runtime
251251
run: |
252-
make configure arch=x86-64 config=release
252+
make configure arch=x86-64 cpu=x86-64 config=release
253253
make build config=release
254254
- name: Test with Release Runtime
255255
run: make test-ci-core config=release test_full_program_timeout=180
@@ -326,7 +326,7 @@ jobs:
326326
-v ${{ github.workspace }}:/home/pony/project \
327327
-w /home/pony/project \
328328
${{ matrix.image }} \
329-
bash -c "make configure arch=armv8-a config=debug && make build config=debug"
329+
bash -c "make configure arch=armv8-a cpu=generic config=debug && make build config=debug"
330330
- name: Test with Debug Runtime
331331
run: |
332332
docker run --rm \
@@ -344,7 +344,7 @@ jobs:
344344
-v ${{ github.workspace }}:/home/pony/project \
345345
-w /home/pony/project \
346346
${{ matrix.image }} \
347-
bash -c "make configure arch=armv8-a config=release && make build config=release"
347+
bash -c "make configure arch=armv8-a cpu=generic config=release && make build config=release"
348348
- name: Test with Release Runtime
349349
run: |
350350
docker run --rm \
@@ -394,13 +394,13 @@ jobs:
394394
run: .\make.ps1 -Command libs -Arch ARM64
395395
- name: Build Debug Runtime
396396
run: |
397-
.\make.ps1 -Command configure -Config Debug -Arch ARM64
397+
.\make.ps1 -Command configure -Config Debug -Arch ARM64 -Cpu generic
398398
.\make.ps1 -Command build -Config Debug
399399
- name: Test with Debug Runtime
400400
run: .\make.ps1 -Command test -Config Debug
401401
- name: Build Release Runtime
402402
run: |
403-
.\make.ps1 -Command configure -Config Release -Arch ARM64
403+
.\make.ps1 -Command configure -Config Release -Arch ARM64 -Cpu generic
404404
.\make.ps1 -Command build -Config Release
405405
- name: Test with Release Runtime
406406
run: .\make.ps1 -Command test -Config Release

.github/workflows/ponyc-weekly-checks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ jobs:
8686
run: make libs build_flags=-j8
8787
- name: Build Debug Runtime
8888
run: |
89-
make configure arch=x86-64 config=debug use=${{ matrix.directives }}
89+
make configure arch=x86-64 cpu=x86-64 config=debug use=${{ matrix.directives }}
9090
make build config=debug
9191
- name: Test with Debug Runtime
9292
run: make test-ci-core config=debug usedebugger='${{ matrix.debugger }}'
9393
- name: Build Release Runtime
9494
run: |
95-
make configure arch=x86-64 config=release use=${{ matrix.directives }}
95+
make configure arch=x86-64 cpu=x86-64 config=release use=${{ matrix.directives }}
9696
make build config=release
9797
- name: Test with Release Runtime
9898
run: make test-ci-core config=release usedebugger='${{ matrix.debugger }}'
@@ -143,13 +143,13 @@ jobs:
143143
run: make libs build_flags=-j8
144144
- name: Build Debug Runtime
145145
run: |
146-
ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make configure arch=x86-64 config=debug use=${{ matrix.directives }}
146+
ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make configure arch=x86-64 cpu=x86-64 config=debug use=${{ matrix.directives }}
147147
ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make build config=debug
148148
- name: Test with Debug Runtime
149149
run: ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make test-ci-core config=debug test_full_program_timeout=300
150150
- name: Build Release Runtime
151151
run: |
152-
ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make configure arch=x86-64 config=release use=${{ matrix.directives }}
152+
ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make configure arch=x86-64 cpu=x86-64 config=release use=${{ matrix.directives }}
153153
ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make build config=release
154154
- name: Test with Release Runtime
155155
run: ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make test-ci-core config=release test_full_program_timeout=300

.github/workflows/pr-ponyc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ jobs:
5555
run: make libs build_flags=-j8
5656
- name: Build Debug Runtime
5757
run: |
58-
make configure arch=x86-64 config=debug
58+
make configure arch=x86-64 cpu=x86-64 config=debug
5959
make build config=debug
6060
- name: Test with Debug Runtime
6161
run: make test-ci-core config=debug usedebugger='${{ matrix.debugger }}'
6262
- name: Build Release Runtime
6363
run: |
64-
make configure arch=x86-64 config=release
64+
make configure arch=x86-64 cpu=x86-64 config=release
6565
make build config=release
6666
- name: Test with Release Runtime
6767
run: make test-ci-core config=release usedebugger='${{ matrix.debugger }}'
@@ -87,13 +87,13 @@ jobs:
8787
run: make libs build_flags=-j8
8888
- name: Build Debug Runtime
8989
run: |
90-
make configure arch=armv8 config=debug
90+
make configure arch=armv8 cpu=apple-m1 config=debug
9191
make build config=debug
9292
- name: Test with Debug Runtime
9393
run: make test-ci-core config=debug
9494
- name: Build Release Runtime
9595
run: |
96-
make configure arch=armv8 config=release
96+
make configure arch=armv8 cpu=apple-m1 config=release
9797
make build config=release
9898
- name: Test with Release Runtime
9999
run: make test-ci-core config=release

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ jobs:
179179
-e CLOUDSMITH_API_KEY=${{ secrets.CLOUDSMITH_API_KEY }} \
180180
-e TRIPLE_VENDOR=${{ matrix.triple-vendor }} \
181181
-e TRIPLE_OS=${{ matrix.triple-os }} \
182+
-e CPU=generic \
182183
${{ matrix.image }} \
183184
bash .ci-scripts/arm64-release.bash
184185
@@ -257,6 +258,7 @@ jobs:
257258
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
258259
TRIPLE_VENDOR: apple
259260
TRIPLE_OS: darwin
261+
CPU: apple-m1
260262

261263
x86_64-windows:
262264
needs:
@@ -295,7 +297,7 @@ jobs:
295297
lib/llvm/src/compiler-rt/lib/builtins
296298
key: libs-windows-2025-${{ hashFiles('make.ps1', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
297299
- name: Configure
298-
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION)
300+
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION) -Cpu x86-64
299301
- name: Build
300302
run: .\make.ps1 -Command build -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION)
301303
- name: Install
@@ -341,7 +343,7 @@ jobs:
341343
lib/llvm/src/compiler-rt/lib/builtins
342344
key: libs-windows-11-arm-${{ hashFiles('make.ps1', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
343345
- name: Configure
344-
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION) -Arch ARM64
346+
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION) -Arch ARM64 -Cpu generic
345347
- name: Build
346348
run: .\make.ps1 -Command build -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION)
347349
- name: Install

.github/workflows/stress-test-tcp-open-close-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197
-v ${{ github.workspace }}:/home/pony/project \
198198
-w /home/pony/project \
199199
${{ matrix.image }} \
200-
bash -c "make configure arch=armv8-a config=debug && make build config=debug"
200+
bash -c "make configure arch=armv8-a cpu=generic config=debug && make build config=debug"
201201
- name: Run Stress Test
202202
run: |
203203
docker run --rm \

0 commit comments

Comments
 (0)