diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 982279e..7ef0f59 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,6 +78,8 @@ jobs: implementation: '2.3' - target: ruby implementation: '3.3' + - target: rust + implementation: '1.80' steps: - name: Dump matrix context diff --git a/src/rust/1.80-linux-x86_64/Dockerfile b/src/rust/1.80-linux-x86_64/Dockerfile new file mode 100644 index 0000000..8317f9e --- /dev/null +++ b/src/rust/1.80-linux-x86_64/Dockerfile @@ -0,0 +1,20 @@ +FROM rust:1.80 + +# Copy files common for all images +COPY 4img/* ./ + +# Install all dependencies +RUN ./prepare-apt-ruby && ./prepare-apt-uninit +RUN ./prepare +# See https://nexte.st/book/pre-built-binaries#downloading-and-installing-from-your-terminal +RUN curl -fsSL https://get.nexte.st/0.9/linux | tar xzvf - -C "${CARGO_HOME:-~/.cargo}"/bin + +# Validate that we've got correct versions, e.g. something like this: +# +# $ rustc --version +# rustc 1.80.1 (3f5fd8dd4 2024-08-06) +# $ cargo nextest --version +# cargo-nextest-nextest 0.9.77 + +RUN ./validate-rustc '^rustc 1\.80\.' +RUN ./validate-nextest '^cargo-nextest-nextest 0\.9\.' diff --git a/src/rust/1.80-linux-x86_64/build b/src/rust/1.80-linux-x86_64/build new file mode 120000 index 0000000..552d52a --- /dev/null +++ b/src/rust/1.80-linux-x86_64/build @@ -0,0 +1 @@ +../../generic-build \ No newline at end of file diff --git a/src/rust/1.80-linux-x86_64/run-it b/src/rust/1.80-linux-x86_64/run-it new file mode 120000 index 0000000..7461764 --- /dev/null +++ b/src/rust/1.80-linux-x86_64/run-it @@ -0,0 +1 @@ +../../generic-run-it \ No newline at end of file diff --git a/src/rust/_common/prepare b/src/rust/_common/prepare new file mode 100755 index 0000000..c7269f5 --- /dev/null +++ b/src/rust/_common/prepare @@ -0,0 +1,13 @@ +#!/bin/sh -ef + +mkdir -p /download/runtime +cd /download/runtime +git clone --depth 1 https://github.com/kaitai-io/kaitai_struct_rust_runtime.git rust +cd rust +rustc_ver=$(rustc -vV) +rustc_target=$(printf '%s\n' "$rustc_ver" | sed -n 's/^host: //p') +# Download runtime library dependencies to `$CARGO_HOME` +cargo fetch --target "$rustc_target" +cd .. +cp -v -t . rust/Cargo.lock +rm -rf rust diff --git a/src/rust/_common/validate-nextest b/src/rust/_common/validate-nextest new file mode 100755 index 0000000..74c0537 --- /dev/null +++ b/src/rust/_common/validate-nextest @@ -0,0 +1,3 @@ +#!/bin/sh -ef + +./validate-version nextest "$(cargo nextest --version)" "$@" diff --git a/src/rust/_common/validate-rustc b/src/rust/_common/validate-rustc new file mode 100755 index 0000000..367a573 --- /dev/null +++ b/src/rust/_common/validate-rustc @@ -0,0 +1,3 @@ +#!/bin/sh -ef + +./validate-version rustc "$(rustc --version)" "$@"