Skip to content

Build Null-Safe Clang Binaries #2

Build Null-Safe Clang Binaries

Build Null-Safe Clang Binaries #2

Workflow file for this run

name: Build Null-Safe Clang Binaries
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build cmake build-essential ccache
- name: Setup ccache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache-linux-${{ github.sha }}
restore-keys: |
ccache-linux-
- name: Configure build
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
../llvm
- name: Build Clang and clangd
run: |
cd build
ninja clang clangd
- name: Install Clang and clangd
run: |
cd build
ninja install-clang
ninja install-clang-headers
ninja install-clangd
- name: Package binaries
run: |
cd install
tar -czf clang-nullsafe-linux-x86_64.tar.gz bin/ lib/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: clang-nullsafe-linux-x86_64
path: install/clang-nullsafe-linux-x86_64.tar.gz
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: install/clang-nullsafe-linux-x86_64.tar.gz
body: |
## Null-Safe Clang Binary Release
This release contains the Null-Safe Clang compiler and clangd language server for Linux x86_64.
### What's included:
- `clang` - The Null-Safe C compiler
- `clangd` - Language server for IDE integration (VSCode, vim, etc.)
### Installation:
```bash
tar -xzf clang-nullsafe-linux-x86_64.tar.gz
export PATH=$PWD/bin:$PATH
clang --version
```
### Usage:
```bash
# Compile with null-safety warnings (default)
clang mycode.c
# Promote warnings to errors
clang -Werror=nullability mycode.c
# Disable null-safety checking
clang -fno-strict-nullability mycode.c
```
See the [README](https://github.com/cs01/llvm-project/blob/null-safe-c-dev/README.md) for full documentation.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install ninja cmake ccache
- name: Setup ccache
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ccache-macos-${{ github.sha }}
restore-keys: |
ccache-macos-
- name: Configure build
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \
-DLLVM_TARGETS_TO_BUILD="AArch64;X86" \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
../llvm
- name: Build Clang and clangd
run: |
cd build
ninja clang clangd
- name: Install Clang and clangd
run: |
cd build
ninja install-clang
ninja install-clang-headers
ninja install-clangd
- name: Package binaries
run: |
cd install
tar -czf clang-nullsafe-macos-universal.tar.gz bin/ lib/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: clang-nullsafe-macos-universal
path: install/clang-nullsafe-macos-universal.tar.gz
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: install/clang-nullsafe-macos-universal.tar.gz
body: |
## Null-Safe Clang Binary Release (macOS)
This release contains the Null-Safe Clang compiler and clangd language server for macOS (Intel and Apple Silicon).
### What's included:
- `clang` - The Null-Safe C compiler
- `clangd` - Language server for IDE integration (VSCode, vim, etc.)
### Installation:
```bash
tar -xzf clang-nullsafe-macos-universal.tar.gz
export PATH=$PWD/bin:$PATH
clang --version
```
See the [README](https://github.com/cs01/llvm-project/blob/null-safe-c-dev/README.md) for usage instructions.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
choco install ninja cmake sccache
- name: Setup sccache
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache
key: sccache-windows-${{ github.sha }}
restore-keys: |
sccache-windows-
- name: Configure build
run: |
mkdir build
cd build
cmake -G Ninja `
-DCMAKE_BUILD_TYPE=Release `
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" `
-DLLVM_TARGETS_TO_BUILD="X86" `
-DLLVM_ENABLE_ASSERTIONS=OFF `
-DCMAKE_INSTALL_PREFIX=../install `
-DCMAKE_C_COMPILER_LAUNCHER=sccache `
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache `
../llvm
- name: Build Clang and clangd
run: |
cd build
ninja clang clangd
- name: Install Clang and clangd
run: |
cd build
ninja install-clang
ninja install-clang-headers
ninja install-clangd
- name: Package binaries
run: |
cd install
tar -czf clang-nullsafe-windows-x86_64.tar.gz bin/ lib/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: clang-nullsafe-windows-x86_64
path: install/clang-nullsafe-windows-x86_64.tar.gz
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: install/clang-nullsafe-windows-x86_64.tar.gz
body: |
## Null-Safe Clang Binary Release (Windows)
This release contains the Null-Safe Clang compiler and clangd language server for Windows x86_64.
### What's included:
- `clang.exe` - The Null-Safe C compiler
- `clangd.exe` - Language server for IDE integration (VSCode, vim, etc.)
### Installation:
```bash
tar -xzf clang-nullsafe-windows-x86_64.tar.gz
# Add bin/ directory to your PATH
clang --version
```
See the [README](https://github.com/cs01/llvm-project/blob/null-safe-c-dev/README.md) for usage instructions.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}