Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:renatoriolino: Update rust to 1.61.0 (zeus) #1

Open
wants to merge 1 commit into
base: zeus
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions recipes-devtools/cargo/cargo-cross-canadian_1.61.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require recipes-devtools/rust/rust-source-${PV}.inc
require recipes-devtools/rust/rust-snapshot-${PV}.inc

FILESEXTRAPATHS_prepend := "${THISDIR}/cargo-${PV}:"

require cargo-cross-canadian.inc
4 changes: 4 additions & 0 deletions recipes-devtools/cargo/cargo_1.61.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require recipes-devtools/rust/rust-source-${PV}.inc
require recipes-devtools/rust/rust-snapshot-${PV}.inc
require cargo.inc
BBCLASSEXTEND = "native nativesdk"
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 7b3bc1de0c79a1b410105ce36bbe9f774438d263 Mon Sep 17 00:00:00 2001
From: Ross Schulman <[email protected]>
Date: Tue, 1 Feb 2022 09:13:16 -0500
Subject: [PATCH] Add 400-series syscalls to musl riscv64 definitions

Upstream-Status: Backport [https://github.com/rust-lang/libc/commit/7b3bc1de0c79a1b410105ce36bbe9f774438d263]
Signed-off-by: Khem Raj <[email protected]>
---
.../linux_like/linux/musl/b64/riscv64/mod.rs | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/vendor/libc-0.2.116/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/vendor/libc-0.2.116/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
index 6b17621c7..2036583d5 100644
--- a/vendor/libc-0.2.116/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
+++ b/vendor/libc-0.2.116/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
@@ -465,6 +465,25 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;

pub const O_APPEND: ::c_int = 1024;
pub const O_DIRECT: ::c_int = 0x4000;
--
2.35.1

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions recipes-devtools/rust/libstd-rs_1.61.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require rust-source-${PV}.inc
require libstd-rs.inc

# Check if libc crate is >= 0.2.117 before dropping this patch
SRC_URI += " \
file://0001-Add-400-series-syscalls-to-musl-riscv64-definitions.patch;patchdir=../../ \
file://0001-Update-checksums-for-modified-vendored-libc.patch;patchdir=../../ \
"

# libstd moved from src/libstd to library/std in 1.47+
S = "${RUSTSRC}/library/std"
6 changes: 6 additions & 0 deletions recipes-devtools/rust/rust-cross-canadian_1.61.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require rust-cross-canadian.inc
require rust-source-${PV}.inc
require rust-snapshot-${PV}.inc

FILESEXTRAPATHS_prepend := "${THISDIR}/rust:"

2 changes: 2 additions & 0 deletions recipes-devtools/rust/rust-cross_1.61.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require rust-cross.inc
require rust-source-${PV}.inc
1 change: 1 addition & 0 deletions recipes-devtools/rust/rust-llvm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ EXTRA_OECMAKE = " \
-DLLVM_BUILD_TESTS=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_TARGET_ARCH=${TARGET_ARCH} \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust \
"
EXTRA_OECMAKE_append_class-target = "\
Expand Down
5 changes: 5 additions & 0 deletions recipes-devtools/rust/rust-llvm_1.61.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# check src/llvm-project/llvm/CMakeLists.txt for llvm version in use
#
LLVM_RELEASE = "13.0.0"
require rust-source-${PV}.inc
require rust-llvm.inc
25 changes: 25 additions & 0 deletions recipes-devtools/rust/rust-snapshot-1.61.0.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## This is information on the rust-snapshot (binary) used to build our current release.
## snapshot info is taken from rust/src/stage0.txt
## TODO: find a way to add additional SRC_URIs based on the contents of an
## earlier SRC_URI.
RS_VERSION = "1.60.0"
CARGO_VERSION = "1.60.0"

# TODO: Add hashes for other architecture toolchains as well. Make a script?
SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "6fb8ee3650beb10836ae48a9aaa535473e64eaca20695b88113267aea3c7557f"
SRC_URI[rustc-snapshot-x86_64.sha256sum] = "fc0b41c15e348ad0eeb7a6c015a922a2ac95e9577e531635558b26d99399f315"
SRC_URI[cargo-snapshot-x86_64.sha256sum] = "48edb2eb51d7c56ef9a3130f0b331e83f139559161f6f93b9588d28cf72610f3"

SRC_URI[rust-std-snapshot-aarch64.sha256sum] = "fbc39c2ba2eee9bad7305d73d02a63ada651961be8fd9e0dae520bda5d715c6e"
SRC_URI[rustc-snapshot-aarch64.sha256sum] = "f5b24f2bc30db4b8efb7eba7db86fd5db0bc283631b4c918794e9217fca32822"
SRC_URI[cargo-snapshot-aarch64.sha256sum] = "36030f5cede7971eaed45284b5243b4103184a663ad934124de8a530e0e6d993"

SRC_URI += " \
https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
"

RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
7 changes: 7 additions & 0 deletions recipes-devtools/rust/rust-source-1.61.0.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust"
SRC_URI[rust.sha256sum] = "a63305a3ad734f170746b337a5e3d07ccaa7aa8f253dc52336b44c0a3b549d7b"

RUSTSRC = "${WORKDIR}/rustc-${PV}-src"

UPSTREAM_CHECK_URI = "https://forge.rust-lang.org/infra/other-installation-methods.html"
UPSTREAM_CHECK_REGEX = "rustc-(?P<pver>\d+(\.\d+)+)-src"
6 changes: 6 additions & 0 deletions recipes-devtools/rust/rust-tools-cross-canadian_1.61.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require rust-tools-cross-canadian.inc
require rust-source-${PV}.inc
require rust-snapshot-${PV}.inc

FILESEXTRAPATHS_prepend := "${THISDIR}/rust:"

21 changes: 21 additions & 0 deletions recipes-devtools/rust/rust_1.61.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require rust-target.inc
require rust-source-${PV}.inc
require rust-snapshot-${PV}.inc

INSANE_SKIP_${PN}_class-native = "already-stripped"

do_compile () {
rust_runx build --stage 2
}

rust_do_install() {
rust_runx install
}

python () {
pn = d.getVar('PN')

if not pn.endswith("-native"):
raise bb.parse.SkipRecipe("Rust recipe doesn't work for target builds at this time. Fixes welcome.")
}