mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-23 02:56:37 +00:00
Fix glibc detection on Fedora (#2205)
This commit is contained in:
parent
a90dd4569f
commit
bb9211b72c
2 changed files with 37 additions and 11 deletions
46
.github/workflows/ci.yml
vendored
46
.github/workflows/ci.yml
vendored
|
@ -232,27 +232,30 @@ jobs:
|
||||||
needs: changed-files
|
needs: changed-files
|
||||||
if: needs.changed-files.outputs.has_detect_target_changed == 'true'
|
if: needs.changed-files.outputs.has_detect_target_changed == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
strategy:
|
||||||
CARGO_BUILD_TARGET: x86_64-unknown-linux-musl
|
matrix:
|
||||||
|
arch:
|
||||||
|
- x86_64
|
||||||
|
- aarch64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install ${{ env.CARGO_BUILD_TARGET }} target
|
- name: Install ${{ matrix.arch }}-unknown-linux-musl target
|
||||||
run: |
|
run: |
|
||||||
rustup target add $CARGO_BUILD_TARGET
|
rustup target add ${{ matrix.arch }}-unknown-linux-musl
|
||||||
pip3 install -r zigbuild-requirements.txt
|
pip3 install -r zigbuild-requirements.txt
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
cache-all-crates: true
|
cache-all-crates: true
|
||||||
- name: Build detect-targets
|
- name: Build detect-targets
|
||||||
run: |
|
run: |
|
||||||
cargo zigbuild --features cli-logging --target $CARGO_BUILD_TARGET
|
cargo zigbuild --features cli-logging --target ${{ matrix.arch }}-unknown-linux-musl
|
||||||
# Set working directory here, otherwise `cargo-zigbuild` would download
|
# Set working directory here, otherwise `cargo-zigbuild` would download
|
||||||
# and build quite a few unused dependencies.
|
# and build quite a few unused dependencies.
|
||||||
working-directory: crates/detect-targets
|
working-directory: crates/detect-targets
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: detect-targets
|
name: detect-targets-${{ matrix.arch }}
|
||||||
path: target/${{ env.CARGO_BUILD_TARGET }}/debug/detect-targets
|
path: target/${{ matrix.arch }}-unknown-linux-musl/debug/detect-targets
|
||||||
|
|
||||||
detect-targets-alpine-test:
|
detect-targets-alpine-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -265,7 +268,7 @@ jobs:
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: detect-targets
|
name: detect-targets-x86_64
|
||||||
- run: chmod +x detect-targets
|
- run: chmod +x detect-targets
|
||||||
|
|
||||||
- name: Run test in alpine
|
- name: Run test in alpine
|
||||||
|
@ -306,7 +309,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: detect-targets
|
name: detect-targets-x86_64
|
||||||
- run: chmod +x detect-targets
|
- run: chmod +x detect-targets
|
||||||
|
|
||||||
- name: Run test in ubuntu
|
- name: Run test in ubuntu
|
||||||
|
@ -332,7 +335,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: detect-targets
|
name: detect-targets-x86_64
|
||||||
- run: chmod +x detect-targets
|
- run: chmod +x detect-targets
|
||||||
|
|
||||||
- name: Run test
|
- name: Run test
|
||||||
|
@ -342,6 +345,27 @@ jobs:
|
||||||
--mount src="$PWD/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \
|
--mount src="$PWD/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \
|
||||||
${{ matrix.container }} detect-targets )" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ]
|
${{ matrix.container }} detect-targets )" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ]
|
||||||
|
|
||||||
|
detect-targets-more-glibc-test-arm:
|
||||||
|
needs:
|
||||||
|
- detect-targets-build
|
||||||
|
- changed-files
|
||||||
|
if: needs.changed-files.outputs.has_detect_target_changed == 'true'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: detect-targets-aarch64
|
||||||
|
- run: chmod +x detect-targets
|
||||||
|
|
||||||
|
- name: Run test
|
||||||
|
run: |
|
||||||
|
set -exuo pipefail
|
||||||
|
[ "$(docker run --rm \
|
||||||
|
--mount src="$PWD/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \
|
||||||
|
fedora detect-targets )" = "$(printf 'aarch64-unknown-linux-gnu\naarch64-unknown-linux-musl')" ]
|
||||||
|
|
||||||
detect-targets-nix-test:
|
detect-targets-nix-test:
|
||||||
needs:
|
needs:
|
||||||
- detect-targets-build
|
- detect-targets-build
|
||||||
|
@ -351,7 +375,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: detect-targets
|
name: detect-targets-x86_64
|
||||||
- run: chmod +x detect-targets
|
- run: chmod +x detect-targets
|
||||||
|
|
||||||
- name: Run test
|
- name: Run test
|
||||||
|
|
|
@ -52,8 +52,10 @@ pub(super) async fn detect_targets(target: String) -> Vec<String> {
|
||||||
format!("/lib64/{dirname}/{filename}"),
|
format!("/lib64/{dirname}/{filename}"),
|
||||||
format!("/usr/lib/{dirname}/{filename}"),
|
format!("/usr/lib/{dirname}/{filename}"),
|
||||||
format!("/usr/lib64/{dirname}/{filename}"),
|
format!("/usr/lib64/{dirname}/{filename}"),
|
||||||
|
"/usr/lib64/libc.so.6".to_string(),
|
||||||
format!("/usr/lib/{dirname}/libc.so.6"),
|
format!("/usr/lib/{dirname}/libc.so.6"),
|
||||||
format!("/usr/lib64/{dirname}/libc.so.6"),
|
format!("/usr/lib64/{dirname}/libc.so.6"),
|
||||||
|
"/usr/lib64/libc.so".to_string(),
|
||||||
format!("/usr/lib/{dirname}/libc.so"),
|
format!("/usr/lib/{dirname}/libc.so"),
|
||||||
format!("/usr/lib64/{dirname}/libc.so"),
|
format!("/usr/lib64/{dirname}/libc.so"),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue