Skip to content

Commit 09e93e4

Browse files
authored
Merge branch 'main' into main
2 parents 367f323 + bc523b0 commit 09e93e4

38 files changed

+4588
-1349
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff

.github/workflows/build-llvm.yml

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
name: build llvm
2+
3+
on:
4+
pull_request:
5+
# if you want to run this workflow, change the branch name to main,
6+
# if you want to turn off it, change it to non existent branch.
7+
branches: [main-turn-off]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- os: windows-2025
16+
llvm_mode: Debug
17+
lto: OFF
18+
- os: windows-2025
19+
llvm_mode: RelWithDebInfo
20+
lto: OFF
21+
- os: windows-2025
22+
llvm_mode: RelWithDebInfo
23+
lto: ON
24+
25+
- os: ubuntu-24.04
26+
llvm_mode: Debug
27+
lto: OFF
28+
- os: ubuntu-24.04
29+
llvm_mode: RelWithDebInfo
30+
lto: OFF
31+
- os: ubuntu-24.04
32+
llvm_mode: RelWithDebInfo
33+
lto: ON
34+
35+
- os: macos-15
36+
llvm_mode: Debug
37+
lto: OFF
38+
- os: macos-15
39+
llvm_mode: RelWithDebInfo
40+
lto: OFF
41+
- os: macos-15
42+
llvm_mode: RelWithDebInfo
43+
lto: ON
44+
45+
runs-on: ${{ matrix.os }}
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
50+
51+
- name: Free Disk Space
52+
if: runner.os == 'Linux'
53+
uses: jlumbroso/free-disk-space@main
54+
55+
- name: Increase Swap Space
56+
if: runner.os == 'Linux'
57+
run: |
58+
echo "===== Initial Status ====="
59+
sudo swapon --show
60+
free -h
61+
62+
echo "===== Creating Swap File ====="
63+
sudo swapoff -a
64+
sudo fallocate -l 16G /mnt/swapfile
65+
sudo chmod 600 /mnt/swapfile
66+
sudo mkswap /mnt/swapfile
67+
sudo swapon /mnt/swapfile
68+
69+
echo "===== Final Status ====="
70+
sudo swapon --show
71+
free -h
72+
df -h
73+
74+
- name: Setup Pixi
75+
uses: prefix-dev/setup-pixi@v0.9.3
76+
with:
77+
pixi-version: v0.59.0
78+
environments: package
79+
activate-environment: true
80+
cache: true
81+
locked: true
82+
83+
- name: Clone llvm-project (21.1.4)
84+
shell: bash
85+
run: |
86+
git clone --branch llvmorg-21.1.4 --depth 1 https://github.com/llvm/llvm-project.git .llvm
87+
88+
- name: Build LLVM (install-distribution)
89+
shell: bash
90+
run: |
91+
pixi run build-llvm --llvm-src=.llvm --mode="${{ matrix.llvm_mode }}" --lto="${{ matrix.lto }}" --build-dir=build
92+
93+
- name: Build clice using installed LLVM
94+
shell: bash
95+
run: |
96+
cmake -B build -G Ninja \
97+
-DCMAKE_BUILD_TYPE=${{ matrix.llvm_mode }} \
98+
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake \
99+
-DCLICE_ENABLE_TEST=ON \
100+
-DCLICE_CI_ENVIRONMENT=ON \
101+
-DCLICE_ENABLE_LTO=${{ matrix.lto }} \
102+
-DLLVM_INSTALL_PATH=".llvm/build-install"
103+
cmake --build build
104+
105+
- name: Run tests
106+
shell: bash
107+
run: |
108+
EXE_EXT=""
109+
if [[ "${{ runner.os }}" == "Windows" ]]; then
110+
EXE_EXT=".exe"
111+
fi
112+
./build/bin/unit_tests${EXE_EXT} --test-dir="./tests/data"
113+
uv run --project tests pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice${EXE_EXT}
114+
115+
- name: Prune LLVM static libraries (Debug/RelWithDebInfo no LTO)
116+
if: matrix.llvm_mode == 'Debug' || (matrix.llvm_mode == 'RelWithDebInfo' && matrix.lto == 'OFF')
117+
shell: bash
118+
run: |
119+
MANIFEST="pruned-libs-${{ matrix.os }}.json"
120+
echo "LLVM_PRUNED_MANIFEST=${MANIFEST}" >> "${GITHUB_ENV}"
121+
python3 scripts/prune-llvm-bin.py \
122+
--action discover \
123+
--install-dir ".llvm/build-install/lib" \
124+
--build-dir "build" \
125+
--max-attempts 60 \
126+
--sleep-seconds 60 \
127+
--manifest "${MANIFEST}"
128+
129+
- name: Upload pruned-libs manifest
130+
if: matrix.llvm_mode == 'RelWithDebInfo' && matrix.lto == 'OFF'
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: llvm-pruned-libs-${{ matrix.os }}
134+
path: ${{ env.LLVM_PRUNED_MANIFEST }}
135+
if-no-files-found: error
136+
compression-level: 0
137+
138+
- name: Apply pruned-libs manifest (RelWithDebInfo + LTO)
139+
if: matrix.llvm_mode == 'RelWithDebInfo' && matrix.lto == 'ON'
140+
shell: bash
141+
env:
142+
GH_TOKEN: ${{ github.token }}
143+
run: |
144+
MANIFEST="pruned-libs-${{ matrix.os }}.json"
145+
python3 scripts/prune-llvm-bin.py \
146+
--action apply \
147+
--manifest "${MANIFEST}" \
148+
--install-dir ".llvm/build-install/lib" \
149+
--build-dir "build" \
150+
--gh-run-id "${{ github.run_id }}" \
151+
--gh-artifact "llvm-pruned-libs-${{ matrix.os }}" \
152+
--gh-download-dir "artifacts" \
153+
--max-attempts 60 \
154+
--sleep-seconds 60
155+
156+
- name: Package LLVM install directory
157+
shell: bash
158+
run: |
159+
MODE_TAG="releasedbg"
160+
if [[ "${{ matrix.llvm_mode }}" == "Debug" ]]; then
161+
MODE_TAG="debug"
162+
fi
163+
164+
ARCH="x64"
165+
PLATFORM="linux"
166+
TOOLCHAIN="gnu"
167+
if [[ "${{ matrix.os }}" == windows-* ]]; then
168+
PLATFORM="windows"
169+
TOOLCHAIN="msvc"
170+
elif [[ "${{ matrix.os }}" == macos-* ]]; then
171+
ARCH="arm64"
172+
PLATFORM="macos"
173+
TOOLCHAIN="clang"
174+
fi
175+
176+
SUFFIX=""
177+
if [[ "${{ matrix.lto }}" == "ON" ]]; then
178+
SUFFIX="-lto"
179+
fi
180+
if [[ "${{ matrix.llvm_mode }}" == "Debug" ]]; then
181+
SUFFIX="${SUFFIX}-asan"
182+
fi
183+
184+
ARCHIVE="${ARCH}-${PLATFORM}-${TOOLCHAIN}-${MODE_TAG}${SUFFIX}.tar.xz"
185+
186+
set -eo pipefail
187+
tar -C .llvm -cf - build-install | xz -T0 -9 -c > "${ARCHIVE}"
188+
echo "LLVM_INSTALL_ARCHIVE=${ARCHIVE}" >> "${GITHUB_ENV}"
189+
190+
- name: Upload LLVM install artifact
191+
uses: actions/upload-artifact@v4
192+
with:
193+
name: ${{ env.LLVM_INSTALL_ARCHIVE }}
194+
path: ${{ env.LLVM_INSTALL_ARCHIVE }}
195+
if-no-files-found: error

