Skip to content

[libc][workflow] address permission concern and add more comments #119320

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

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 16 additions & 3 deletions .github/workflows/libc-fullbuild-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This workflow is for pre-commit testing of the LLVM-libc project.
name: LLVM-libc Pre-commit Fullbuild Tests

permissions:
contents: read
on:
pull_request:
branches: [ "main" ]
Expand All @@ -22,14 +23,24 @@ jobs:
# cpp_compiler: g++
steps:
- uses: actions/checkout@v4


# Libc's build is relatively small comparing with other components of LLVM.
# A fresh fullbuild takes about 190MiB of uncompressed disk space, which can
# be compressed into ~40MiB. Limiting the cache size to 1G should be enough.
# Prefer sccache as it is more modern.
# Do not use direct GHAC access even though it is supported by sccache. GHAC rejects
# frequent small object writes.
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
max-size: 1G
key: libc_fullbuild_${{ matrix.c_compiler }}
variant: sccache

# Notice:
# - MPFR is required by some of the mathlib tests.
# - Debian has a multilib setup, so we need to symlink the asm directory.
# For more information, see https://wiki.debian.org/Multiarch/LibraryPathOverview
- name: Prepare dependencies (Ubuntu)
run: |
sudo apt-get update
Expand All @@ -42,7 +53,9 @@ jobs:
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
echo "build-install-dir=${{ github.workspace }}/install" >> "$GITHUB_OUTPUT"


# Configure libc fullbuild with scudo.
# Use MinSizeRel to reduce the size of the build.
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/libc-overlay-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This workflow is for pre-commit testing of the LLVM-libc project.
name: LLVM-libc Pre-commit Overlay Tests

permissions:
contents: read
on:
pull_request:
branches: [ "main" ]
Expand Down Expand Up @@ -32,20 +33,30 @@ jobs:

steps:
- uses: actions/checkout@v4


# Libc's build is relatively small comparing with other components of LLVM.
# A fresh linux overlay takes about 180MiB of uncompressed disk space, which can
# be compressed into ~40MiB. MacOS and Windows overlay builds are less than 10MiB
# after compression. Limiting the cache size to 1G should be enough.
# Prefer sccache as it is modern and it has a guarantee to work with MSVC.
# Do not use direct GHAC access even though it is supported by sccache. GHAC rejects
# frequent small object writes.
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
max-size: 1G
key: libc_overlay_build_${{ matrix.os }}_${{ matrix.compiler.c_compiler }}
variant: sccache

# MPFR is required by some of the mathlib tests.
- 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

# Chocolatey is shipped with Windows runners. Windows Server 2025 recommends WinGet.
# Consider migrating to WinGet when Windows Server 2025 is available.
- name: Prepare dependencies (Windows)
if: runner.os == 'Windows'
run: |
Expand All @@ -62,6 +73,9 @@ jobs:
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

# Use MinSizeRel to reduce the size of the build.
# Notice that CMP0141=NEW and MSVC_DEBUG_INFORMATION_FORMAT=Embedded are required
# by the sccache tool.
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
Expand Down
Loading