|
|
@ -8,6 +8,10 @@ variables:
|
|
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
|
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
|
|
|
FF_USE_FASTZIP: 1
|
|
|
|
FF_USE_FASTZIP: 1
|
|
|
|
CACHE_COMPRESSION_LEVEL: fastest
|
|
|
|
CACHE_COMPRESSION_LEVEL: fastest
|
|
|
|
|
|
|
|
# Docker in Docker
|
|
|
|
|
|
|
|
DOCKER_HOST: tcp://docker:2375/
|
|
|
|
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------- #
|
|
|
|
# --------------------------------------------------------------------- #
|
|
|
|
# Cargo: Compiling for different architectures #
|
|
|
|
# Cargo: Compiling for different architectures #
|
|
|
@ -25,18 +29,13 @@ variables:
|
|
|
|
tags: ["docker"]
|
|
|
|
tags: ["docker"]
|
|
|
|
services: ["docker:dind"]
|
|
|
|
services: ["docker:dind"]
|
|
|
|
variables:
|
|
|
|
variables:
|
|
|
|
DOCKER_HOST: tcp://docker:2375/
|
|
|
|
SHARED_PATH: $CI_PROJECT_DIR/shared
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
|
|
|
|
SHARED_PATH: $CI_PROJECT_DIR/shared/
|
|
|
|
|
|
|
|
CARGO_PROFILE_RELEASE_LTO: "true"
|
|
|
|
CARGO_PROFILE_RELEASE_LTO: "true"
|
|
|
|
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "1"
|
|
|
|
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "1"
|
|
|
|
CARGO_INCREMENTAL: "false" # https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
|
|
|
|
CARGO_INCREMENTAL: "false" # https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
|
|
|
|
before_script:
|
|
|
|
before_script:
|
|
|
|
- 'echo "Building for target $TARGET"'
|
|
|
|
- 'echo "Building for target $TARGET"'
|
|
|
|
- "rustup show && rustc --version && cargo --version" # Print version info for debugging
|
|
|
|
- "rustup show && rustc --version && cargo --version" # Print version info for debugging
|
|
|
|
# If provided, bring in caching through sccache, which uses an external S3 endpoint to store compilation results:
|
|
|
|
|
|
|
|
- if [ -n "${SCCACHE_BIN_URL}" ]; then curl $SCCACHE_BIN_URL --output /sccache && chmod +x /sccache && export RUSTC_WRAPPER=/sccache; fi
|
|
|
|
|
|
|
|
# install cross-compiling prerequisites
|
|
|
|
# install cross-compiling prerequisites
|
|
|
|
- 'apt-get update && apt-get install -y docker.io && docker version' # install docker
|
|
|
|
- 'apt-get update && apt-get install -y docker.io && docker version' # install docker
|
|
|
|
- 'cargo install cross && cross --version' # install cross
|
|
|
|
- 'cargo install cross && cross --version' # install cross
|
|
|
@ -45,10 +44,16 @@ variables:
|
|
|
|
- 'cp -r $CARGO_HOME/bin $SHARED_PATH/cargo'
|
|
|
|
- 'cp -r $CARGO_HOME/bin $SHARED_PATH/cargo'
|
|
|
|
- 'cp -r $RUSTUP_HOME $SHARED_PATH'
|
|
|
|
- 'cp -r $RUSTUP_HOME $SHARED_PATH'
|
|
|
|
- 'export CARGO_HOME=$SHARED_PATH/cargo RUSTUP_HOME=$SHARED_PATH/rustup'
|
|
|
|
- 'export CARGO_HOME=$SHARED_PATH/cargo RUSTUP_HOME=$SHARED_PATH/rustup'
|
|
|
|
|
|
|
|
# If provided, bring in caching through sccache, which uses an external S3 endpoint to store compilation results.
|
|
|
|
|
|
|
|
# The sccache binary is stored in the sysroot of the rustc installation since that directory is added to the path of the cross container.
|
|
|
|
|
|
|
|
- if [ -n "${SCCACHE_BIN_URL}" ]; then RUSTC_SYSROOT=$(rustc --print sysroot) && curl $SCCACHE_BIN_URL --output $RUSTC_SYSROOT/bin/sccache && chmod +x $RUSTC_SYSROOT/bin/sccache && export RUSTC_WRAPPER=sccache; fi
|
|
|
|
script:
|
|
|
|
script:
|
|
|
|
# cross-compile conduit for target
|
|
|
|
# cross-compile conduit for target
|
|
|
|
- 'time ./cross/build.sh --locked --release'
|
|
|
|
- 'time ./cross/build.sh --locked --release'
|
|
|
|
- 'mv "target/$TARGET/release/conduit" "conduit-$TARGET"'
|
|
|
|
- 'mv "target/$TARGET/release/conduit" "conduit-$TARGET"'
|
|
|
|
|
|
|
|
# print information about linking for debugging
|
|
|
|
|
|
|
|
- 'file conduit-$TARGET' # print file information
|
|
|
|
|
|
|
|
- 'readelf --dynamic conduit-$TARGET | sed -e "/NEEDED/q1"' # ensure statically linked
|
|
|
|
cache:
|
|
|
|
cache:
|
|
|
|
# https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
|
|
|
|
# https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
|
|
|
|
key: 'cargo-cache-$TARGET'
|
|
|
|
key: 'cargo-cache-$TARGET'
|
|
|
@ -82,16 +87,6 @@ build:release:cargo:x86_64-unknown-linux-musl:
|
|
|
|
- "conduit-x86_64-unknown-linux-musl"
|
|
|
|
- "conduit-x86_64-unknown-linux-musl"
|
|
|
|
expose_as: "Conduit for x86_64-unknown-linux-musl"
|
|
|
|
expose_as: "Conduit for x86_64-unknown-linux-musl"
|
|
|
|
|
|
|
|
|
|
|
|
build:release:cargo:i686-unknown-linux-musl:
|
|
|
|
|
|
|
|
extends: .build-cargo-shared-settings
|
|
|
|
|
|
|
|
variables:
|
|
|
|
|
|
|
|
TARGET: "i686-unknown-linux-musl"
|
|
|
|
|
|
|
|
artifacts:
|
|
|
|
|
|
|
|
name: "conduit-i686-unknown-linux-musl"
|
|
|
|
|
|
|
|
paths:
|
|
|
|
|
|
|
|
- "conduit-i686-unknown-linux-musl"
|
|
|
|
|
|
|
|
expose_as: "Conduit for i686-unknown-linux-musl"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build:release:cargo:arm-unknown-linux-musleabihf:
|
|
|
|
build:release:cargo:arm-unknown-linux-musleabihf:
|
|
|
|
extends: .build-cargo-shared-settings
|
|
|
|
extends: .build-cargo-shared-settings
|
|
|
|
variables:
|
|
|
|
variables:
|
|
|
@ -132,6 +127,9 @@ build:release:cargo:aarch64-unknown-linux-musl:
|
|
|
|
# cross-compile conduit for target
|
|
|
|
# cross-compile conduit for target
|
|
|
|
- 'time ./cross/build.sh --locked'
|
|
|
|
- 'time ./cross/build.sh --locked'
|
|
|
|
- 'mv "target/$TARGET/debug/conduit" "conduit-debug-$TARGET"'
|
|
|
|
- 'mv "target/$TARGET/debug/conduit" "conduit-debug-$TARGET"'
|
|
|
|
|
|
|
|
# print information about linking for debugging
|
|
|
|
|
|
|
|
- 'file conduit-debug-$TARGET' # print file information
|
|
|
|
|
|
|
|
- 'readelf --dynamic conduit-debug-$TARGET | sed -e "/NEEDED/q1"' # ensure statically linked
|
|
|
|
artifacts:
|
|
|
|
artifacts:
|
|
|
|
expire_in: 4 weeks
|
|
|
|
expire_in: 4 weeks
|
|
|
|
|
|
|
|
|
|
|
@ -161,9 +159,6 @@ build:debug:cargo:x86_64-unknown-linux-musl:
|
|
|
|
- "build:release:cargo:armv7-unknown-linux-musleabihf"
|
|
|
|
- "build:release:cargo:armv7-unknown-linux-musleabihf"
|
|
|
|
- "build:release:cargo:aarch64-unknown-linux-musl"
|
|
|
|
- "build:release:cargo:aarch64-unknown-linux-musl"
|
|
|
|
variables:
|
|
|
|
variables:
|
|
|
|
DOCKER_HOST: tcp://docker:2375/
|
|
|
|
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
|
|
|
|
PLATFORMS: "linux/arm/v6,linux/arm/v7,linux/arm64,linux/amd64"
|
|
|
|
PLATFORMS: "linux/arm/v6,linux/arm/v7,linux/arm64,linux/amd64"
|
|
|
|
DOCKER_FILE: "docker/ci-binaries-packaging.Dockerfile"
|
|
|
|
DOCKER_FILE: "docker/ci-binaries-packaging.Dockerfile"
|
|
|
|
cache:
|
|
|
|
cache:
|
|
|
|