Commit Graph

77 Commits

Author SHA1 Message Date
Richard Purdie
3f8cb421e3 rust-source: Fix remove_gcc_directory
The patch works for rust-native but not other recipes which change ${S}.
Set it to use the correct path so it works for llvm-rust, cargo and others,
maximising the space saving.

(From OE-Core rev: 1aee0bc109c1457159440c279ddc1fe5a8d89586)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-29 15:24:34 +00:00
Deepesh Varatharajan
01dbb30d39 rust: Oe-selftest changes for rust v1.84.1
Ignore the failing unit test.

The tidy check failed due to a typo, which was already reported and
fixed in the Rust upstream.

Upstream-Status: Backport [8e77349782]

(From OE-Core rev: 94a244a14075ead1b3b5e966c0fe713cd448cad8)

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-27 13:41:58 +00:00
Deepesh Varatharajan
28a077b4aa rust: Fix build failure when multilibs are enabled
When multilibs are enabled, building rust is failing because of the following commit
68034f837a
with stage1/rustc cannot able to find dependent *.so files. The issue is
been fixed inrust-master with the following commit by passing the necessary library
paths before executing stage1/rustc

Upstream-Status: Backport [139d6ba054]

(From OE-Core rev: ab29b970ba7e08eabca92018d103af5f249ed2c5)

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-27 13:41:58 +00:00
Deepesh Varatharajan
6d78fbe5c5 rust: Upgrade 1.83.0->1.84.1
Rust stable version updated to 1.84.1.
https://blog.rust-lang.org/2025/01/30/Rust-1.84.1.html

Renamed and modified the below patch to adapt the new version.
rv32-cargo-rustix-0.38.37-fix.patch->rv32-cargo-rustix-0.38.38-fix.patch

Modified the below patches to adapt the new version.
repro-issue-fix-with-cc-crate-hashmap.patch
revert-link-std-statically-in-rustc_driver-feature.patch

Dropped the below patches :
0001-NFC-fix-build-failure-100993.patch
6ee49080e4

revert-Zdual-proc-macros-additional-check.patch
Issue is fixed in rust-master and the fix is backported in the
subsequent patch of the series.

(From OE-Core rev: 4265f668de8c6708cb3a003ad655559031724149)

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-27 13:41:58 +00:00
Deepesh Varatharajan
2cb5d1accc rust: Fix bloat issue in recent rust updates
Remove the "src/gcc" directory from the Rust source code to reduce the
filesystem build space.

In Rust 1.83 (and 1.84), a full GCC-14 tree was included, which caused
the tar.xz archive to increase by 128 MB and the unpacked sources to
grow by 1.3 GB. This was an upstream error that has been resolved in
Rust 1.85.

After updating to Rust 1.85 we can revert this removal of "src/gcc"

(From OE-Core rev: 26a345adc8e050657bfa0b51ea92a3d89e698d9a)

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-27 13:41:58 +00:00
Deepesh Varatharajan
72e21bef1a rust: Upgrade 1.82.0->1.83.0
Rust stable version updated to 1.83.0.
https://blog.rust-lang.org/2024/11/28/Rust-1.83.0.html

Renamed and modified the below patch to adapt the new version.
rv32-cargo-rustix-0.38.34-fix.patch->rv32-cargo-rustix-0.38.37-fix.patch

Modified the below patches to adapt the new version.
repro-issue-fix-with-cc-crate-hashmap.patch
revert-link-std-statically-in-rustc_driver-feature.patch

Dropped: zlib-off64_t.patch
a566e156b3kq

Because of the following commit ,
68034f837a
when we enable lib32, getting build failure because there is a check for target
support for "-Zdual-proc-macros" flag not functioning properly when lib32 is
enabled in the build environment. So for now reverting this commit and bring
back the previous behavior, where the "-Zdual-proc-macros" flag is always
added for building proc macros, regardless of the target architecture's support.
This would bypass the check introduced in the patch, allowing the build to
proceed without error, even when building for a 64-bit architecture with lib32 enabled.

