Skip to content
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
c4bca58
turn off cpptrace module
16bit-ykiko Dec 11, 2025
6fa4e1c
introduce pixi
16bit-ykiko Dec 11, 2025
999cf86
fix macos build
16bit-ykiko Dec 11, 2025
640e22e
fix macos build
16bit-ykiko Dec 11, 2025
8c6670c
fix macos build
16bit-ykiko Dec 11, 2025
e3e6d10
add license and description
16bit-ykiko Dec 11, 2025
bf41185
fix macos build
16bit-ykiko Dec 11, 2025
9517cb5
fix macos build
16bit-ykiko Dec 11, 2025
f67a3df
fix macos build
16bit-ykiko Dec 11, 2025
77f9df6
fix macos build
16bit-ykiko Dec 11, 2025
8630d5c
update
16bit-ykiko Dec 11, 2025
940de46
fix llvm version
16bit-ykiko Dec 11, 2025
0a6a33f
fix llvm version
16bit-ykiko Dec 11, 2025
5f15f03
fix macos build
16bit-ykiko Dec 11, 2025
ad76244
fix macos build
16bit-ykiko Dec 11, 2025
55451e2
fix build error
16bit-ykiko Dec 12, 2025
24e37cd
test mac ci
16bit-ykiko Dec 12, 2025
bf7bef9
test again
16bit-ykiko Dec 12, 2025
b547876
test again
16bit-ykiko Dec 12, 2025
3e8b17a
fix build
16bit-ykiko Dec 12, 2025
7962934
update glibc version
16bit-ykiko Dec 12, 2025
66e4b2d
remove docker
16bit-ykiko Dec 12, 2025
8dfa28b
try build llvm
16bit-ykiko Dec 12, 2025
2b861ab
fix build
16bit-ykiko Dec 12, 2025
4287275
fix build
16bit-ykiko Dec 12, 2025
9432ef9
fix build
16bit-ykiko Dec 12, 2025
84fc7b6
fix build
16bit-ykiko Dec 12, 2025
5cae77b
fix build
16bit-ykiko Dec 12, 2025
d18aa08
fix build
16bit-ykiko Dec 12, 2025
3cad788
fix build
16bit-ykiko Dec 12, 2025
4b3a00a
add build log
16bit-ykiko Dec 13, 2025
bf45915
try to use ccache
16bit-ykiko Dec 13, 2025
a4c8df5
fix cache build
16bit-ykiko Dec 13, 2025
7ce3dfc
test ccache
16bit-ykiko Dec 13, 2025
755ecf4
use thin lto
16bit-ykiko Dec 13, 2025
beca8de
update build
16bit-ykiko Dec 13, 2025
309b7da
fix linux toolchain
16bit-ykiko Dec 13, 2025
6f6d3e2
update build
16bit-ykiko Dec 13, 2025
1d94606
test upload script
16bit-ykiko Dec 14, 2025
5f00617
test upload
16bit-ykiko Dec 14, 2025
9e8dd0b
turn off unnecessary ci
16bit-ykiko Dec 14, 2025
ab84804
some fix
16bit-ykiko Dec 14, 2025
c4eab33
fix build
16bit-ykiko Dec 14, 2025
b612b9d
fix build
16bit-ykiko Dec 14, 2025
89f25e2
fix ccache
16bit-ykiko Dec 14, 2025
b1e9328
fix asan build
16bit-ykiko Dec 14, 2025
bfc56ea
fix build
16bit-ykiko Dec 14, 2025
5655a93
last build!
16bit-ykiko Dec 14, 2025
17dd948
fix script
16bit-ykiko Dec 14, 2025
1076e2d
try upload llvm binary
16bit-ykiko Dec 15, 2025
725d16e
try upload
16bit-ykiko Dec 15, 2025
8bbe080
tiger upload
16bit-ykiko Dec 15, 2025
d28f245
fix token
16bit-ykiko Dec 15, 2025
524f4e5
fix pixi
16bit-ykiko Dec 15, 2025
b2d52fe
fix token
16bit-ykiko Dec 15, 2025
f31bd0f
fix token name
16bit-ykiko Dec 15, 2025
812d53d
some update
16bit-ykiko Dec 15, 2025
4a6ae65
some update
16bit-ykiko Dec 15, 2025
488c958
test cmake build
16bit-ykiko Dec 15, 2025
1654b8b
fix build script
16bit-ykiko Dec 15, 2025
08194a4
test xmake
16bit-ykiko Dec 15, 2025
fc3f21c
turn xmake ci temporarily
16bit-ykiko Dec 15, 2025
c9317a6
fix typo
16bit-ykiko Dec 15, 2025
9046de8
use lld-link
16bit-ykiko Dec 15, 2025
dbd8d2a
fix build
16bit-ykiko Dec 15, 2025
0c1b1ba
fix option
16bit-ykiko Dec 15, 2025
c994b61
fix option
16bit-ykiko Dec 15, 2025
46ca6c9
fix cmake
16bit-ykiko Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
196 changes: 196 additions & 0 deletions .github/workflows/build-llvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
name: build llvm

