Replace the musl submodule with a download script

The submodule was causing issues in rust-lang/rust, so eliminiate it
here. `build-musl` is also removed from `libm-test`'s default features
so the crate doesn't need to be built by default.
This commit is contained in:
Trevor Gross
2025-06-04 08:20:08 +00:00
parent 5778643174
commit e1e3cc24a2
7 changed files with 30 additions and 19 deletions

View File

@@ -108,8 +108,6 @@ jobs:
- name: Print runner information
run: uname -a
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust (rustup)
shell: bash
run: |
@@ -146,6 +144,10 @@ jobs:
shell: bash
- run: echo "RUST_COMPILER_RT_ROOT=$(realpath ./compiler-rt)" >> "$GITHUB_ENV"
shell: bash
- name: Download musl source
run: ./ci/update-musl.sh
shell: bash
- name: Verify API list
if: matrix.os == 'ubuntu-24.04'
@@ -182,8 +184,6 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
# Unlike rustfmt, stable clippy does not work on code with nightly features.
- name: Install nightly `clippy`
run: |
@@ -191,6 +191,8 @@ jobs:
rustup default nightly
rustup component add clippy
- uses: Swatinem/rust-cache@v2
- name: Download musl source
run: ./ci/update-musl.sh
- run: cargo clippy --workspace --all-targets
benchmarks:
@@ -205,8 +207,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
with:
submodules: true
- uses: taiki-e/install-action@cargo-binstall
- name: Set up dependencies
@@ -223,6 +223,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Download musl source
run: ./ci/update-musl.sh
- name: Run icount benchmarks
env:
@@ -256,8 +258,6 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update nightly --no-self-update && rustup default nightly
shell: bash
@@ -292,8 +292,6 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable `rustfmt`
run: rustup set profile minimal && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check
@@ -317,13 +315,13 @@ jobs:
TO_TEST: ${{ matrix.to_test }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
run: |
rustup update nightly --no-self-update
rustup default nightly
- uses: Swatinem/rust-cache@v2
- name: download musl source
run: ./ci/update-musl.sh
- name: Run extensive tests
run: ./ci/run-extensive.sh
- name: Print test logs if available

View File

@@ -14,3 +14,6 @@ iai-home
*.bk
*.rs.bk
.#*
# Manually managed
crates/musl-math-sys/musl

View File

@@ -1,4 +0,0 @@
[submodule "crates/musl-math-sys/musl"]
path = crates/musl-math-sys/musl
url = https://git.musl-libc.org/git/musl
shallow = true

View File

@@ -0,0 +1,15 @@
#!/bin/sh
# Download musl to a repository for `musl-math-sys`
set -eux
url=git://git.musl-libc.org/musl
ref=c47ad25ea3b484e10326f933e927c0bc8cded3da
dst=crates/musl-math-sys/musl
if ! [ -d "$dst" ]; then
git clone "$url" "$dst" --single-branch --depth=1000
fi
git -C "$dst" fetch "$url" --depth=1
git -C "$dst" checkout "$ref"

View File

@@ -120,7 +120,7 @@ fn build_musl_math(cfg: &Config) {
let arch_dir = musl_dir.join("arch").join(&cfg.musl_arch);
assert!(
math.exists(),
"musl source not found. Is the submodule up to date?"
"musl source not found. You may need to run `./ci/update-musl.sh`."
);
let source_map = find_math_source(&math, cfg);

Submodule library/compiler-builtins/crates/musl-math-sys/musl deleted from c47ad25ea3

View File

@@ -6,7 +6,7 @@ publish = false
license = "MIT OR Apache-2.0"
[features]
default = ["build-mpfr", "build-musl", "unstable-float"]
default = ["build-mpfr", "unstable-float"]
# Propagated from libm because this affects which functions we test.
unstable-float = ["libm/unstable-float", "rug?/nightly-float"]