From ea30a4990137f99f26364d4615a14692985b1d08 Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Fri, 16 Dec 2022 17:25:08 +0100 Subject: [PATCH] Build with rust v1.66 and cross v0.2.4 Also added some sanity checks. The new docker image now also contains all required targets and the rust-src component already, which makes it a bit faster to get started. Signed-off-by: Jacob Kiers --- .cargo/config.toml | 3 +++ .drone.jsonnet | 31 +++++++++++-------------------- 2 files changed, 14 insertions(+), 20 deletions(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..1855535 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,3 @@ +[profile.release] +lto = "thin" +strip = true diff --git a/.drone.jsonnet b/.drone.jsonnet index c727463..c1a5121 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,4 +1,5 @@ local executableName = 'newsletter-to-web'; +local cross_image = 'img.kie.rs/jjkiers/rust-dind-cross:1.66-full'; local archs = [ // { target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' }, @@ -16,16 +17,12 @@ local targetExecutableName(arch) = executableName + if std.startsWith(arch.short local add_build_steps() = [ { name: getStepName(arch), - image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim', + image: cross_image, volumes: [ { name: 'dockersock', path: '/var/run', }, - { - name: 'rustup', - path: '/usr/local/rustup', - }, ], commands: [ 'echo Hello World from Jsonnet on ' + arch.target + '!', @@ -51,13 +48,19 @@ local add_build_steps() = [ steps: [{ name: 'Wait for Docker', - image: 'img.kie.rs/jjkiers/rust-dind-cross:1.65-slim', + image: cross_image, commands: [ + 'mkdir artifacts', + 'echo Using image: ' + cross_image, 'while ! docker image ls; do sleep 1; done', + 'cargo --version', + 'rustc --version', 'docker info', 'docker pull hello-world:latest', - 'mkdir artifacts', ], + environment: { + CROSS_REMOTE: true, + }, volumes: [{ name: 'dockersock', path: '/var/run', @@ -67,7 +70,7 @@ local add_build_steps() = [ [ { name: 'Show built artifacts', - image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim', + image: cross_image, commands: [ 'ls -lah artifacts', ], @@ -112,18 +115,6 @@ local add_build_steps() = [ name: 'dockersock', temp: {}, }, - { - name: 'docker-storage', - host: { - path: '/srv/drone/docker-dind-rust', - }, - }, - { - name: 'rustup', - host: { - path: '/srv/drone/rustup', - }, - }, ], image_pull_secrets: ['docker_private_repo'],