21 Commits

Author SHA1 Message Date
Dave Rolsky
46b4378cc7 Add release date to changes
Some checks failed
Lint / Check that code is lint clean using precious (push) Failing after 8s
Self-test / Test (map[cache-cross-binary:false can_test:true cross-version:19be834 expect_cross:--expect-cross expect_cross_version:19be834 expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64 with cross 19be834 t… (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:false can_test:true cross-version:v0.2.3 expect_cross:--expect-cross expect_cross_version:0.2.3 expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64 with cross v0.2.3 (no c… (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:false can_test:true expect_cross:--expect-cross expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64 (no cache) target:aarch64-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:false expect_cross:--expect-cross expect_file_re:x86-64.+FreeBSD expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:FreeBSD-x86_64 target:x86_64-unknown-freebsd]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:false expect_cross:--expect-cross expect_file_re:x86-64.+NetBSD expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:NetBSD-x86_64 target:x86_64-unknown-netbsd]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:false expect_cross:--no-expect-cross expect_file_re:Aarch64.+Windows expect_stripped:--no-expect-stripped os:windows-latest platform_name:Windows-aarch64 target:aarch64-pc-windows-msvc]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:false expect_cross:--no-expect-cross expect_file_re:Mach-O.+arm64 expect_stripped:--expect-stripped os:macOS-latest platform_name:macOS-aarch64 target:aarch64-apple-darwin]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true cross-version:19be834 expect_cross:--expect-cross expect_cross_version:19be834 expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64 with cross 19be834 ta… (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true cross-version:v0.2.3 expect_cross:--expect-cross expect_cross_version:0.2.3 expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64 with cross v0.2.3 target… (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--expect-cross expect_file_re:32.+ARM expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-arm target:arm-unknown-linux-musleabi]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--expect-cross expect_file_re:32.+PowerPC expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-powerpc target:powerpc-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--expect-cross expect_file_re:64.+PowerPC expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-powerpc64 target:powerpc64-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--expect-cross expect_file_re:64.+PowerPC expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-powerpc64le target:powerpc64le-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--expect-cross expect_file_re:64.+RISC-V expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-riscv64 target:riscv64gc-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--expect-cross expect_file_re:64.+S/390 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-s390x target:s390x-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--expect-cross expect_file_re:ELF.+80386 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-i586 target:i586-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--expect-cross expect_file_re:ELF.+80386 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-i686 target:i686-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--expect-cross expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64 target:aarch64-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--no-expect-cross expect_file_re:80386.+Windows expect_stripped:--expect-stripped os:windows-latest platform_name:Windows-i686 target:i686-pc-windows-msvc]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--no-expect-cross expect_file_re:ELF.+x86-64 expect_stripped:--expect-stripped os:ubuntu-20.04 platform_name:Linux-x86_64 target:x86_64-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_cross:--no-expect-cross expect_file_re:Mach-O.+x86_64 expect_stripped:--expect-stripped os:macOS-latest platform_name:macOS-x86_64 target:x86_64-apple-darwin]) (push) Has been cancelled
Self-test / Test (map[cache-cross-binary:true can_test:true expect_file_re:x86-64.+Windows expect_stripped:--expect-stripped os:windows-latest platform_name:Windows-x86_64 target:x86_64-pc-windows-msvc]) (push) Has been cancelled
2024-05-18 13:22:04 +08:00
Dave Rolsky
e67629a125 Run some tests without caching disabled 2024-05-18 13:19:55 +08:00
Dave Rolsky
83cb238ff9 Force install from git to make sure we can always find cross binary 2024-05-18 12:53:41 +08:00
Dave Rolsky
b80da53df0 Add test for cross from git 2024-05-18 12:40:50 +08:00
Dave Rolsky
6f63b60be6 Tighten regex for release version 2024-05-18 12:40:50 +08:00
Dave Rolsky
ace37a7d90 Print cross version after it's installed 2024-05-18 12:40:50 +08:00
Dave Rolsky
2297f8e434 Add typos command for linting and tidying and fix issues it found 2024-05-18 12:28:18 +08:00
Dave Rolsky
9b467e6799 Add shell linting and tidying and update all shell scripts 2024-05-18 12:28:18 +08:00
Dave Rolsky
c464bd9469 Make it possible to install cross from a git tag 2024-05-18 12:28:18 +08:00
Dave Rolsky
a0b2ccd631 Add more info for latest Changes.md entry 2024-02-25 18:08:12 +08:00
Dave Rolsky
8c9b9d6490 Add Changes.md entry for 0.0.12
Some checks failed
Lint / Check that code is lint clean using precious (push) Failing after 8s
Self-test / Test (map[can_test:false expect_cross:--expect-cross expect_file_re:x86-64.+FreeBSD expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:FreeBSD-x86_64 target:x86_64-unknown-freebsd]) (push) Has been cancelled
Self-test / Test (map[can_test:false expect_cross:--expect-cross expect_file_re:x86-64.+NetBSD expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:NetBSD-x86_64 target:x86_64-unknown-netbsd]) (push) Has been cancelled
Self-test / Test (map[can_test:false expect_cross:--no-expect-cross expect_file_re:Aarch64.+Windows expect_stripped:--no-expect-stripped os:windows-latest platform_name:Windows-aarch64 target:aarch64-pc-windows-msvc]) (push) Has been cancelled
Self-test / Test (map[can_test:false expect_cross:--no-expect-cross expect_file_re:Mach-O.+arm64 expect_stripped:--expect-stripped os:macOS-latest platform_name:macOS-aarch64 target:aarch64-apple-darwin]) (push) Has been cancelled
Self-test / Test (map[can_test:true cross-version:v0.2.3 expect_cross:--expect-cross expect_cross_version:0.2.3 expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64-with-cross-v0.2.3 target:aarch64-unknown-linux-m… (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:32.+ARM expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-arm target:arm-unknown-linux-musleabi]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:32.+PowerPC expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-powerpc target:powerpc-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:64.+PowerPC expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-powerpc64 target:powerpc64-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:64.+PowerPC expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-powerpc64le target:powerpc64le-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:64.+RISC-V expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-riscv64 target:riscv64gc-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:64.+S/390 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-s390x target:s390x-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:ELF.+80386 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-i586 target:i586-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:ELF.+80386 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-i686 target:i686-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64 target:aarch64-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--no-expect-cross expect_file_re:80386.+Windows expect_stripped:--expect-stripped os:windows-latest platform_name:Windows-i686 target:i686-pc-windows-msvc]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--no-expect-cross expect_file_re:ELF.+x86-64 expect_stripped:--expect-stripped os:ubuntu-20.04 platform_name:Linux-x86_64 target:x86_64-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--no-expect-cross expect_file_re:Mach-O.+x86_64 expect_stripped:--expect-stripped os:macOS-latest platform_name:macOS-x86_64 target:x86_64-apple-darwin]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_file_re:x86-64.+Windows expect_stripped:--expect-stripped os:windows-latest platform_name:Windows-x86_64 target:x86_64-pc-windows-msvc]) (push) Has been cancelled
2024-02-25 18:07:08 +08:00
Dave Rolsky
778bb6075f Bump actions/checkout to v4 2024-02-25 18:05:42 +08:00
Dave Rolsky
1bbdab0f68 Merge pull request #13 from hms5232/bump-actions/cache-v4
Bump actions/cache to v4
2024-02-25 18:04:58 +08:00
hms5232
c40662f61a Bump actions/cache to v4
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
2024-02-25 17:47:18 +08:00
Dave Rolsky
7d5643fe34 Small formatting tweak in test code 2024-02-12 19:24:26 +08:00
Dave Rolsky
3be49880a3 Add workaround for NetBSD issues in test-project 2024-01-27 15:23:30 +08:00
Dave Rolsky
070eee0271 Remove the Linux MIPS targets from the tests
This target is no longer supported by the Rust compiler.
2024-01-27 15:19:38 +08:00
Dave Rolsky
d4b2d5201c Add release date to Changes.md
Some checks failed
Lint / Check that code is lint clean using precious (push) Failing after 8s
Self-test / Test (map[can_test:false expect_cross:--expect-cross expect_file_re:x86-64.+FreeBSD expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:FreeBSD-x86_64 target:x86_64-unknown-freebsd]) (push) Has been cancelled
Self-test / Test (map[can_test:false expect_cross:--expect-cross expect_file_re:x86-64.+NetBSD expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:NetBSD-x86_64 target:x86_64-unknown-netbsd]) (push) Has been cancelled
Self-test / Test (map[can_test:false expect_cross:--no-expect-cross expect_file_re:Aarch64.+Windows expect_stripped:--no-expect-stripped os:windows-latest platform_name:Windows-aarch64 target:aarch64-pc-windows-msvc]) (push) Has been cancelled
Self-test / Test (map[can_test:false expect_cross:--no-expect-cross expect_file_re:Mach-O.+arm64 expect_stripped:--expect-stripped os:macOS-latest platform_name:macOS-aarch64 target:aarch64-apple-darwin]) (push) Has been cancelled
Self-test / Test (map[can_test:true cross-version:v0.2.3 expect_cross:--expect-cross expect_cross_version:0.2.3 expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64-with-cross-v0.2.3 target:aarch64-unknown-linux-m… (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:32.+ARM expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-arm target:arm-unknown-linux-musleabi]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:32.+PowerPC expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-powerpc target:powerpc-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:64.+PowerPC expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-powerpc64 target:powerpc64-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:64.+PowerPC expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-powerpc64le target:powerpc64le-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:64.+RISC-V expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-riscv64 target:riscv64gc-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:64.+S/390 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-s390x target:s390x-unknown-linux-gnu]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:ELF.+80386 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-i586 target:i586-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:ELF.+80386 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-i686 target:i686-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:MIPS32.+mips- expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-mips target:mips-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:MIPS32.+mipsel- expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-mipsel target:mipsel-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:MIPS64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-mips64 target:mips64-unknown-linux-muslabi64]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:MIPS64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-mips64el target:mips64el-unknown-linux-muslabi64]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--expect-cross expect_file_re:aarch64 expect_stripped:--no-expect-stripped os:ubuntu-20.04 platform_name:Linux-aarch64 target:aarch64-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--no-expect-cross expect_file_re:80386.+Windows expect_stripped:--expect-stripped os:windows-latest platform_name:Windows-i686 target:i686-pc-windows-msvc]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--no-expect-cross expect_file_re:ELF.+x86-64 expect_stripped:--expect-stripped os:ubuntu-20.04 platform_name:Linux-x86_64 target:x86_64-unknown-linux-musl]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_cross:--no-expect-cross expect_file_re:Mach-O.+x86_64 expect_stripped:--expect-stripped os:macOS-latest platform_name:macOS-x86_64 target:x86_64-apple-darwin]) (push) Has been cancelled
Self-test / Test (map[can_test:true expect_file_re:x86-64.+Windows expect_stripped:--expect-stripped os:windows-latest platform_name:Windows-x86_64 target:x86_64-pc-windows-msvc]) (push) Has been cancelled
2023-12-17 09:53:53 -06:00
Dave Rolsky
e1ea800ed7 Use cross when building for Linux 32-bit targets
While in theory this should work without `cross`, compiling `openssl` with the
`vendored` feature fails when we run `cargo build --target i686-unknown-linux-musl`.
2023-12-17 09:51:41 -06:00
Dave Rolsky
fc51bd6dfd Small wording tweak in README.md 2023-12-10 17:43:14 -06:00
Dave Rolsky
d02a87e838 Replace "binary" with "binaries" in docs 2023-12-10 17:42:14 -06:00
17 changed files with 226 additions and 84 deletions