on:
pull_request:
# if you want to run this workflow, change the branch name to main,
# if you want to turn off it, change it to non existent branch.
branches: [main-turn-off]

Comment thread
16bit-ykiko marked this conversation as resolved.
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# Windows
- os: windows-2025
llvm_mode: Debug
lto: OFF
- os: windows-2025
llvm_mode: RelWithDebInfo
lto: OFF
- os: windows-2025
llvm_mode: RelWithDebInfo
lto: ON
# Linux
- os: ubuntu-24.04
llvm_mode: Debug
lto: OFF
- os: ubuntu-24.04
llvm_mode: RelWithDebInfo
lto: OFF
- os: ubuntu-24.04
llvm_mode: RelWithDebInfo
lto: ON
# macOS
- os: macos-15
llvm_mode: Debug
lto: OFF
- os: macos-15
llvm_mode: RelWithDebInfo
lto: OFF
- os: macos-15
llvm_mode: RelWithDebInfo
lto: ON

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

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Free Disk Space
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main

- name: Increase Swap Space
if: runner.os == 'Linux'
run: |
echo "===== Initial Status ====="
sudo swapon --show
free -h
echo "===== Creating Swap File ====="
sudo swapoff -a
sudo fallocate -l 16G /mnt/swapfile
sudo chmod 600 /mnt/swapfile
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
echo "===== Final Status ====="
sudo swapon --show
free -h
df -h
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.59.0
environments: package
activate-environment: true
cache: true
locked: true

- name: Clone llvm-project (21.1.4)
shell: bash
run: |
git clone --branch llvmorg-21.1.4 --depth 1 https://github.com/llvm/llvm-project.git .llvm
- name: Build LLVM (install-distribution)
shell: bash
run: |
pixi run build-llvm --llvm-src=.llvm --mode="${{ matrix.llvm_mode }}" --lto="${{ matrix.lto }}" --build-dir=build
- name: Build clice using installed LLVM
shell: bash
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.llvm_mode }} \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake \
-DCLICE_ENABLE_TEST=ON \
-DCLICE_CI_ENVIRONMENT=ON \
-DCLICE_ENABLE_LTO=${{ matrix.lto }} \
-DLLVM_INSTALL_PATH=".llvm/build-install"
Comment thread
16bit-ykiko marked this conversation as resolved.
cmake --build build
- name: Run tests
shell: bash
run: |
EXE_EXT=""
if [[ "${{ runner.os }}" == "Windows" ]]; then
EXE_EXT=".exe"
fi
./build/bin/unit_tests${EXE_EXT} --test-dir="./tests/data"
uv run --project tests pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice${EXE_EXT}
- name: Prune LLVM static libraries (Debug/RelWithDebInfo no LTO)
if: matrix.llvm_mode == 'Debug' || (matrix.llvm_mode == 'RelWithDebInfo' && matrix.lto == 'OFF')
shell: bash
run: |
MANIFEST="pruned-libs-${{ matrix.os }}.json"
echo "LLVM_PRUNED_MANIFEST=${MANIFEST}" >> "${GITHUB_ENV}"
python3 scripts/prune-llvm-bin.py \
--action discover \
--install-dir ".llvm/build-install/lib" \
--build-dir "build" \
--max-attempts 60 \
--sleep-seconds 60 \
--manifest "${MANIFEST}"
Comment thread
16bit-ykiko marked this conversation as resolved.
- name: Upload pruned-libs manifest
if: matrix.llvm_mode == 'RelWithDebInfo' && matrix.lto == 'OFF'
uses: actions/upload-artifact@v4
with:
name: llvm-pruned-libs-${{ matrix.os }}
path: ${{ env.LLVM_PRUNED_MANIFEST }}
if-no-files-found: error
compression-level: 0

