diff --git a/.github/workflows/docker-build-static.yml b/.github/workflows/docker-build-static.yml index e59b2e4..a21cf3d 100644 --- a/.github/workflows/docker-build-static.yml +++ b/.github/workflows/docker-build-static.yml @@ -48,10 +48,13 @@ env: # 1-bullseye, 1.61-bullseye, 1.61.0-bullseye, bullseye, 1, 1.61, 1.61.0, latest # cache -## .sccache ## cargo ## target +# Github actions currently timeout when downloading musl-gcc +## Using lldap dev image based on rust:1.62-slim-bullseye and musl-gcc bundled +### Job aarch64 and amd64 build + jobs: build-ui: runs-on: ubuntu-latest @@ -60,7 +63,6 @@ jobs: env: CARGO_TERM_COLOR: always RUSTFLAGS: -Ctarget-feature=+crt-static - #CARGO_HOME: ${GITHUB_WORKSPACE}/.cargo steps: - name: install runtime run: apt update && apt install -y gcc-x86-64-linux-gnu g++-x86-64-linux-gnu libc6-dev ca-certificates @@ -150,9 +152,9 @@ jobs: build-aarch64: runs-on: ubuntu-latest container: - image: rust:1.62 + #image: rust:1.62 + image: martadinata666/debian:rust-dev env: - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-musl-gcc CARGO_TERM_COLOR: always RUSTFLAGS: -Ctarget-feature=+crt-static @@ -176,13 +178,11 @@ jobs: key: lldap-bin-aarch64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | lldap-bin-aarch64- - - name: fetch musl-gcc - run: | - wget -c https://musl.cc/aarch64-linux-musl-cross.tgz - tar zxf ./x86_64-linux-musl-cross.tgz -C /opt - echo "/opt/aarch64-linux-musl-cross:/opt/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH -# - name: build -# run: ./build-arm64.sh +# - name: fetch musl-gcc +# run: | +# wget -c https://musl.cc/aarch64-linux-musl-cross.tgz +# tar zxf ./x86_64-linux-musl-cross.tgz -C /opt +# echo "/opt/aarch64-linux-musl-cross:/opt/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH - name: add musl aarch64 target run: rustup target add aarch64-unknown-linux-musl - name: build lldap aarch4 @@ -203,7 +203,8 @@ jobs: build-amd64: runs-on: ubuntu-latest container: - image: rust:1.62 +# image: rust:1.62 + image: martadinata666/debian:rust-dev env: CARGO_TERM_COLOR: always RUSTFLAGS: -Ctarget-feature=+crt-static @@ -225,13 +226,11 @@ jobs: lldap-bin-amd64- - name: install musl run: apt update && apt install -y musl-tools tar wget - - name: fetch musl-gcc - run: | - wget -c https://musl.cc/x86_64-linux-musl-cross.tgz - tar zxf ./x86_64-linux-musl-cross.tgz -C /opt - echo "/opt/x86_64-linux-musl-cross:/opt/x86_64-linux-musl-cross/bin" >> $GITHUB_PATH -# - name: fetch musl gcc and build -# run: ./build-amd64.sh +# - name: fetch musl-gcc +# run: | +# wget -c https://musl.cc/x86_64-linux-musl-cross.tgz +# tar zxf ./x86_64-linux-musl-cross.tgz -C /opt +# echo "/opt/x86_64-linux-musl-cross:/opt/x86_64-linux-musl-cross/bin" >> $GITHUB_PATH - name: add x86_64 target run: rustup target add x86_64-unknown-linux-musl - name: build x86_64 lldap diff --git a/build-amd64.sh b/build-amd64.sh deleted file mode 100755 index 2bccd0e..0000000 --- a/build-amd64.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -wget -c https://musl.cc/x86_64-linux-musl-cross.tgz -tar zxf ./x86_64-linux-musl-cross.tgz -C /opt -rm ./x86_64-linux-musl-cross.tgz -export RUST_BACKTRACE=1 -export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=x86_64-linux-musl-gcc -export RUSTFLAGS="-Ctarget-feature=+crt-static" -export PATH="/opt/x86_64-linux-musl-cross/:/opt/x86_64-linux-musl-cross/bin/:$PATH" -rustup target add x86_64-unknown-linux-musl -cargo build --target=x86_64-unknown-linux-musl --release -p lldap -p migration-tool diff --git a/build-arm64.sh b/build-arm64.sh deleted file mode 100755 index c025e5e..0000000 --- a/build-arm64.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -wget -c https://musl.cc/aarch64-linux-musl-cross.tgz -tar zxf ./aarch64-linux-musl-cross.tgz -C /opt -rm ./aarch64-linux-musl-cross.tgz -export RUST_BACKTRACE=1 -export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc -export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc -export RUSTFLAGS="-Ctarget-feature=+crt-static" -export PATH="/opt/aarch64-linux-musl-cross/:/opt/aarch64-linux-musl-cross/bin/:$PATH" -rustup target add aarch64-unknown-linux-musl -cargo build --target=aarch64-unknown-linux-musl --release -p lldap -p migration-tool