View File

@@ -10,7 +10,7 @@ jobs:
name: Check that code is lint clean using precious name: Check that code is lint clean using precious
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Configure Git - name: Configure Git
run: | run: |
git config --global user.email "jdoe@example.com" git config --global user.email "jdoe@example.com"

View File

@@ -14,6 +14,7 @@ jobs:
- platform_name: FreeBSD-x86_64 - platform_name: FreeBSD-x86_64
os: ubuntu-20.04 os: ubuntu-20.04
target: x86_64-unknown-freebsd target: x86_64-unknown-freebsd
cache-cross-binary: true
expect_file_re: "x86-64.+FreeBSD" expect_file_re: "x86-64.+FreeBSD"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
@@ -22,6 +23,7 @@ jobs:
- platform_name: Linux-x86_64 - platform_name: Linux-x86_64
os: ubuntu-20.04 os: ubuntu-20.04
target: x86_64-unknown-linux-musl target: x86_64-unknown-linux-musl
cache-cross-binary: true
expect_file_re: "ELF.+x86-64" expect_file_re: "ELF.+x86-64"
expect_cross: "--no-expect-cross" expect_cross: "--no-expect-cross"
expect_stripped: "--expect-stripped" expect_stripped: "--expect-stripped"
@@ -30,24 +32,69 @@ jobs:
- platform_name: Linux-aarch64 - platform_name: Linux-aarch64
os: ubuntu-20.04 os: ubuntu-20.04
target: aarch64-unknown-linux-musl target: aarch64-unknown-linux-musl
cache-cross-binary: true
expect_file_re: "aarch64" expect_file_re: "aarch64"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
can_test: true can_test: true
- platform_name: Linux-aarch64-with-cross-v0.2.3 - platform_name: Linux-aarch64 (no cache)
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
cache-cross-binary: false
expect_file_re: "aarch64"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-aarch64 with cross v0.2.3
os: ubuntu-20.04 os: ubuntu-20.04
target: aarch64-unknown-linux-musl target: aarch64-unknown-linux-musl
cross-version: "v0.2.3" cross-version: "v0.2.3"
cache-cross-binary: true
expect_file_re: "aarch64" expect_file_re: "aarch64"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_cross_version: "0.2.3" expect_cross_version: "0.2.3"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
can_test: true can_test: true
- platform_name: Linux-aarch64 with cross v0.2.3 (no cache)
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
cross-version: "v0.2.3"
cache-cross-binary: false
expect_file_re: "aarch64"
expect_cross: "--expect-cross"
expect_cross_version: "0.2.3"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-aarch64 with cross 19be834
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
cross-version: "19be834"
cache-cross-binary: true
expect_file_re: "aarch64"
expect_cross: "--expect-cross"
expect_cross_version: "19be834"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-aarch64 with cross 19be834
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
cross-version: "19be834"
cache-cross-binary: false
expect_file_re: "aarch64"
expect_cross: "--expect-cross"
expect_cross_version: "19be834"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-arm - platform_name: Linux-arm
os: ubuntu-20.04 os: ubuntu-20.04
target: arm-unknown-linux-musleabi target: arm-unknown-linux-musleabi
cache-cross-binary: true
expect_file_re: "32.+ARM" expect_file_re: "32.+ARM"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
@@ -56,39 +103,17 @@ jobs:
- platform_name: Linux-i586 - platform_name: Linux-i586
os: ubuntu-20.04 os: ubuntu-20.04
target: i586-unknown-linux-musl target: i586-unknown-linux-musl
cache-cross-binary: true
expect_file_re: "ELF.+80386" expect_file_re: "ELF.+80386"
expect_cross: "--no-expect-cross"
expect_stripped: "--expect-stripped"
can_test: true
- platform_name: Linux-mips
os: ubuntu-20.04
target: mips-unknown-linux-musl
expect_file_re: "MIPS32.+mips-"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
can_test: true can_test: true
- platform_name: Linux-mipsel - platform_name: Linux-i686
os: ubuntu-20.04 os: ubuntu-20.04
target: mipsel-unknown-linux-musl target: i686-unknown-linux-musl
expect_file_re: "MIPS32.+mipsel-" cache-cross-binary: true
expect_cross: "--expect-cross" expect_file_re: "ELF.+80386"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-mips64
os: ubuntu-20.04
target: mips64-unknown-linux-muslabi64
expect_file_re: "MIPS64"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-mips64el
os: ubuntu-20.04
target: mips64el-unknown-linux-muslabi64
expect_file_re: "MIPS64"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
can_test: true can_test: true
@@ -96,6 +121,7 @@ jobs:
- platform_name: Linux-powerpc - platform_name: Linux-powerpc
os: ubuntu-20.04 os: ubuntu-20.04
target: powerpc-unknown-linux-gnu target: powerpc-unknown-linux-gnu
cache-cross-binary: true
expect_file_re: "32.+PowerPC" expect_file_re: "32.+PowerPC"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
@@ -104,6 +130,7 @@ jobs:
- platform_name: Linux-powerpc64 - platform_name: Linux-powerpc64
os: ubuntu-20.04 os: ubuntu-20.04
target: powerpc64-unknown-linux-gnu target: powerpc64-unknown-linux-gnu
cache-cross-binary: true
expect_file_re: "64.+PowerPC" expect_file_re: "64.+PowerPC"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
@@ -112,6 +139,7 @@ jobs:
- platform_name: Linux-powerpc64le - platform_name: Linux-powerpc64le
os: ubuntu-20.04 os: ubuntu-20.04
target: powerpc64le-unknown-linux-gnu target: powerpc64le-unknown-linux-gnu
cache-cross-binary: true
expect_file_re: "64.+PowerPC" expect_file_re: "64.+PowerPC"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
@@ -120,6 +148,7 @@ jobs:
- platform_name: Linux-riscv64 - platform_name: Linux-riscv64
os: ubuntu-20.04 os: ubuntu-20.04
target: riscv64gc-unknown-linux-gnu target: riscv64gc-unknown-linux-gnu
cache-cross-binary: true
expect_file_re: "64.+RISC-V" expect_file_re: "64.+RISC-V"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
@@ -128,6 +157,7 @@ jobs:
- platform_name: Linux-s390x - platform_name: Linux-s390x
os: ubuntu-20.04 os: ubuntu-20.04
target: s390x-unknown-linux-gnu target: s390x-unknown-linux-gnu
cache-cross-binary: true
expect_file_re: "64.+S/390" expect_file_re: "64.+S/390"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
@@ -136,6 +166,7 @@ jobs:
- platform_name: NetBSD-x86_64 - platform_name: NetBSD-x86_64
os: ubuntu-20.04 os: ubuntu-20.04
target: x86_64-unknown-netbsd target: x86_64-unknown-netbsd
cache-cross-binary: true
expect_file_re: "x86-64.+NetBSD" expect_file_re: "x86-64.+NetBSD"
expect_cross: "--expect-cross" expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
@@ -144,6 +175,7 @@ jobs:
- platform_name: Windows-aarch64 - platform_name: Windows-aarch64
os: windows-latest os: windows-latest
target: aarch64-pc-windows-msvc target: aarch64-pc-windows-msvc
cache-cross-binary: true
expect_file_re: "Aarch64.+Windows" expect_file_re: "Aarch64.+Windows"
expect_cross: "--no-expect-cross" expect_cross: "--no-expect-cross"
expect_stripped: "--no-expect-stripped" expect_stripped: "--no-expect-stripped"
@@ -152,6 +184,7 @@ jobs:
- platform_name: Windows-i686 - platform_name: Windows-i686
os: windows-latest os: windows-latest
target: i686-pc-windows-msvc target: i686-pc-windows-msvc
cache-cross-binary: true
expect_file_re: "80386.+Windows" expect_file_re: "80386.+Windows"
expect_cross: "--no-expect-cross" expect_cross: "--no-expect-cross"
expect_stripped: "--expect-stripped" expect_stripped: "--expect-stripped"
@@ -160,6 +193,7 @@ jobs:
- platform_name: Windows-x86_64 - platform_name: Windows-x86_64
os: windows-latest os: windows-latest
target: x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc
cache-cross-binary: true
expect_file_re: "x86-64.+Windows" expect_file_re: "x86-64.+Windows"
expect_stripped: "--expect-stripped" expect_stripped: "--expect-stripped"
can_test: true can_test: true
@@ -167,6 +201,7 @@ jobs:
- platform_name: macOS-x86_64 - platform_name: macOS-x86_64
os: macOS-latest os: macOS-latest
target: x86_64-apple-darwin target: x86_64-apple-darwin
cache-cross-binary: true
expect_file_re: "Mach-O.+x86_64" expect_file_re: "Mach-O.+x86_64"
expect_cross: "--no-expect-cross" expect_cross: "--no-expect-cross"
expect_stripped: "--expect-stripped" expect_stripped: "--expect-stripped"
@@ -175,6 +210,7 @@ jobs:
- platform_name: macOS-aarch64 - platform_name: macOS-aarch64
os: macOS-latest os: macOS-latest
target: aarch64-apple-darwin target: aarch64-apple-darwin
cache-cross-binary: true
expect_file_re: "Mach-O.+arm64" expect_file_re: "Mach-O.+arm64"
expect_cross: "--no-expect-cross" expect_cross: "--no-expect-cross"
expect_stripped: "--expect-stripped" expect_stripped: "--expect-stripped"
@@ -183,7 +219,7 @@ jobs:
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Copy test project to root - name: Copy test project to root
shell: bash shell: bash
run: | run: |
@@ -194,6 +230,7 @@ jobs:
with: with:
command: both command: both
cross-version: ${{ matrix.platform.cross-version }} cross-version: ${{ matrix.platform.cross-version }}
cache-cross-binary: ${{ matrix.platform.cache-cross-binary }}
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.platform.can_test }} if: ${{ matrix.platform.can_test }}
@@ -202,6 +239,7 @@ jobs:
with: with:
command: test command: test
cross-version: ${{ matrix.platform.cross-version }} cross-version: ${{ matrix.platform.cross-version }}
cache-cross-binary: ${{ matrix.platform.cache-cross-binary }}
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.platform.can_test }} if: ${{ matrix.platform.can_test }}
@@ -210,6 +248,7 @@ jobs:
with: with:
command: build command: build
cross-version: ${{ matrix.platform.cross-version }} cross-version: ${{ matrix.platform.cross-version }}
cache-cross-binary: ${{ matrix.platform.cache-cross-binary }}
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strip: true strip: true
@@ -218,6 +257,7 @@ jobs:
with: with:
command: build command: build
cross-version: ${{ matrix.platform.cross-version }} cross-version: ${{ matrix.platform.cross-version }}
cache-cross-binary: ${{ matrix.platform.cache-cross-binary }}
working-directory: subcrate working-directory: subcrate
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,3 +1,19 @@
## 0.0.13 - 2024-05-18
- It's now possible to set `cross-version` to a git ref like a commit hash or `HEAD`. This will
install `cross` from its git repo.
## 0.0.12 - 2024-02-25
- Bumped the version of `actions/cache` used in this action to v4. The v3 version uses Node 16,
which causes warnings when run. Implemented by @hms5232. GH #13.
## 0.0.11 - 2023-12-17
- Use `cross` when compiling for 32-bit Linux targets. While in theory this should work without
`cross`, compiling `openssl` with the `vendored` feature fails when we run
`cargo build --target i686-unknown-linux-musl`.
## 0.0.10 - 2023-12-10 ## 0.0.10 - 2023-12-10
- Fixed handling of crates with multiple binaries. Attempting to strip binaries for such a crate - Fixed handling of crates with multiple binaries. Attempting to strip binaries for such a crate