(From OE-Core rev: 40d8dafdf556d7ce79c12a6de872193be9a0928a)

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-05 21:26:54 +00:00
Deepesh Varatharajan
e5a11a0ed1 rust: oe-selftest issue fix with v1.82
A new feature "Link std statically in rustc_driver" was introduced
in rust_1.82 [https://github.com/rust-lang/rust/pull/122362],and
which is causing the below failure in oe-selftest.

Running unittests src/main.rs (build/x86_64-unknown-linux-gnu/stage1-rustc/
x86_64-poky-linux-gnu/release/deps/rustc_main-92223b15c9f2d827)
uploaded ".../build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-poky-linux-gnu/
release/deps/rustc_main-92223b15c9f2d827", waiting for result
/tmp/work/test4056/rustc_main-92223b15c9f2d827: error while loading shared
libraries: librustc_driver-fb0866b1cd913c20.so: cannot open shared object file: No
such file or directory

The rustc_main binary depends on the librustc_driver-*.so file. However,
this file has not been copied to QEMU. If we manually copy the file into
QEMU and export the LD_LIBRARY_PATH, the issue does not occur. Issue
reprorted to upstream and reverted the buggy code as a workaround.

Upstream-Status: Inappropriate [reported at https://github.com/rust-lang/rust/issues/136237]

(From OE-Core rev: 977bd1a10771a6588e596e1bbfd49e9af659aa4a)

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-20 11:57:49 +00:00
Deepesh Varatharajan
555849ead3 rust: Upgrade 1.81.0->1.82.0
Rust stable version updated to 1.82.0.
https://blog.rust-lang.org/2024/10/17/Rust-1.82.0.html

Renamed the below patch to adapt the new version.
rv32-cargo-rustix-0.38.28-fix.patch->rv32-cargo-rustix-0.38.34-fix.patch

Dropped: rv32-rustix-libc-backend.patch [addressed with rv32-cargo-rustix-0.38.34-fix.patch]

(From OE-Core rev: cfa431e734a642796140347f09c3c54b41a7bb75)

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-20 11:57:49 +00:00
Alexander Kanavin
ce5428f48a rust: restore parallel builds, disable lto only for rustdoc
The original reproducibility fix was problematic for a couple reasons:

- disabling both lto and parallel builds had an unfortunate effect of nearly
doubling rust-native and rust build times (which are slow to begin with).
Disabling lto hurts runtime performance too.

- both of these things were done for the *entire build*, while the only
problematic item is the librustdoc crate.

- lto=off option in config.toml has an effect only on building rustc
(the compiler itself), and doesn't help with rustdoc reproducibility.
Actual fix is the codegen-units setting, which indirectly disables
lto via giving llvm only one unit to work with at a time.

After some digging, here's a more targeted fix for the problem.

Why librustdoc is non-reproducible, but not anything else
remains a mystery, hidden deep in rust-llvm's lto optimization code.

(From OE-Core rev: a1977407a88a2004c3a6d2dba1d5bfe1aa1664b2)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-05 12:49:56 +00:00
Deepesh Varatharajan
e51f98d5ff rust: Upgrade 1.80.1->1.81.0
https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html

Drop the following backported patches which is addressed
with rust v1.81.0 upgrade.

0001-cargo-do-not-write-host-information-into-compilation.patch
2db0bab161

hardcodepaths.patch
28503d69ac

(From OE-Core rev: 611ec9ffbac974f472a828277ba7f3e344e99ca3)

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-14 11:57:52 +00:00
Deepthi Hemraj
8f644a65b6 rust: Upgrade 1.80.0->1.80.1
https://blog.rust-lang.org/2024/08/08/Rust-1.80.1.html

Testing Summary for rust_1.80.1

Target       pass       skipped
x86_64       18254         434
x86          18084         604
ARM64        18111         577
ARM          18067         621
ppc          18035         653

(From OE-Core rev: 41da52480931c5ff90884c9d658075b8885abe8c)

Signed-off-by: Sunil Dora <SunilKumar.Dora@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-21 12:16:28 +00:00
Harish Sadineni
30bf8dcc25 rust: Upgrade 1.79.0->1.80.0
Update the patch files with rust v1.80.0.

The patch repro-issue-fix-with-cc-crate-hashmap.patch addresses the rust
 reprouciblity issue by correcting the way hash values are generated for
 different build paths.

https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html

(From OE-Core rev: d68449da0df795abe3233383a82d0b6b7908d736)

Signed-off-by: Sunil Dora <SunilKumar.Dora@windriver.com>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-18 22:09:02 +00:00
Peter Tatrai
b82bb08f15 rust: Add patch to increase timeout in process-sigpipe rust selftest
This commit adds a patch to increase the timeout in the process-sigpipe
rust selftest to prevent occasional failures under heavy server load.
The patch aims to reduce the likelihood of false negatives when the test
environment is overloaded.

Patch file:
* oeqa-selftest-Increase-timeout-in-process-sigpipe-ru.patch

Fixes [YOCTO #15625]

(From OE-Core rev: 12c85933e2150ba78a8a914787e400c95c5cf585)

Signed-off-by: Peter Tatrai <peter.tatrai.ext@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-12 23:54:35 +00:00
Ranjitsinh Rathod
436d1df93b rust: set CVE_STATUS for CVE-2024-43402
As per NVD, this CVE only affects to Windows platform
Link: https://nvd.nist.gov/vuln/detail/CVE-2024-43402

(From OE-Core rev: dcb3016f9c0e8e72642cccf335da65345a2f0c92)

Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-15 11:47:24 +01:00
Yash Shinde
caa36ffb08 rust: Upgrade 1.78.0->1.79.0
Update the patch files with rust v1.79.0.

Drop the following backported patch which is merged
with rust v1.79 upgrade.

- cross-targets-backport.patch

https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html

(From OE-Core rev: 0e20d8e0a292f720c9ed419547d8f6d738c5d4d8)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-29 21:58:19 +01:00
Yash Shinde
f0b62cf9a8 rust: Upgrade 1.77.2->1.78.0
* Drop the following backported patches which are merged
with rust v1.78 upgrade.

- 0001-Revert-Map-source-absolute-paths-to-OUT_DIR-as-relat.patch
- repro-issue-fix-with-v175.patch
- deadcode-backport.patch

https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html

(From OE-Core rev: a3fb378afcc1fb01e9813fe902dbd6090ded75d7)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-20 11:55:36 +01:00
Yash Shinde
ea471cf48c rust: Upgrade 1.77.1->1.77.2
https://blog.rust-lang.org/2024/04/09/Rust-1.77.2.html

(From OE-Core rev: c3a996c3b06b11a5e2b07dbf820f3e3eb1e28782)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-09 22:33:38 +01:00
Yash Shinde
961bafda94 rust: Upgrade 1.77.0->1.77.1
https://blog.rust-lang.org/2024/03/28/Rust-1.77.1.html

(From OE-Core rev: a7ca97ffbb23602ad79c3dc1819cfedd0b969075)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-09 22:33:38 +01:00
Yash Shinde
41094aece8 rust: Upgrade 1.76.0->1.77.0
* Drop backported patch 0001-Handle-vendored-sources-when-remapping-paths.patch
    as it's merged with rust v1.77.0.

     https://blog.rust-lang.org/2024/03/21/Rust-1.77.0.html

(From OE-Core rev: 8b6b224fc116150c0af658473eecd05b742de7b1)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-09 22:33:38 +01:00
Yash Shinde
4c9d7632f6 rust: Oe-selftest changes for rust v1.77
Update the file paths for v1.77 and fix the dead code error as follows:

    Compiling coverage-dump v0.1.0 (/home/poky/build-st/tmp/work/core2-64-poky-linux/rust/1.77.0/rustc-1.77.0-src/src/tools/coverage-dump)
    error: field `0` is never read
       --> src/tools/coverage-dump/src/covfun.rs:222:15
        |
    222 |     Expansion(u32),
        |     --------- ^^^
        |     |
        |     field in this variant
        |
        = note: `-D dead-code` implied by `-D warnings`
        = help: to override `-D warnings` add `#[allow(dead_code)]`
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    222 |     Expansion(()),
        |               ~~

    error: could not compile `coverage-dump` (bin "coverage-dump") due to 1 previous error

    Only the required change is backported here to run the build without any errors.
    Other changes are merged with the commit in v1.78.

    Reference: 9a5034a20e (diff-d4ecc6273352a2a8ebd02c45233d9bff7c6694f20b67ddad0614af7a89c06748)

(From OE-Core rev: 072df9d3d8792a6f0250cc5e37545f04e6a046ec)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-09 22:33:38 +01:00
Yash Shinde
66d81c81b6 rust: reproducibility issue fix with v1.76
A few crates are using the updated version of the 'cc' crate and
this is causing the generated object file names containing a unique hashmap id.
The hashmap addition to generated files is reverted here.

(From OE-Core rev: 25fed23ea9dcd1e7f0c11a1e3a988a33d5676c0b)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-09 22:33:38 +01:00
Yash Shinde
be70d81a3c rust: Upgrade 1.75.0->1.76.0
* Drop "--doc" option for rust oe-selftest since
it is not supported on bootstrap builds for
cross-targets.

* Drop the following backported patches which are merged
with rust v1.76 upgrade.

- custom-target-cfg.patch
- rustc-bootstrap.patch
- rv32-missing-syscalls.patch
- target-build-value.patch

https://blog.rust-lang.org/2024/02/08/Rust-1.76.0.html
* Drop 'rust-rustdoc' and 'rust-dbg' from 'exclude_packages' list
to check for rust reproducibility.

(From OE-Core rev: 71d17ed3c7be029fc68e9dd3f5d6c4aa72ef861a)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-09 22:33:38 +01:00
Yash Shinde
ab1bd4a04b rust: Oe-selftest fixes for rust v1.76
Add the failing tests in rust v1.76 to the exclude list
and add "ignore" tags to ignore failing unit test cases.

(From OE-Core rev: 75399802515ac423503e637281a4585dd00d7c75)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-09 22:33:38 +01:00
Sundeep KOKKONDA
e2e7017350 rust: rustdoc reproducibility issue fix
The 'codegen-units' option split the crate into multiple compilation units for parallel compilation. Currently, this split is causing the rustdoc to generate differnt binary between the builds.
To fix this the codegen-units & the lto options are disabled.

More info about options:
https://doc.rust-lang.org/cargo/reference/profiles.html#codegen-units
https://doc.rust-lang.org/rustc/codegen-options/index.html#lto

(From OE-Core rev: 0c00875de10b171f4ff2990af351a8124ec7e972)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-30 12:32:53 +01:00
Alexander Kanavin
d419566eda rust: add reproducibility patch to eliminate host leakage
[YOCTO #15185]

(From OE-Core rev: 924df18b47e9a69fa295bafe37bdb39d8eaea2bb)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-28 15:09:01 +01:00
Alexander Kanavin
8240d506fc rust: correctly link rust-snapshot into build/stage0
This does not seem to be used in regular builds, but is beneficial
in rust selftest, where it allows dropping a custom patch
that is unsuitable for upstream (and was rejected by them).

Also remove an obsolete comment that seems related to the code
but describes something that was resolved long time ago.

I have confirmed that the rust selftest continues to pass with just
this one commit on top of master (as the following changes do break
the selftest).

(From OE-Core rev: bf5732e2b235ce06fa1f24fe8f0dbcbc068500e3)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-22 10:21:26 +01:00
Harish Sadineni
0304adce22 rust: set CVE_STATUS for CVE-2024-24576
CVE-2024-24576 only applies when invoking batch files (with the `bat` and `cmd` extensions) on Windows & No other platform or use is affected.
More details about CVE is here: https://nvd.nist.gov/vuln/detail/CVE-2024-24576

(From OE-Core rev: 28eddfa53494c7560861feff84be3f3a5a46aecb)

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-10 18:35:09 +01:00
Yash Shinde
3970a48885 rust: reproducibility issue fix with v1.75
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues.
This change will fix the path name format back to '/rust/$hash' as in earlier versions.

Below are the links for detailed bug description & discusssion with upstream rust.
https://github.com/rust-lang/rust/issues/120825#issuecomment-1964307219
https://github.com/rust-lang/rust/issues/120825#issuecomment-1964652656

(From OE-Core rev: a80ce6e3c023809d1ec13d19e8acb25770b54737)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-01 09:31:11 +00:00
Yash Shinde
a62cee4479 rust: Upgrade 1.74.1 -> 1.75.0
* Drop backported musl fixes.

* Set `change-id` rather than `changelog-seen`
to fix build warning.

* Add fixes for 4b7e0a0b56aa24 ("Handle vendored sources
when remapping paths") which otherwise cause build failures:

| thread 'main' panicked at src/core/builder.rs:1795:26:
| std::fs::read_dir(registry_src) failed with No such file or directory (os=
 error 2)

https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html

(From OE-Core rev: 9aec2c6c777388bb3129aa4c4f27a40f912522b4)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-01 09:31:10 +00:00
Khem Raj
f31fe0b5b5 rust/cargo: Build fixes to rust for rv32 target
(From OE-Core rev: 0b1666b921b99732798b62b900436ab79876a6a2)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08 10:59:06 +00:00
Yash Shinde
bb630c3e29 rust: Enable rust oe-selftest.
* Enable rust oe-selftest.

* Include the dependent patches for rust oe-selftest in
  meta/recipes-devtools/rust/rust-source.inc

* Disable rust oe-selftest for mips32 target (Rust upstream has classified it into tier 3 target,
  for which the Rust project does not build or test automatically) as it is unstable with rust tests.
  https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-3

* The testing is done on arm32, arm64, mips64, x86 and  x86_64 targets on Ubuntu 22.04.

(From OE-Core rev: 8f3a2841540fc4779bbd7e11d910edcdc8b47683)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-26 14:06:55 +00:00
Alex Kiernan
f00d4c3029 rust: Upgrade 1.74.0 -> 1.74.1
https://blog.rust-lang.org/2023/12/07/Rust-1.74.1.html

(From OE-Core rev: b98373075c6cc416bd0375b98b6bbdddf599d9a1)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-30 11:03:08 +00:00
Alex Kiernan
8fd396bc3d rust: Upgrade 1.73.0 -> 1.74.0
Replace musl fixes with backports from upstream.

Add sysconfdir to config.toml to fix:

| thread 'main' panicked at install.rs:92:9:
| User doesn't have write access on `install.sysconfdir` path in `config.toml`.

https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html

(From OE-Core rev: 84f46dd2503bb0ef238fef0097c66fda88f6cbda)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-30 11:03:08 +00:00
Alex Kiernan
537ed2b654 rust: Upgrade 1.72.1 -> 1.73.0
https://blog.rust-lang.org/2023/10/05/Rust-1.73.0.html

(From OE-Core rev: 728c40b939c6af6358a483237298ca834cbb8993)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-30 11:03:08 +00:00
Alex Kiernan
aa0b0d0cc2 rust: Upgrade 1.72.0 -> 1.72.1
https://blog.rust-lang.org/2023/09/19/Rust-1.72.1.html

(From OE-Core rev: d1386bbf2211c7616527e62f2f7b069a935b0d68)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-30 11:03:08 +00:00
Alex Kiernan
6eabf7e4b4 rust: Upgrade 1.71.1 -> 1.72.0
Drop getrandom-open64.patch (merged upstream).

Revert c4f414f449
("Map source absolute paths to OUT_DIR as relative. (#684)") which
causes hashed versions of the build path to be used as part of the
filename of generated objects and hence reproducibility issues.

https://blog.rust-lang.org/2023/08/24/Rust-1.72.0.html

(From OE-Core rev: 30637cdeb31fae02544fdc643a455d0ebb126ee6)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-30 11:03:08 +00:00
Alex Kiernan
66ba893285 rust: Upgrade 1.71.0 -> 1.71.1
https://blog.rust-lang.org/2023/08/03/Rust-1.71.1.html

(From OE-Core rev: ad4369d7901c1239e5f07473b1f2517edc4a23ea)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:49:43 +00:00
Alex Kiernan
93292feac4 rust: Upgrade 1.70.0 -> 1.71.0
Switch libstd-rs to use the dummy `sysroot` crate which represents the
standard library crates. Target getrandom-open64.patch at 0.2.8 (merged
for 0.2.9). Drop bootstrap_fail.patch (backport merged).

https://blog.rust-lang.org/2023/07/13/Rust-1.71.0.html

(From OE-Core rev: c3eba94ee44adcd3a0aa61f6b087c15c02e4697f)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:49:42 +00:00
Alex Kiernan
8078310674 rust: Drop TARGET_VENDOR export
This was used by crossbeam_atomic.patch, but that patch was removed as
part of the 1.69.0 upgrade.

(From OE-Core rev: 3753997d6ec19e8cd082f9a602ebe4a7c1308c36)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-01 11:48:25 +00:00
Yash Shinde
c496b1eaf4 oeqa/selftest/rust: Add failed test cases to exclude list for Rust Oe-selftest
* Add the failing test cases in exclude_list to exclude them from testing during the Rust Oe-selftest.

* Drop  meta/recipes-devtools/rust/files/rust-oe-selftest.patch file as the failing tests are
  moved from being a patch to exclude_list in meta/lib/oeqa/selftest/cases/rust.py.

* When updating to a newer version of Rust, it is manually needed to update the exclude_list. The tests that fail are observed to
  work on some versions and fail on others. These tests have been excluded in order to successfully complete testing of Rust Oe-selftest.

* The tests that are passed and skipped are as follows-

Target                  PASS                    SKIPPED

ARM                     15507                    428
ARM64                   15535                    400
MIPS64                  15479                    456
X86                     15528                    407
X86-64                  15643                    292

Also, time the test execution and pass the time taken for inclusion in the test report.

[RP: Note duration addiion in the commit log]
(From OE-Core rev: e81197c4d3b36e9ad52e56708c21987cacd13147)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-07-30 07:54:44 +01:00
Yash Shinde
9b07dbc41f rust: Fix BOOTSTRAP_CARGO failure during Rust Oe-selftest
BOOTSTRAP_CARGO command fails due to codegen flags like `-Cpanic` were
prevented from being reflected in the current target configuration which
leads to Rust build(rust version 1.70) failure in Oe-selftest.

Upstream-Status: Backport [9dffb52738]

(From OE-Core rev: a48e3612b5dc0e58a89f88a914365e926101c90b)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-07-30 07:54:44 +01:00
Yash Shinde
a1096d4a57 oeqa/selftest: Add rust selftests
The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test. It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Tested for X86, X86-64, ARM, ARM64 and MIPS64 on Ubuntu 22.04.
(From OE-Core rev: 7c3346d8fbe85302b605bb3f772b029ea7bfaa6c)

Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Vinay Kumar <vinay.m.engg@gmail.com>
Signed-off-by: Yash Shinde <yashinde145@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-07-19 18:00:32 +01:00
Alexander Kanavin
f01cd7aeaf rust-common.bbclass: move musl-specific linking fix from rust-source.inc
This needs to be done for any item that is linked under rustc,
and not just rust itself. Latest python-cryptography exposes the issue.

(From OE-Core rev: d3811228747590ea06e8d68be4785d45ec9c478f)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-27 16:23:40 +01:00
Alex Kiernan
5035a8588b rust: Upgrade 1.69.0 -> 1.70.0
Drop 0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch as this
is merged upstream in rust-llvm.

https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html

(From OE-Core rev: d1af583c290eb0cff5e36363f7531832a863a1a8)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-07 23:41:19 +01:00
Alex Kiernan
b17491f7f1 rust: Upgrade 1.68.2 -> 1.69.0
Rebase patches, drop crossbeam_atomic is this fully merged upstream.

https://blog.rust-lang.org/2023/04/20/Rust-1.69.0.html

(From OE-Core rev: 39e05f9b0fdc3f76f8b80a12989f78614bc9ea5c)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-05 11:07:25 +01:00
Alex Kiernan
b205ab58a6 rust: Upgrade 1.68.1 -> 1.68.2
Changes:

* Update the GitHub RSA host key bundled within Cargo. The key was
  rotated by GitHub on 2023-03-24 after the old one leaked.
* Mark the old GitHub RSA host key as revoked. This will prevent Cargo
  from accepting the leaked key even when trusted by the system.
* Add support for @revoked and a better error message for
  @cert-authority in Cargo’s SSH host key verification

(From OE-Core rev: 4563432b41026adc56c54452984b19ab64e7406e)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-13 11:56:07 +01:00
Khem Raj
9200d01057 cargo: Fix build on musl/riscv
libc needs fix for defining scope of SOCK_SEQPACKET

(From OE-Core rev: 378da16ebe2917f26f9fe8cf654bced09ec6ecfe)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-13 11:56:07 +01:00
Alexander Kanavin
6cfa4e540c rust: update 1.67.1 -> 1.68.1
Rebase patches; one of the vendored crossbeam versions
has been removed upstream, and so crossbeam_atomic.patch
is adjusted accordingly.

Replace getrandom-open64.patch with a backport.

(From OE-Core rev: f5accb4fae49342cbec21718ae7a427615bfcedd)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-04 13:11:50 +01:00
Alexander Kanavin
5b3b5a514f rust: update 1.67.0 -> 1.67.1
(From OE-Core rev: d80c1e0270cdb35a29863eefaa5a8be2a2841631)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-02-20 15:18:30 +00:00
Alex Kiernan
a10ec437b1 rust: Upgrade 1.66.1 -> 1.67.0
Disable ZStd to avoid needing libzstd in llvm (mirrors zlib disable).
Generate complete list of rust-snapshot artefacts from src/stage0.json.
Drop clippy-driver reproducibility change as the code is gone from
upstream.

Release notes:
  https://releases.rs/docs/1.67.0/

License-Update: Unicode-TOU text added (already in our license string)
(From OE-Core rev: 4900e0c5cb8a092a1d77d4f26249afa59b241da6)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-31 17:11:07 +00:00