.github/workflows/check-format.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717

18-
- name: Install uv
19-
uses: astral-sh/setup-uv@v6
18+
- name: Setup Pixi
19+
uses: prefix-dev/setup-pixi@v0.9.3
20+
with:
21+
pixi-version: v0.61.0
22+
environments: develop
23+
activate-environment: true
24+
cache: true
25+
locked: true
2026

2127
- name: Run check
2228
id: precommit
2329
run: |
24-
uv venv
25-
uv pip install pre-commit
26-
uv run pre-commit run --all-files
30+
pixi run ci-check
2731
continue-on-error: true
2832

2933
- name: Show diff on failure

.github/workflows/cmake.yml

Lines changed: 13 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- "src/**"
1010
- "tests/**"
1111
- "CMakeLists.txt"
12+
1213
pull_request:
1314
branches: [main]
1415
paths:
@@ -27,86 +28,30 @@ jobs:
2728
include:
2829
- os: windows-2025
2930
build_type: RelWithDebInfo
30-
cc: clang
31-
cxx: clang++
3231
- os: ubuntu-24.04
3332
build_type: Debug
34-
cc: clang-20
35-
cxx: clang++-20
3633
- os: macos-15
3734
build_type: Debug
38-
cc: clang
39-
cxx: clang++
4035

