mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-06 04:00:02 +00:00
Fix detect-targets
on Linux and add CI testing (#1344)
* Testing: Add `detect-targets/src/main.rs` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix `detect-targets` linux: `guess_host_triple` could return wrong libc info so it has to check it manually instead of simply providing alternatives like other OSes. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix `get_ld_flavor` for Alpine's gcompat glibc Its output is different from regular glibc, so we need to hardcode that particular cases. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix detection of alpine specific musl target Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Add ci testing for Alpine Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Add CI test for detect-targets on ubuntu Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Refactor `get_ld_flavor` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix shellcheck Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Add more CI test for ubuntu and fixed typo in it Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Rm distro specific target as it breaks `cargo-install` fallback Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Make sure all binaries are built in CI Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Add `package.metadata.binstall` for `detect-targets` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix justfile Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix `detect-targets-{alpine, ubuntu}-test` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix `detect-targets-ubuntu-test` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix `debug-targets-ubuntu-test` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * `set -exuo pipefail` in `detect-targets-ubuntu-test` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Simplify `detect-targets-*-test`: Use `Swatinem/rust-cache@v2` directly instead of using `just-setup` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Rm dup steps in `detect-targets-ubuntu-test` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Add `ls` to detect-targets-alpine-test for debugging Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * FIx `detect-targets-alpine-test` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix `get_ld_flavor` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix `linux::detect_targets` on ubuntu & glibc system Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * FIx `linux::detect_targets` glibc checking Check dynlib suffix Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> --------- Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
d657fbe518
commit
76a692224d
7 changed files with 159 additions and 85 deletions
20
test-detect-targets-musl.sh
Executable file
20
test-detect-targets-musl.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/ash
|
||||
|
||||
# shellcheck shell=dash
|
||||
|
||||
set -exuo pipefail
|
||||
|
||||
TARGET=${1?}
|
||||
|
||||
[ "$(detect-targets)" = "$TARGET" ]
|
||||
|
||||
apk update
|
||||
apk add gcompat
|
||||
|
||||
ls -lsha /lib
|
||||
|
||||
GNU_TARGET=$(echo "$TARGET" | sed 's/musl/gnu/')
|
||||
|
||||
[ "$(detect-targets)" = "$(printf '%s\n%s' "$GNU_TARGET" "$TARGET")" ]
|
||||
|
||||
echo
|
Loading…
Add table
Add a link
Reference in a new issue