diff options
author | lafleur <lafleur@boum.org> | 2021-10-31 12:38:29 +0100 |
---|---|---|
committer | lafleur <lafleur@boum.org> | 2021-10-31 12:38:29 +0100 |
commit | 8fa12ece8353398f3b65615a8ffb6bc75e896537 (patch) | |
tree | a7aab374483b30b25ac2028ba03adf76851ff629 | |
parent | c694d5109171e51ce16f40a79b55b496002feb84 (diff) |
add RUSTFLAGS to allow dyn linking in CI
-rw-r--r-- | .gitlab-ci.yml | 11 | ||||
-rw-r--r-- | ci-fix/libnftnl.a | 3 |
2 files changed, 6 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20ddef0..63343a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,22 +6,23 @@ image: "rust:alpine" # You will often need this when you (or any of your dependencies) depends on C code. before_script: - apk update - - apk add build-base pkgconf libmnl-dev libmnl-static libnftnl-dev + - apk add build-base pkgconf libmnl-dev libnftnl-dev cache: paths: - target/ - cargo/ -# Set CARGO_HOME inside the CI directory, otherwise cargo won't use the cache. variables: + # Set CARGO_HOME inside the CI directory, otherwise cargo won't use the cache. CARGO_HOME: $CI_PROJECT_DIR/cargo + # Let rust create dynamically linked builds under musl libc - see [this rust issue](https://github.com/rust-lang/compiler-team/issues/422) + RUSTFLAGS: "-C target-feature=-crt-static" + # Same consideration for doc tests - see [this rust issue](https://github.com/rust-lang/cargo/issues/6650) + RUSTDOCFLAGS: "-C target-feature=-crt-static" test:cargo: script: - # Copy the libnftnl-static lib file that is stored in LFS. Workaround to - # be able to compile under alpine musl. - - cp ci-fix/libnftnl.a /usr/lib - mkdir -p target cargo - du -sh target cargo - rustc --version && cargo --version diff --git a/ci-fix/libnftnl.a b/ci-fix/libnftnl.a deleted file mode 100644 index 3d55ec9..0000000 --- a/ci-fix/libnftnl.a +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e6fad6864934b2e18bf5de9a64bbb019439daf2ea0ac7dcc3b7f4fffd94587c5 -size 458128 |