View File

@@ -55,20 +55,20 @@ jobs:
This action takes the following parameters: This action takes the following parameters:
| Key | Type | Required? | Description | | Key | Type | Required? | Description |
| ------------------- | ---------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------------- | ---------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `command` | string (one of `build`, `test`, or `both`) | no | The command(s) to run. The default is `build`. Running the `test` command will fail with \*BSD targets, non-x86 Windows, and macOS ARM. | | `command` | string (one of `build`, `test`, or `both`) | no | The command(s) to run. The default is `build`. Running the `test` command will fail with \*BSD targets, non-x86 Windows, and macOS ARM. |
| `target` | string | yes | The target triple to compile for. This should be one of the targets listed by running `rustup target list`. | | `target` | string | yes | The target triple to compile for. This should be one of the targets found by running `rustup target list`. |
| `working-directory` | string | no | The working directory in which to run the `cargo` or `cross` commands. Defaults to the current directory (`.`). | | `working-directory` | string | no | The working directory in which to run the `cargo` or `cross` commands. Defaults to the current directory (`.`). |
| `toolchain` | string (one of `stable`, `beta`, or `nightly`) | no | The Rust toolchain version to install. The default is `stable`. | | `toolchain` | string (one of `stable`, `beta`, or `nightly`) | no | The Rust toolchain version to install. The default is `stable`. |
| `GITHUB_TOKEN` | string | no | Defaults to the value of `${{ github.token }}`. | | `GITHUB_TOKEN` | string | no | Defaults to the value of `${{ github.token }}`. |
| `args` | string | no | A string-separated list of arguments to be passed to `cross build`, like `--release --locked`. | | `args` | string | no | A string-separated list of arguments to be passed to `cross build`, like `--release --locked`. |
| `strip` | boolean (`true` or `false`) | no | If this is true, then the resulting binary will be stripped if possible. This is only possible for binaries which weren't cross-compiled. | | `strip` | boolean (`true` or `false`) | no | If this is true, then the resulting binaries will be stripped if possible. This is only possible for binaries which weren't cross-compiled. |
| `cross-version` | string | no | This can be used to set the version of `cross` to use. If specified, it should be a specific `cross` release tag. If this is not set then the latest version will always be used. | | `cross-version` | string | no | This can be used to set the version of `cross` to use. If specified, it should be a specific `cross` release tag (like `v0.2.3`) or a git ref (commit hash, `HEAD`, etc.). If this is not set then the latest released version will always be used. If this is set to a git ref then the version corresponding to that ref will be installed. |
## How it Works ## How it Works
Under the hood, this action will compile your binary with either `cargo` or `cross`, depending on Under the hood, this action will compile your binaries with either `cargo` or `cross`, depending on
the host machine and target. For Linux builds, it will always use `cross` except for builds the host machine and target. For Linux builds, it will always use `cross` except for builds
targeting an x86 architecture like `x86_64` or `i686`. targeting an x86 architecture like `x86_64` or `i686`.
@@ -82,12 +82,12 @@ build `cross`.
When compiling on Windows, it will do so in a Powershell environment, which can matter in some When compiling on Windows, it will do so in a Powershell environment, which can matter in some
corner cases, like compiling the `openssl` crate with the `vendored` feature. corner cases, like compiling the `openssl` crate with the `vendored` feature.
Finally, it will run `strip` to strip the binary if the `strip` parameter is true. This is only Finally, it will run `strip` to strip the binaries if the `strip` parameter is true. This is only
possible for builds that are not done via `cross`. In addition, Windows builds for `aarch64` cannot possible for builds that are not done via `cross`. In addition, Windows builds for `aarch64` cannot
be stripped either. be stripped either.
## Caching Rust Compilation Output ## Caching Rust Compilation Output
You can use the [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) action with this one You can use the [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) action with this one
seemlessly, whether or not a specific build target needs `cross`. There is no special configuration seamlessly, whether or not a specific build target needs `cross`. There is no special configuration
that you need for this. It just works. that you need for this. It just works.

