Skip to content

Commit

Permalink
Update CI for arm static
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Mullin <mmullin@halcyon.ai>
  • Loading branch information
mmullin-halcyon committed Sep 22, 2023
1 parent c043865 commit 5f09fb6
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 5 deletions.
53 changes: 48 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,49 @@ on:
push:

jobs:
test-arm-static:
name: Test Static on Arm
runs-on: ubuntu-latest
strategy:
matrix:
include:
- rust-target: aarch64-unknown-linux-gnu
os-target: aarch64-linux-gnu
os-arch: arm64
features: static
env:
CARGO_BUILD_TARGET: ${{ matrix.rust-target }}
CARGO_TERM_VERBOSE: 'true'
RUSTFLAGS: -C linker=/usr/bin/${{ matrix.os-target }}-gcc
steps:
- uses: actions/checkout@v2
- uses: pguyot/arm-runner-action@v2
with:
submodules: recursive
commands: |
sudo apt-get update
sudo apt-get install \
build-essential \
autopoint \
autoconf \
flex \
bison \
gawk
curl \
--proto '=https' \
--tlsv1.2 \
--retry 10 \
--retry-connrefused \
--location \
--silent \
--show-error \
--fail "https://sh.rustup.rs" \
| sh -s -- --default-toolchain none -y
cargo build --features "${{ matrix.features }}"
cargo test --features "${{ matrix.features }}"
test-gnu:
# dynamically linked glibc
name: Test on Ubuntu ${{ matrix.os-arch }} (${{ matrix.features }})
Expand Down Expand Up @@ -66,11 +109,11 @@ jobs:
- name: Install Static Compilation dependencies
run: |
sudo apt-get install \
autopoint:${{ matrix.os-arch }} \
autoconf:${{ matrix.os-arch }} \
flex:${{ matrix.os-arch }} \
bison:${{ matrix.os-arch }} \
gawk:${{ matrix.os-arch }}
autopoint \
autoconf \
flex \
bison \
gawk \
- name: Install linker for ${{ matrix.os-target }}
if: matrix.os-arch != 'amd64'
Expand Down
15 changes: 15 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ fn main() {
compiler.cflags_env()
};


let status = process::Command::new("make")
.arg("install")
.arg("-j")
Expand Down Expand Up @@ -238,6 +239,8 @@ fn make_elfutils(compiler: &cc::Tool, src_dir: &path::PathBuf, out_dir: &path::P
let fd = file.as_raw_fd();
fcntl::flock(fd, fcntl::FlockArg::LockExclusive).unwrap();



let flags = compiler
.cflags_env()
.into_string()
Expand All @@ -254,10 +257,22 @@ fn make_elfutils(compiler: &cc::Tool, src_dir: &path::PathBuf, out_dir: &path::P
})
.collect();



#[cfg(target_arch = "aarch64")]
cflags.push_str(" -Wno-error=stringop-overflow");
cflags.push_str(&format!(" -I{}/zlib/", src_dir.display()));

let status = process::Command::new("sed")
.arg("-i")
.arg(r#"s/po doc tests/po doc/g"#)
.arg("Makefile.am")
.current_dir(&src_dir.join("elfutils"))
.status()
.expect("could not strip tests");

assert!(status.success(), "make failed");

let status = process::Command::new("autoreconf")
.arg("--install")
.arg("--force")
Expand Down

0 comments on commit 5f09fb6

Please sign in to comment.