]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
rust: Rebase local patch and tweaks to source as needed deepesh/rust-auto
authorDeepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Fri, 20 Feb 2026 06:21:07 +0000 (22:21 -0800)
committerDeepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Wed, 25 Feb 2026 04:03:32 +0000 (20:03 -0800)
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch
meta/recipes-devtools/rust/libstd-rs_1.94.0.bb
meta/recipes-devtools/rust/rust-source.inc
meta/recipes-devtools/rust/rust_1.94.0.bb
scripts/rust-new-nightly

index 9d345bc8b90a589f1011afeeb2869dc0da4b7d75..3b551f15e832da5e6e8fd58cceaea2edb49f8f55 100644 (file)
@@ -43,14 +43,13 @@ index 39fa23766b..51d86b4009 100644
  use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
  use rustc_index::IndexVec;
  use rustc_middle::bug;
-@@ -159,46 +159,19 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
-         }
+@@ -161,45 +161,19 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
          Linkage::Dynamic | Linkage::IncludedFromDylib => {}
      }
--
+
 -    let all_dylibs = || {
 -        tcx.crates(()).iter().filter(|&&cnum| {
--            !tcx.dep_kind(cnum).macros_only()
+-            !tcx.crate_dep_kind(cnum).macros_only()
 -                && (tcx.used_crate_source(cnum).dylib.is_some()
 -                    || tcx.used_crate_source(cnum).sdylib_interface.is_some())
 -        })
@@ -94,7 +93,7 @@ index 39fa23766b..51d86b4009 100644
          info!("adding dylib: {}", name);
          add_library(tcx, cnum, RequireDynamic, &mut formats, &mut unavailable_as_static);
          let deps = tcx.dylib_dependency_formats(cnum);
-@@ -207,6 +182,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
+@@ -208,6 +182,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
              add_library(tcx, depnum, style, &mut formats, &mut unavailable_as_static);
          }
      }
@@ -145,7 +144,7 @@ diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/bu
 index 0688a1d689..066e6bf53f 100644
 --- a/src/bootstrap/src/core/builder/cargo.rs
 +++ b/src/bootstrap/src/core/builder/cargo.rs
-@@ -1146,7 +1146,7 @@ impl Builder<'_> {
+@@ -1347,7 +1347,7 @@ impl Builder<'_> {
          // When we build Rust dylibs they're all intended for intermediate
          // usage, so make sure we pass the -Cprefer-dynamic flag instead of
          // linking all deps statically into the dylib.
@@ -183,9 +182,9 @@ index d4099cafe5..5b499a1fa1 100644
 -// We need this feature as it changes `dylib` linking behavior and allows us to link to `rustc_driver`.
 -#![feature(rustc_private)]
 -
- fn main() {
-     rustdoc::main()
- }
+ use std::process::ExitCode;
+
+ fn main() -> ExitCode {
 diff --git a/src/tools/rustfmt/src/git-rustfmt/main.rs b/src/tools/rustfmt/src/git-rustfmt/main.rs
 index b8b0432aa9..b5bd71e015 100644
 --- a/src/tools/rustfmt/src/git-rustfmt/main.rs
@@ -202,7 +201,7 @@ diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/c
 index 27bbc8bd8f..a6fc4df2eb 100644
 --- a/src/bootstrap/src/core/build_steps/compile.rs
 +++ b/src/bootstrap/src/core/build_steps/compile.rs
-@@ -2158,23 +2158,7 @@
+@@ -2356,23 +2356,7 @@
          for f in builder.read_dir(&src_libdir) {
              let filename = f.file_name().into_string().unwrap();
  
index 8af93bec579c4074091b299b5d33ca38259d10a8..929da96d8785f1cbec58e00045b54e9ac700dc35 100644 (file)
@@ -25,7 +25,7 @@ DEPENDS:remove:riscv64 = "libunwind"
 # Embed bitcode in order to allow compiling both with and without LTO
 RUSTFLAGS += "-Cembed-bitcode=yes"
 # Ensure that user code can't access the dependencies of the standard library
-RUSTFLAGS += "-Zforce-unstable-if-unmarked"
+RUSTFLAGS += "-Zforce-unstable-if-unmarked -Zunstable-options"
 # Needed so cargo can find libbacktrace
 RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
 
index a12b7b278387011cc06b19266357e28fcdee5cc3..8e72a7906d76a1fa46fac95feaa6f20a79c4adf9 100644 (file)
@@ -1,14 +1,13 @@
 RUST_VERSION ?= "${@d.getVar('PV').split('-')[0]}"
 
-SRC_URI += "https://static.rust-lang.org/dist/2026-01-19/rustc-nightly-src.tar.xz;name=rust \
+SRC_URI += "https://static.rust-lang.org/dist/2026-02-18/rustc-nightly-src.tar.xz;name=rust \
             file://0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch;patchdir=${RUSTSRC} \
             file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \
             file://oeqa-selftest-Increase-timeout-in-process-sigpipe-ru.patch;patchdir=${RUSTSRC} \
             file://revert-link-std-statically-in-rustc_driver-feature.patch;patchdir=${RUSTSRC} \
             file://disable-rustfmt-check.patch;patchdir=${RUSTSRC} \
-            file://revert-destabilise-target-spec-json.patch;patchdir=${RUSTSRC} \
 "
-SRC_URI[rust.sha256sum] = "15125be18eb452d2891d87190f84298a9c03b1c1493b566f23b0f08d2f69adb0"
+SRC_URI[rust.sha256sum] = "2a068a25560fac48527facabead4edfc30a4e344a3b3323139990124580921cf"
 
 RUSTSRC = "${UNPACKDIR}/rustc-nightly-src"
 
index 14e2989fdf847d0cfa6a4fbbcbb3c997fce2be66..8fa73e702e7a6a900596037a4d0ea437da914537 100644 (file)
@@ -242,6 +242,8 @@ rust_runx () {
 
     oe_cargo_fix_env
 
+    export RUSTC_BOOTSTRAP="1"
+
     python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose
 }
 rust_runx[vardepsexclude] += "PARALLEL_MAKE"
index 347f7e6211022dd69fd9f1f9501d5330e841139c..d1b0201c706d431636435aa892c7dabb8de2fe29 100755 (executable)
@@ -56,7 +56,15 @@ def run_bitbake_with_tee(machine, recipe):
     process = subprocess.Popen(["bash", "-c", cmd])
     process.wait()
 
-    if process.returncode != 0:
+    #tweak to scan the log file for failure
+    failed = False
+    with open(log_file, "r") as f:
+        for line in f:
+            if line.startswith("ERROR:") or "Task failed" in line:
+                failed = True
+                break
+
+    if process.returncode != 0 or failed:
         print(f"FAILED: {recipe} for {machine}")
         return False
 
@@ -206,6 +214,7 @@ def main():
         print("Failures detected:")
         for machine, recipes in all_failures.items():
             print(f"  {machine}: {', '.join(recipes)}")
+        sys.exit(-1)
 
 if __name__ == "__main__":
     main()