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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
With the dim-sum approach to patching we had the same patch applied in
many places, but not all, so that there were no guarantees that we were
actually building agaginst the same thing in all recipes.
(From OE-Core rev: 550c273f38d8e6d2d431908023e213c6b018d7ed)
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>
The vendored copy of zlib undefines _FILE_OFFSET_BITS when
_LARGEFILE64_SOURCE is defined and enabling 64bit time_t requires 64bit
off_t ( _FILE_OFFSET_BITS=64 ), therefore remove this from the
zlib module
(From OE-Core rev: 73e56624e815c52308a81852430a8bb050a0fc58)
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>
newer musl do not provide lfs64 functions anymore since off_t is always
64bit on musl using normal functions would suffice
(From OE-Core rev: f01b2ab83068e4d7f263c31dca2a3fa9ef77a98e)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Any consumer of rust-source (potentially) needs this, so move to
rust-source.inc
(From OE-Core rev: 3c88cf98361a8f1c6f5183cc8887cccfad9d08ba)
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Rust follows the train release model via the stable, beta and nightly channels,
by default we build rust from the stable channel, however there are certain
features which are only available in the beta or nightly channels.
Make these channels available by setting a RUST_CHANNEL variable which defaults
to stable making this change transparent to the user.
The snapshot version used by rust during its compilation wont necessarily match
the version being built, specially if were building from an unstable channel,
to avoid confusion rename this to SNAPSHOT_VERSION and use RUST_VERSION for the
version to be built, which is automatically defined to PV.
Append -beta or -nightly to rusts PV for signature awareness.
It is important to note that this does not build rust from the beta/nightly
published tarball (which today build rust v1.67.0 and v1.68.0 respectively),
instead this builds rust from the current selected version (1.66.0) and enables
the beta/nightly features for that version.
Setting the variable RUST_CHANNEL=nightly results in the following:
$ rustc -Vv
rustc 1.66.0-nightly
(From OE-Core rev: 807a52686682d0d0a151ea3dadd99880feb67cc0)
Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Drop backported patch ENOTSUP constant for riscv32/musl.
Release notes:
https://blog.rust-lang.org/2022/12/15/Rust-1.66.0.html
License-Update: Upstream has added Unicode Terms of Use license
(Unicode-TOU).
(From OE-Core rev: e6a9e1ea7be842dcde109e952fbc7dc08d1577a2)
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
crossbeam-utils tries to use the triplet to look up whether the target
supports various forms of atomics. We use TARGET_VENDOR and not "-unknown"
in the target case which means this fails and breaks platforms like mips
and powerpc 32 bit. Add a patch to handle TARGET_VENDOR in this case.
(From OE-Core rev: 5d8c01dfed4c82fcc5d504c728a51fb98a262300)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Latest rust has started using ENOTSUP define, which is not available in
the older libc that current release of compiler is using therefore
backport the needed patch. Eventually when vendored version of libc
bumps to 1.33+ we should not need this patch.
(From OE-Core rev: 097e38f28990229c3f54f4e6cb74ca8be0b806e6)
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>
Release notes:
https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html
This is a standard upgrade aside from the path for the
stage2 tools binaries (clippy, et.al.) changing.
(From OE-Core rev: 9f390accf5fd174c430928cf841728d0456fc1b7)
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
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>
Add a patch which removes the sections of code which encode buildpaths. Whilst
not ideal, the patches at least show where the problematic data is coming from
and should allow more focused work to resovle it by someone who has a better
understanding of rust and what this code is doing. It does look unlikely we
actually need this code in our usecases anyway.
(From OE-Core rev: c08c522fc29445aef0c64f0dd8df8a3531c04afa)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Drop the two libstdc patches as they've finally appeared upstream.
Disable the use of libstdc++.a from the host distributions, as it results
in cross-distro contamination in rust-native.
(From OE-Core rev: 94760bc118952160865352c10ca7693680b5ce7e)
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>
Rust has been upgraded to rust-1.60.0 that uses LLVM 14.
Please refer the following link for more detailed features.
https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.htmlhttps://github.com/rust-lang/rust/blob/master/RELEASES.md
(From OE-Core rev: 786a9a66486cf179ee4c9e295569fcd8c37fef78)
Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Drop libstd-rs patches as they're merged upstream.
(From OE-Core rev: 05f4a09899aa8dbb22ef1adb494abac41d5b96b7)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This update includes fixes for the 'trojan source' vulnerability:
https://blog.rust-lang.org/2021/11/01/Rust-1.56.1.html
Drop two unused patches.
(From OE-Core rev: 5ff0b0d8c6c37ebf916062f03a378fe0e34b1c53)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This is latest major release, changes are here [1]
Forward port libstd-rs patches and refresh musl/rv64 port
[1] https://github.com/rust-lang/rust/releases/tag/1.56.0
(From OE-Core rev: 183204cbc70a4ef418b16df48bc7eb6e3a75a114)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This complicates (semi) automated upgrades, and isn't necessary
as we carry only a single version of the toolchain.
(From OE-Core rev: f7a6b23d99fba5855cfb34788199877a14206293)
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>