View File

@@ -36,6 +36,11 @@ inputs:
description: | description: |
The version of cross to use. If not specified, then the latest version The version of cross to use. If not specified, then the latest version
will be used. will be used.
cache-cross-binary:
description: |
Cache the cross binary if one is installed. This is primarily for use in
tests of this action.
default: true
runs: runs:
using: composite using: composite
steps: steps:
@@ -58,7 +63,7 @@ runs:
env: env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
if: ${{ steps.determine-cross-compile.outputs.needs-cross == 'true' }} if: ${{ steps.determine-cross-compile.outputs.needs-cross == 'true' }}
# We need to accesss this in both this YAML config and shell scripts. It # We need to access this in both this YAML config and shell scripts. It
# doesn't seem like using ${{ env.RUNNER_TEMP }} works in the YAML config. # doesn't seem like using ${{ env.RUNNER_TEMP }} works in the YAML config.
- name: Set directory for installing cross - name: Set directory for installing cross
id: set-cross-dir id: set-cross-dir
@@ -67,11 +72,11 @@ runs:
if: ${{ steps.determine-cross-compile.outputs.needs-cross == 'true' }} if: ${{ steps.determine-cross-compile.outputs.needs-cross == 'true' }}
- name: Cache cross - name: Cache cross
id: cache-cross id: cache-cross
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ steps.set-cross-dir.outputs.cross-dir }}/cross path: ${{ steps.set-cross-dir.outputs.cross-dir }}/cross
key: ${{ runner.os }}-${{ steps.determine-cross-version.outputs.cross-version }} key: ${{ runner.os }}-${{ steps.determine-cross-version.outputs.cross-version }}
if: ${{ steps.determine-cross-compile.outputs.needs-cross == 'true' }} if: ${{ steps.determine-cross-compile.outputs.needs-cross == 'true' && inputs.cache-cross-binary == 'true' }}
- name: Install cross if cross-compiling (*nix) - name: Install cross if cross-compiling (*nix)
shell: bash shell: bash
run: install-cross-nix.sh ${{ steps.set-cross-dir.outputs.cross-dir }} ${{ steps.determine-cross-version.outputs.cross-version }} run: install-cross-nix.sh ${{ steps.set-cross-dir.outputs.cross-dir }} ${{ steps.determine-cross-version.outputs.cross-version }}

