Skip to content

Commit

Permalink
Add rust/1.80-linux-x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed Sep 2, 2024
1 parent 2327714 commit d7f1042
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ jobs:
implementation: '2.3'
- target: ruby
implementation: '3.3'
- target: rust
implementation: '1.80'

steps:
- name: Dump matrix context
Expand Down
20 changes: 20 additions & 0 deletions src/rust/1.80-linux-x86_64/Dockerfile
Original file line number Diff line number Diff line change
@@ -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\.'
1 change: 1 addition & 0 deletions src/rust/1.80-linux-x86_64/build
1 change: 1 addition & 0 deletions src/rust/1.80-linux-x86_64/run-it
13 changes: 13 additions & 0 deletions src/rust/_common/prepare
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions src/rust/_common/validate-nextest
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -ef

./validate-version nextest "$(cargo nextest --version)" "$@"
3 changes: 3 additions & 0 deletions src/rust/_common/validate-rustc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -ef

./validate-version rustc "$(rustc --version)" "$@"

0 comments on commit d7f1042

Please sign in to comment.