diff --git a/rust-1.85.yaml b/rust-1.85.yaml new file mode 100644 index 00000000000..0a6256d2b22 --- /dev/null +++ b/rust-1.85.yaml @@ -0,0 +1,165 @@ +package: + name: rust-1.85 + version: "1.85.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-19 + provides: + - rust=${{package.full-version}} + +environment: + contents: + packages: + - build-base + - busybox + - ca-certificates-bundle + - clang-19 + - cmake + - coreutils + - curl-dev + - file + - libLLVM-19 + - libssh2-dev + - libxml2-dev + - llvm-19 + - llvm-19-dev + - openssl-dev + - patch + - python3 + - rust~1.84 + - 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: d542c397217b5ba5bac7eb274f5ca62d031f61842c3ba4cc5328c709c38ea1e7 + extract: false + + - runs: | + tar -xJf rustc-${{package.version}}-src.tar.xz + rm rustc-${{package.version}}-src.tar.xz + + - runs: | + export CFLAGS="$CFLAGS -O2 -I/usr/lib/llvm-19/include" + export CXXFLAGS="$CXXFLAGS -O2 -I/usr/lib/llvm-19/include" + export OPENSSL_NO_VENDOR=1 + export RUST_BACKTRACE=1 + export ARCH=${{host.triplet.rust}} + cd rustc-${{package.version}}-src + + ./configure \ + --host="${ARCH}" \ + --target="${ARCH}" \ + --prefix="/usr" \ + --release-channel="stable" \ + --enable-local-rust \ + --local-rust-root="/usr" \ + --llvm-root="/usr/lib/llvm-19" \ + --llvm-config="/usr/lib/llvm-19/bin/llvm-config" \ + --disable-docs \ + --enable-extended \ + --tools="cargo,src,clippy,rustfmt,rustdoc" \ + --enable-llvm-link-shared \ + --enable-option-checking \ + --enable-locked-deps \ + --enable-profiler \ + --enable-vendor \ + --dist-compression-formats=gz \ + --python="python3" \ + --set="rust.musl-root=/usr" \ + --set="rust.codegen-units=1" \ + --set="rust.codegen-units-std=1" \ + --set="target.${ARCH}.musl-root=/usr" \ + --set="target.${ARCH}.crt-static=false" \ + --set="target.${ARCH}.musl-root=/usr" \ + --set="target.${ARCH}.crt-static=false" + + - runs: | + cd rustc-${{package.version}}-src + sed 's/#deny-warnings = .*/deny-warnings = false/' -i config.toml + sed 's|deny(warnings,|deny(|' -i src/bootstrap/src/lib.rs + mkdir -p "${{targets.destdir}}/usr" + unset CARGO_PROFILE_RELEASE_LTO + unset CARGO_PROFILE_RELEASE_OPT_LEVEL + unset CARGO_PROFILE_RELEASE_PANIC + unset CARGO_PROFILE_RELEASE_CODEGEN_UNITS + export CFLAGS="$CFLAGS -O2 -Iusr/include/llvm-19" + export CXXFLAGS="$CXXFLAGS -O2 -I/usr/include/llvm-19" + export OPENSSL_NO_VENDOR=1 + export RUST_BACKTRACE=1 + DESTDIR=${{targets.destdir}} python3 ./x.py install --jobs $(nproc) + + - uses: strip + + # delete uneeded files eg uninstalltion + - runs: | + rm ${{targets.destdir}}/usr/lib/rustlib/components + rm ${{targets.destdir}}/usr/lib/rustlib/install.log + rm ${{targets.destdir}}/usr/lib/rustlib/rust-installer-version + rm ${{targets.destdir}}/usr/lib/rustlib/uninstall.sh + rm ${{targets.destdir}}/usr/lib/rustlib/manifest-* + + - name: ensure libraries are executable for melange SCA provides generation + runs: | + chmod +x ${{targets.destdir}}/usr/lib/*.so + +update: + enabled: true + github: + identifier: rust-lang/rust + use-tag: true + tag-filter: 1.85. + +test: + environment: + contents: + packages: + - gcc + - glibc-dev + pipeline: + - name: Verify rustc installation + runs: | + rustc --version || exit 1 + cargo --help + cargo-clippy --version + cargo-clippy --help + cargo-fmt --version + cargo-fmt --help + clippy-driver --version + clippy-driver --help + rust-gdbgui --help + rustc --help + rustdoc --help + rustfmt --version + rustfmt --help + - name: Verify cargo installation + runs: | + cargo --version || exit 1 + - name: Compile and run Hello World + runs: | + cat <<'EOF' > 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