4136
runs-on: ${{ matrix.os }}
4237

4338
steps:
44-
- name: Setup dependencies (Windows)
45-
if: runner.os == 'Windows'
46-
uses: MinoruSekine/setup-scoop@v4.0.1
47-
with:
48-
buckets: main
49-
apps: ninja
50-
51-
- name: Setup dependencies (Linux)
52-
if: runner.os == 'Linux'
53-
run: |
54-
sudo apt update
55-
sudo apt install -y gcc-14 g++-14 libstdc++-14-dev
56-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
57-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
58-
sudo update-alternatives --set gcc /usr/bin/gcc-14
59-
sudo update-alternatives --set g++ /usr/bin/g++-14
60-
wget https://apt.llvm.org/llvm.sh
61-
chmod +x llvm.sh
62-
sudo ./llvm.sh 20 all
63-
sudo apt install -y cmake ninja-build
64-
65-
- name: Setup dependencies (MacOS)
66-
if: runner.os == 'macOS'
67-
env:
68-
HOMEBREW_NO_AUTO_UPDATE: 1
69-
run: |
70-
brew install llvm@20 lld@20
71-
7239
- name: Checkout repository
7340
uses: actions/checkout@v4
7441

75-
- name: Setup msvc sysroot for cmake
76-
if: runner.os == 'Windows'
77-
uses: ilammy/msvc-dev-cmd@v1
42+
- name: Setup Pixi
43+
uses: prefix-dev/setup-pixi@v0.9.3
44+
with:
45+
pixi-version: v0.61.0
46+
environments: develop
47+
activate-environment: true
48+
cache: true
49+
locked: true
7850

79-
- name: Build clice
80-
shell: bash
51+
- name: Build
8152
run: |
82-
if [[ "${{ runner.os }}" == "macOS" ]]; then
83-
export SDKROOT=$(xcrun --show-sdk-path)
84-
export PATH="/opt/homebrew/opt/llvm@20/bin:/opt/homebrew/opt/lld@20/bin:$PATH"
85-
fi
86-
87-
cmake -B build -G Ninja \
88-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
89-
-DCMAKE_C_COMPILER=${{ matrix.cc }} \
90-
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
91-
-DCLICE_ENABLE_TEST=ON \
92-
-DCLICE_CI_ENVIRONMENT=ON
93-
94-
cmake --build build
53+
pixi run ci-cmake-build ${{ matrix.build_type }}
9554
96-
- name: Install uv for integration tests
97-
uses: astral-sh/setup-uv@v6
98-
99-
- name: Run tests
100-
shell: bash
55+
- name: Test
10156
run: |
102-
EXE_EXT=""
103-
if [[ "${{ runner.os }}" == "Windows" ]]; then
104-
EXE_EXT=".exe"
105-
fi
106-
107-
if [[ "${{ runner.os }}" == "macOS" ]]; then
108-
export PATH="/opt/homebrew/opt/llvm@20/bin:/opt/homebrew/opt/lld@20/bin:$PATH"
109-
fi
110-
111-
./build/bin/unit_tests${EXE_EXT} --test-dir="./tests/data"
112-
uv run --project tests pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice${EXE_EXT}
57+
pixi run ci-cmake-test

.github/workflows/docker.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)