diff --git a/rust-1.89.yaml b/rust-1.89.yaml new file mode 100644 index 00000000000..f3da1171a46 --- /dev/null +++ b/rust-1.89.yaml @@ -0,0 +1,184 @@ +package: + name: rust-1.89 + version: "1.89.0" + epoch: 0 + description: "Empowering everyone to build reliable and efficient software." + copyright: + - license: Apache-2.0 AND MIT + resources: + cpu: 16 + memory: 16Gi + dependencies: + runtime: + - libLLVM-20 + provides: + - rust=${{package.full-version}} + +environment: + contents: + packages: + - build-base + - busybox + - ca-certificates-bundle + - clang-20 + - cmake + - coreutils + - curl-dev + - file + - libLLVM-20 + - libssh2-dev + - libxml2-dev + - llvm-20 + - llvm-20-dev + - openssl-dev + - patch + - python3 + - rustup + - samurai + - wasi-libc + - xz-dev + - zlib-dev + +pipeline: + - uses: fetch + with: + uri: https://static.rust-lang.org/dist/rustc-${{package.version}}-src.tar.xz + expected-sha256: 0b9d55610d8270e06c44f459d1e2b7918a5e673809c592abed9b9c600e33d95a + extract: false + + - runs: | + tar -xJf rustc-${{package.version}}-src.tar.xz + rm rustc-${{package.version}}-src.tar.xz + + - runs: | + # Our rust-1.88 package fails to bootstrap rust 1.89. + # See https://github.com/chainguard-dev/internal-dev/issues/19114 for more details. + rustup toolchain install 1.88.0 + export PATH="$HOME/.rustup/toolchains/1.88.0-${{host.triplet.rust}}/bin:$PATH" + + export CFLAGS="$CFLAGS -O2 -I/usr/lib/llvm-20/include" + export CXXFLAGS="$CXXFLAGS -O2 -I/usr/lib/llvm-20/include" + export OPENSSL_NO_VENDOR=1 + export RUST_BACKTRACE=1 + export ARCH=${{host.triplet.rust}} + cd rustc-${{package.version}}-src + + # Create a minimal config.toml with necessary options + # This is needed because of upstream changes in Rust 1.87 that removed automatic config.toml creation + cat > config.toml < hello.rs + fn main() { + println!("Hello, World!"); + } + EOF + rustc hello.rs + ./hello | grep -q "Hello, World!" || exit 1 + - name: Cargo project creation and run + runs: | + cargo new hello_cargo --bin + cd hello_cargo + cargo run | grep -q "Hello, world!" || exit 1 + - name: Verify rustdoc installation + runs: | + rustdoc --version || exit 1