Skip to content

Commit e2dae9b

Browse files
committed
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.
1 parent da8433d commit e2dae9b

File tree

6 files changed

+27
-10
lines changed

6 files changed

+27
-10
lines changed

.github/workflows/main.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ jobs:
108108
- name: Print runner information
109109
run: uname -a
110110
- uses: actions/checkout@v4
111-
with:
112-
submodules: true
113111
- name: Install Rust (rustup)
114112
shell: bash
115113
run: |
@@ -146,6 +144,10 @@ jobs:
146144
shell: bash
147145
- run: echo "RUST_COMPILER_RT_ROOT=$(realpath ./compiler-rt)" >> "$GITHUB_ENV"
148146
shell: bash
147+
148+
- name: Download musl source
149+
run: ./ci/update-musl.sh
150+
shell: bash
149151

150152
- name: Verify API list
151153
if: matrix.os == 'ubuntu-24.04'
@@ -182,15 +184,15 @@ jobs:
182184
timeout-minutes: 10
183185
steps:
184186
- uses: actions/checkout@v4
185-
with:
186-
submodules: true
187187
# Unlike rustfmt, stable clippy does not work on code with nightly features.
188188
- name: Install nightly `clippy`
189189
run: |
190190
rustup set profile minimal
191191
rustup default nightly
192192
rustup component add clippy
193193
- uses: Swatinem/rust-cache@v2
194+
- name: Download musl source
195+
run: ./ci/update-musl.sh
194196
- run: cargo clippy --workspace --all-targets
195197

196198
benchmarks:
@@ -223,6 +225,8 @@ jobs:
223225
- uses: Swatinem/rust-cache@v2
224226
with:
225227
key: ${{ matrix.target }}
228+
- name: Download musl source
229+
run: ./ci/update-musl.sh
226230

227231
- name: Run icount benchmarks
228232
env:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ iai-home
1414
*.bk
1515
*.rs.bk
1616
.#*
17+
18+
# Manually managed
19+
crates/musl-math-sys/musl

.gitmodules

Lines changed: 0 additions & 4 deletions
This file was deleted.

ci/update-musl.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
# Download musl to a repository for `musl-math-sys`
3+
4+
set -eux
5+
6+
url=git://git.musl-libc.org/musl
7+
ref=c47ad25ea3b484e10326f933e927c0bc8cded3da
8+
dst=crates/musl-math-sys/musl
9+
10+
if ! [ -d "$dst" ]; then
11+
git clone "$url" "$dst" --single-branch --depth=1000
12+
fi
13+
14+
git -C "$dst" fetch "$url" --depth=1
15+
git -C "$dst" checkout "$ref"

crates/musl-math-sys/musl

Lines changed: 0 additions & 1 deletion
This file was deleted.

libm-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ publish = false
66
license = "MIT OR Apache-2.0"
77

88
[features]
9-
default = ["build-mpfr", "build-musl", "unstable-float"]
9+
default = ["build-mpfr", "unstable-float"]
1010

1111
# Propagated from libm because this affects which functions we test.
1212
unstable-float = ["libm/unstable-float", "rug?/nightly-float"]

0 commit comments

Comments
 (0)