View File

@@ -1,3 +1,5 @@
#!/bin/bash
set -e set -e
set -x set -x
set -o pipefail set -o pipefail
@@ -5,11 +7,11 @@ set -o pipefail
VERSION=$1 VERSION=$1
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
JSON=$( curl \ JSON=$(curl \
--request GET \ --request GET \
--header "Authorization: Bearer $GITHUB_TOKEN" \ --header "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/cross-rs/cross/releases/latest ) https://api.github.com/repos/cross-rs/cross/releases/latest)
VERSION=$( echo "$JSON" | jq -r ".tag_name") VERSION=$(echo "$JSON" | jq -r ".tag_name")
fi fi
echo "cross-version=$VERSION" >> $GITHUB_OUTPUT echo "cross-version=$VERSION" >>"$GITHUB_OUTPUT"

View File

@@ -1,32 +1,37 @@
#!/bin/bash #!/bin/bash
set -eo pipefail set -eo pipefail
set -x
function run () { function run() {
echo $1 echo "$1"
eval $1 eval "$1"
} }
function install_tools () { function install_tools() {
curl --silent --location \ curl --silent --location \
https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh | https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh |
sh sh
run "ubi --project houseabsolute/precious --in ~/bin" run "ubi --project houseabsolute/precious --in $HOME/bin"
run "ubi --project houseabsolute/omegasort --in ~/bin" run "ubi --project houseabsolute/omegasort --in $HOME/bin"
run "ubi --project koalaman/shellcheck --in $HOME/bin"
run "ubi --project mvdan/sh --in $HOME/bin --exe shfmt"
run "ubi --project crate-ci/typos --in $HOME/bin"
run "npm install prettier" run "npm install prettier"
run "curl -L https://cpanmin.us/ -o ~/bin/cpanm" run "curl -L https://cpanmin.us/ -o $HOME/bin/cpanm"
run "chmod 0755 ~/bin/cpanm" run "chmod 0755 $HOME/bin/cpanm"
run "~/bin/cpanm --sudo --notest Perl::Tidy" run "$HOME/bin/cpanm --sudo --notest Perl::Tidy"
} }
if [ "$1" == "-v" ]; then if [ "$1" == "-v" ]; then
set -x set -x
fi fi
mkdir -p $HOME/bin mkdir -p "$HOME"/bin
set +e set +e
echo ":$PATH:" | grep --extended-regexp ":$HOME/bin:" >& /dev/null echo ":$PATH:" | grep --extended-regexp ":$HOME/bin:" >&/dev/null
# shellcheck disable=SC2181
if [ "$?" -eq "0" ]; then if [ "$?" -eq "0" ]; then
path_has_home_bin=1 path_has_home_bin=1
fi fi
@@ -40,7 +45,7 @@ install_tools
echo "Tools were installed into $HOME/bin." echo "Tools were installed into $HOME/bin."
if [ -z "$path_has_home_bin" ]; then if [ -z "$path_has_home_bin" ]; then
echo "You should add $HOME/bin to your PATH." echo "You should add $HOME/bin to your PATH."
fi fi
exit 0 exit 0

View File

@@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
declare -i status
status=0 status=0
PRECIOUS=$(which precious) PRECIOUS=$(which precious)
@@ -7,8 +8,7 @@ if [[ -z $PRECIOUS ]]; then
PRECIOUS=./bin/precious PRECIOUS=./bin/precious
fi fi
"$PRECIOUS" lint -s if ! "$PRECIOUS" lint -s; then
if (( $? != 0 )); then
status+=1 status+=1
fi fi

View File

@@ -1,3 +1,5 @@
#!/bin/bash
set -e set -e
set -x set -x
set -o pipefail set -o pipefail
@@ -5,14 +7,24 @@ set -o pipefail
CROSS_DIR="$1" CROSS_DIR="$1"
VERSION="$2" VERSION="$2"
cd "$CROSS_DIR"
if [[ -n $VERSION ]] && ! [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
cargo install cross --git https://github.com/cross-rs/cross --rev "$VERSION" --force
mv "$HOME/.cargo/bin/cross" .
CROSS_NO_WARNINGS=0 ./cross --version
exit 0
fi
VERSION_ARGS="" VERSION_ARGS=""
if [ -n "$VERSION" ]; then if [ -n "$VERSION" ]; then
VERSION_ARGS="--tag $VERSION" VERSION_ARGS="--tag $VERSION"
fi fi
cd "$CROSS_DIR"
export TARGET=. export TARGET=.
curl --silent --location \ curl --silent --location \
https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh | https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh |
sh sh
# shellcheck disable=SC2086
./ubi --project cross-rs/cross --matching musl --in . $VERSION_ARGS ./ubi --project cross-rs/cross --matching musl --in . $VERSION_ARGS
CROSS_NO_WARNINGS=0 ./cross --version

View File

@@ -1,7 +1,18 @@
exclude = [ exclude = [
"target", "target",
"tests/lib/**/*",
] ]
[commands.typos]
type = "both"
include = "**/*"
exclude = "**/*.tar.gz"
invoke = "once"
cmd = "typos"
tidy_flags = "--write-changes"
ok-exit-codes = 0
lint-failure-exit-codes = 2
[commands.perltidy] [commands.perltidy]
type = "both" type = "both"
include = [ "**/*.{pl,pm,t,psgi}" ] include = [ "**/*.{pl,pm,t,psgi}" ]
@@ -45,3 +56,19 @@ ignore_stderr = [
"The .+ file is not sorted", "The .+ file is not sorted",
"The .+ file is not unique", "The .+ file is not unique",
] ]
[commands.shellcheck]
type = "lint"
include = "**/*.sh"
cmd = "shellcheck"
ok_exit_codes = 0
lint_failure_exit_codes = 1
[commands.shfmt]
type = "both"
include = "**/*.sh"
cmd = ["shfmt", "--simplify", "--indent", "4"]
lint_flags = "--diff"
tidy_flags = "--write"
ok_exit_codes = 0
lint_failure_exit_codes = 1

View File

@@ -1,9 +1,12 @@
#!/bin/bash
set -e set -e
set -x set -x
set -o pipefail
CROSS_DIR="$1" CROSS_DIR="$1"
if [ -f "$CROSS_DIR/cross" ]; then if [ -f "$CROSS_DIR/cross" ]; then
echo "build-command=$CROSS_DIR/cross" >> $GITHUB_OUTPUT echo "build-command=$CROSS_DIR/cross" >>"$GITHUB_OUTPUT"
else else
echo "build-command=cargo" >> $GITHUB_OUTPUT echo "build-command=cargo" >>"$GITHUB_OUTPUT"
fi fi

View File

@@ -1,18 +1,25 @@
#!/bin/bash
set -e set -e
set -x set -x
set -o pipefail
TARGET="$1" TARGET="$1"
# On macOS and Windows, we can cross-compile to all possible targets without # On macOS and Windows, we can cross-compile to all possible targets without
# using cross. # using cross.
if uname -a | grep --quiet --extended-regexp -i "darwin|msys|windows"; then if uname -a | grep --quiet --extended-regexp -i "darwin|msys|windows"; then
echo "needs-cross=false" >> $GITHUB_OUTPUT echo "needs-cross=false" >>"$GITHUB_OUTPUT"
exit 0 exit 0
fi fi
if echo "$TARGET" | grep --quiet --extended-regexp -i '(x86_64|586|686).+linux-(gnu|musl)'; then # On Linux, we should be able to cross-compile to i586 and i686, but in
echo "needs-cross=false" >> $GITHUB_OUTPUT # practice this fails with some crates, notably openssl with the "vendored"
# feature. This feature makes it compile openssl itself, which fails without
# cross.
if echo "$TARGET" | grep --quiet --extended-regexp -i 'x86_64.+linux-(gnu|musl)'; then
echo "needs-cross=false" >>"$GITHUB_OUTPUT"
exit 0 exit 0
fi fi
echo "needs-cross=true" >> $GITHUB_OUTPUT echo "needs-cross=true" >>"$GITHUB_OUTPUT"

View File

@@ -1,4 +1,7 @@
#!/bin/bash
set -e set -e
set -x set -x
set -o pipefail
echo "cross-dir=$RUNNER_TEMP" >> $GITHUB_OUTPUT echo "cross-dir=$RUNNER_TEMP" >>"$GITHUB_OUTPUT"

View File

@@ -1,20 +1,23 @@
#!/bin/bash
set -e set -e
set -x set -x
set -o pipefail
TARGET=$1 TARGET=$1
did_strip="" did_strip=""
strip_binary () { strip_binary() {
if [[ $( uname -s ) =~ "Darwin" ]]; then if [[ $(uname -s) =~ "Darwin" ]]; then
stripped=$( stripped=$(
find "$1" -maxdepth 1 -type f -perm +111 | while read exe; do find "$1" -maxdepth 1 -type f -perm +111 | while read -r exe; do
strip "$exe" strip "$exe"
echo "stripped $exe" echo "stripped $exe"
done done
) )
else else
stripped=$( stripped=$(
find "$1" -maxdepth 1 -type f -executable | while read exe; do find "$1" -maxdepth 1 -type f -executable | while read -r exe; do
strip "$exe" strip "$exe"
echo "stripped $exe" echo "stripped $exe"
done done

View File

@@ -14,3 +14,14 @@ path = "src/bin1.rs"
[[bin]] [[bin]]
name = "bin2" name = "bin2"
path = "src/bin2.rs" path = "src/bin2.rs"
# workaround for https://github.com/cross-rs/cross/issues/1345
[package.metadata.cross.target.x86_64-unknown-netbsd]
pre-build = [
"mkdir -p /tmp/netbsd",
"curl https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.2/amd64/binary/sets/base.tar.xz -O",
"tar -C /tmp/netbsd -xJf base.tar.xz",
"cp /tmp/netbsd/usr/lib/libexecinfo.so /usr/local/x86_64-unknown-netbsd/lib",
"rm base.tar.xz",
"rm -rf /tmp/netbsd",
]

View File

@@ -3,6 +3,13 @@ name = "subcrate"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # workaround for https://github.com/cross-rs/cross/issues/1345
[package.metadata.cross.target.x86_64-unknown-netbsd]
[dependencies] pre-build = [
"mkdir -p /tmp/netbsd",
"curl https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.2/amd64/binary/sets/base.tar.xz -O",
"tar -C /tmp/netbsd -xJf base.tar.xz",
"cp /tmp/netbsd/usr/lib/libexecinfo.so /usr/local/x86_64-unknown-netbsd/lib",
"rm base.tar.xz",
"rm -rf /tmp/netbsd",
]

View File

@@ -32,7 +32,8 @@ sub main {
); );
check_cross( check_cross(
path( $ENV{RUNNER_TEMP} ), $expect_cross, path( $ENV{RUNNER_TEMP} ),
$expect_cross,
$expect_cross_version $expect_cross_version
); );