- name: Apply pruned-libs manifest (RelWithDebInfo + LTO)
if: matrix.llvm_mode == 'RelWithDebInfo' && matrix.lto == 'ON'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
MANIFEST="pruned-libs-${{ matrix.os }}.json"
python3 scripts/prune-llvm-bin.py \
--action apply \
--manifest "${MANIFEST}" \
--install-dir ".llvm/build-install/lib" \
--build-dir "build" \
--gh-run-id "${{ github.run_id }}" \
--gh-artifact "llvm-pruned-libs-${{ matrix.os }}" \
--gh-download-dir "artifacts" \
--max-attempts 60 \
--sleep-seconds 60
Comment thread
16bit-ykiko marked this conversation as resolved.
- name: Package LLVM install directory
shell: bash
run: |
MODE_TAG="releasedbg"
if [[ "${{ matrix.llvm_mode }}" == "Debug" ]]; then
MODE_TAG="debug"
fi
ARCH="x64"
PLATFORM="linux"
TOOLCHAIN="gnu"
if [[ "${{ matrix.os }}" == windows-* ]]; then
PLATFORM="windows"
TOOLCHAIN="msvc"
elif [[ "${{ matrix.os }}" == macos-* ]]; then
ARCH="arm64"
PLATFORM="macos"
TOOLCHAIN="clang"
fi
Comment thread
16bit-ykiko marked this conversation as resolved.
SUFFIX=""
if [[ "${{ matrix.lto }}" == "ON" ]]; then
SUFFIX="-lto"
fi
if [[ "${{ matrix.llvm_mode }}" == "Debug" ]]; then
SUFFIX="${SUFFIX}-asan"
fi
ARCHIVE="${ARCH}-${PLATFORM}-${TOOLCHAIN}-${MODE_TAG}${SUFFIX}.tar.xz"
set -eo pipefail
tar -C .llvm -cf - build-install | xz -T0 -9 -c > "${ARCHIVE}"
echo "LLVM_INSTALL_ARCHIVE=${ARCHIVE}" >> "${GITHUB_ENV}"
Comment thread
16bit-ykiko marked this conversation as resolved.
- name: Upload LLVM install artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.LLVM_INSTALL_ARCHIVE }}
path: ${{ env.LLVM_INSTALL_ARCHIVE }}
if-no-files-found: error
65 changes: 12 additions & 53 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- "src/**"
- "tests/**"
- "CMakeLists.txt"

pull_request:
branches: [main]
paths:
Expand All @@ -27,86 +28,44 @@ jobs:
include:
- os: windows-2025
build_type: RelWithDebInfo
cc: clang
cxx: clang++
- os: ubuntu-24.04
build_type: Debug
cc: clang-20
cxx: clang++-20
- os: macos-15
build_type: Debug
cc: clang
cxx: clang++

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

steps:
- name: Setup dependencies (Windows)
if: runner.os == 'Windows'
uses: MinoruSekine/setup-scoop@v4.0.1
with:
buckets: main
apps: ninja

- name: Setup dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y gcc-14 g++-14 libstdc++-14-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
sudo update-alternatives --set gcc /usr/bin/gcc-14
sudo update-alternatives --set g++ /usr/bin/g++-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20 all
sudo apt install -y cmake ninja-build

- name: Setup dependencies (MacOS)
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
brew install llvm@20 lld@20

- name: Checkout repository
uses: actions/checkout@v4

- name: Setup msvc sysroot for cmake
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.59.0
environments: develop
activate-environment: true
cache: true
locked: true
Comment thread
16bit-ykiko marked this conversation as resolved.

- name: Build clice
shell: bash
run: |
if [[ "${{ runner.os }}" == "macOS" ]]; then
export SDKROOT=$(xcrun --show-sdk-path)
export PATH="/opt/homebrew/opt/llvm@20/bin:/opt/homebrew/opt/lld@20/bin:$PATH"
fi

cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCLICE_ENABLE_TEST=ON \
-DCLICE_CI_ENVIRONMENT=ON

cmake --build build
Comment thread
16bit-ykiko marked this conversation as resolved.

- name: Install uv for integration tests
uses: astral-sh/setup-uv@v6

- name: Run tests
shell: bash
run: |
EXE_EXT=""
if [[ "${{ runner.os }}" == "Windows" ]]; then
EXE_EXT=".exe"
fi

if [[ "${{ runner.os }}" == "macOS" ]]; then
export PATH="/opt/homebrew/opt/llvm@20/bin:/opt/homebrew/opt/lld@20/bin:$PATH"
fi

./build/bin/unit_tests${EXE_EXT} --test-dir="./tests/data"
uv run --project tests pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice${EXE_EXT}
54 changes: 0 additions & 54 deletions .github/workflows/docker.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/upload-llvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: upload-llvm

permissions:
contents: write

on:
pull_request:
# if you want to run this workflow, change the branch name to main,
# if you want to turn off it, change it to non existent branch.
branches: [main-turn-off]

workflow_dispatch:
inputs:
workflow_id:
description: "Workflow run ID to pull artifacts from"
required: true
type: string
version:
description: "Release version/tag to publish (e.g., v1.2.3)"
required: true
type: string

jobs:
upload:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Download artifacts from workflow
env:
GH_TOKEN: ${{ github.token }}
run: scripts/download-llvm.sh "${{ inputs.workflow_id }}"

- name: Recreate release with artifacts
env:
GH_TOKEN: ${{ secrets.UPLOAD_LLVM }}
TARGET_REPO: clice-io/clice-llvm
run: python3 scripts/upload-llvm.py "${{ inputs.version }}" "${TARGET_REPO}" "${{ inputs.workflow_id }}"
Loading
Loading