-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] add multi-platform pre-commit github actions #119104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e6e227a
49ca7bc
a16c16e
feb3428
d1af585
0cf345f
008ffef
1263dbc
a7738ed
8f3c0ee
df70886
08d00cc
fcb2500
0be378f
779c806
009b76c
6776e8d
a9eba5e
8482b9d
5c8fba1
39e83dc
6f3b9eb
0b4323b
7cee92f
19c4456
1b0d03b
2356ffd
2e014bd
e2f1982
ad8b7d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# This workflow is for pre-commit testing of the LLVM-libc project. | ||
name: LLVM-libc Pre-commit Fullbuild Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- 'libc/**' | ||
- '.github/workflows/libc-fullbuild-tests.yml' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- c_compiler: clang | ||
cpp_compiler: clang++ | ||
# TODO: add back gcc build when it is fixed | ||
# - c_compiler: gcc | ||
# cpp_compiler: g++ | ||
Comment on lines
+20
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have more context about what's going wrong with the gcc builds? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please see https://github.com/llvm/llvm-project/actions/runs/12217700280/job/34082285018?pr=119104 and https://github.com/llvm/llvm-project/actions/runs/12218362957/job/34083763790?pr=119104 First one is for overlay and latter one for fullbuild. |
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
max-size: 1G | ||
key: libc_fullbuild_${{ matrix.c_compiler }} | ||
variant: sccache | ||
|
||
- name: Prepare dependencies (Ubuntu) | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-headers-generic linux-libc-dev | ||
sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need the symlink? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debian and its variants has a multilib sysroot, so arch-dependent headers are not installed into Ideally, |
||
|
||
- name: Set reusable strings | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
echo "build-install-dir=${{ github.workspace }}/install" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Configure CMake | ||
run: > | ||
cmake -B ${{ steps.strings.outputs.build-output-dir }} | ||
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | ||
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | ||
-DCMAKE_BUILD_TYPE=MinSizeRel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GHA has limited cache capability (10G in total). And we need to share it with other projects such as |
||
-DCMAKE_C_COMPILER_LAUNCHER=sccache | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache | ||
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} | ||
-DLLVM_ENABLE_RUNTIMES="libc;compiler-rt" | ||
-DLLVM_LIBC_FULL_BUILD=ON | ||
-DLLVM_LIBC_INCLUDE_SCUDO=ON | ||
-DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON | ||
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF | ||
-DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF | ||
-G Ninja | ||
-S ${{ github.workspace }}/runtimes | ||
|
||
- name: Build | ||
run: > | ||
cmake | ||
--build ${{ steps.strings.outputs.build-output-dir }} | ||
--parallel | ||
--target install | ||
|
||
- name: Test | ||
run: > | ||
cmake | ||
--build ${{ steps.strings.outputs.build-output-dir }} | ||
--parallel | ||
--target check-libc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# This workflow is for pre-commit testing of the LLVM-libc project. | ||
name: LLVM-libc Pre-commit Overlay Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- 'libc/**' | ||
- '.github/workflows/libc-overlay-tests.yml' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# TODO: add linux gcc when it is fixed | ||
- os: ubuntu-24.04 | ||
compiler: | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
- os: windows-2022 | ||
compiler: | ||
c_compiler: clang-cl | ||
cpp_compiler: clang-cl | ||
- os: macos-14 | ||
compiler: | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup ccache | ||
uses: hendrikmuhs/ccache-action@v1 | ||
with: | ||
max-size: 1G | ||
key: libc_overlay_build_${{ matrix.os }}_${{ matrix.compiler.c_compiler }} | ||
variant: sccache | ||
|
||
- name: Prepare dependencies (Ubuntu) | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build | ||
|
||
- name: Prepare dependencies (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
choco install ninja | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is https://github.com/chocolatey/choco does that itself have to be installed, or does it ship on the github buildbots? I guess same question for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is shipped in image per github spec. Please see https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md |
||
|
||
- name: Prepare dependencies (macOS) | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew install ninja | ||
|
||
- name: Set reusable strings | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Configure CMake | ||
run: > | ||
cmake -B ${{ steps.strings.outputs.build-output-dir }} | ||
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }} | ||
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }} | ||
-DCMAKE_BUILD_TYPE=MinSizeRel | ||
-DCMAKE_C_COMPILER_LAUNCHER=sccache | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache | ||
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to set 141? Surely we can omit that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, following the instructions from https://github.com/mozilla/sccache/tree/main?tab=readme-ov-file#usage |
||
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this necessary for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is following the instructions from https://github.com/mozilla/sccache/tree/main?tab=readme-ov-file#usage |
||
-DLLVM_ENABLE_RUNTIMES=libc | ||
-G Ninja | ||
-S ${{ github.workspace }}/runtimes | ||
|
||
- name: Build | ||
run: > | ||
cmake | ||
--build ${{ steps.strings.outputs.build-output-dir }} | ||
--parallel | ||
--config MinSizeRel | ||
--target libc | ||
|
||
- name: Test | ||
run: > | ||
cmake | ||
--build ${{ steps.strings.outputs.build-output-dir }} | ||
--parallel | ||
--target check-libc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add:
To each new file you've added. This is standard best practices for GitHub actions definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the same level of name? Sure. Adding now