Commit Graph

132 Commits

Author SHA1 Message Date
Sundeep KOKKONDA
b36cbd3f2b rust: reproducibility issue fix
The '--remap-path-prefix' option removes all references to build directory
structure in the debug information within the compiled output for Cargo
dependencies and the project's binary.

However, some references to build directories remains in the final binary
in .rustc section in the form of compressed metadata and this makes the
build output dependent on the folder structure of the computer it's compiled on.

So, for reproducible builds, use the configuration option
'remap-debuginfo = true' along with the '--remap-path-prefix'.

[YOCTO# 14875]

(From OE-Core rev: 6ae62259afbbe861ed74211dab18a27b8c8d8b7a)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-11 09:36:53 +01:00
Richard Purdie
1b94ea8b25 recipes: Drop remaining PR values from recipes
We've been removing PR values from recipes at upgrade time for a while. In general
anyone maintaining a binary distro would end up having to curate these themselves
so the values in OE-Core aren't really that useful anymore. In many ways it makes
sense to clear out the remaining ones (which are mostly for 'config' recipes that
are unlikely to increase in PV) and leave a clean slate for anyone implementing
a binary distro config.

References are left in meta-selftest since the tests there do involve them and
their removal upon upgrade.

(From OE-Core rev: d4c346e8ab8f3cae25d1b01c7331ed9f6d4f96ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-22 07:45:17 +01:00
Alexander Kanavin
6772cb4a15 cargo-c-native: fix version check
(From OE-Core rev: 6176f8c95e444766fd3e8b89f0be686a03800268)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-12 07:45:52 +01:00
Frederic Martinsons
ed5702223b rust: add cargo-c native recipe
This package make it easier to generate C/C++ ABI compatible
header, library and also generate package config file.

It is built around cbindgen (https://github.com/mozilla/cbindgen)
for the header generation, it compiles the library (static or dynamic)
through cargo and finally handle the generation of a custom
package config file.

(From OE-Core rev: dfce5f9ffb5240aadae311c2a2e912a315afc703)

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-21 16:15:35 +01: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
Martin Jansa
155ee00592 libstd-rs, rust: use bfd linker instead of gold
* it started to fail only after the upgrade to 1.70.0

(From OE-Core rev: aa037b4138459521a3554c5e91cb4a6cd0c37bdd)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-15 09:53:38 +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
Richard Purdie
768c89e306 gcc/go: Drop crosssdk suffix from virtual provides to improve dependency handling
There is little point in having "crosssdk" suffex added to the virtual provider within
gcc/go since the TARGET_PREFIX or SDK_PREFIX already encapsulates this. Remove it
allowing some of the special case overriding to be removed.

This also allows removal of some of the MLPREFIX usage since again, the triplet
also covers this.

(From OE-Core rev: fe0206ba482d209b24e636d578aa68ba5e67ba1b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-02 10:24:50 +01:00
Alexander Kanavin
9f96e49468 meta/recipes: ensure all recipes have a SUMMARY
DESCRIPTION is optional for now; writing good component descriptions
is not easy (but appreciated).

(From OE-Core rev: 9ce4f9248db3db70732d886a18ea355f321bd49d)

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-04-13 13:53:44 +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
d75a58d013 rust: install llvm item only once
Otherwise it triggers a rebuild of llvm-dependent rust pieces every time rust_runx is called,
lengthening the builds without need.

(From OE-Core rev: aca6b29b508175da9f213b1c6dba5d02a15b8287)

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
cd9526df73 rust: do not run separate build/install steps
Upstream does not actually use or test it this way; if the goal
is to install items, then install target should be executed directly.

In particular, in latest rust release building stage 2 items has regressed
altogether (incorrect dependencies between rust-analyze tool and the
libs it needs) and no one noticed.

(From OE-Core rev: 7d805f9a9f6b5048308a37a2757d08cca40b1ff3)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-04 13:11:49 +01:00
Ross Burton
ef12246e32 llvm: remove redundant CMake variables
This recipe uses the cmake class, so there's no need to set the Ninja
backend, or tell it where Python is, or that we're cross-compiling.

(From OE-Core rev: 2560665cc1e30a6ca969118ade8612393e1eef74)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-31 23:30:36 +01:00
Sundeep KOKKONDA
3c7463a848 rust: added missing runtime dependencies to run rust on target
[YOCTO #14975]
rust files are not linking on target due to missing dependencies and observed below error.
error: linker `x86_64-poky-linux-gcc` not found

Added the required dependencies to run rust on target machine.

(From OE-Core rev: bb781f452299cfa6ec7fffd215b0af3149178f32)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-11 00:08:40 +00: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
c79127dcb1 rust: Add update_snapshot task to generate rust-snapshot.inc
Everything we need for `rust-snapshot.inc` exists in `src/stage0.json`,
so just read that to generate it.

(From OE-Core rev: a07008da8b02165d271a457e4c215f35cb15b94c)

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-02-02 10:27:30 +00:00
Martin Jansa
94149c4f37 meta: remove True option to getVar and getVarFlag calls (again)
* True is default since 2016 and most layers were already updated
  not to pass this parameter where not necessary, e.g. oe-core was
  updated couple times, first in:
  https://git.openembedded.org/openembedded-core/commit/?id=7c552996597faaee2fbee185b250c0ee30ea3b5f

  Updated with the same regexp as later oe-core update:
  https://git.openembedded.org/openembedded-core/commit/?id=9f551d588693328e4d99d33be94f26684eafcaba

  with small modification to replace not only d.getVar, but also data.getVar as in e.g.:
  e.data.getVar('ERR_REPORT_USERNAME', True)

  and for getVarFlag:
  sed -e 's|\(d\.getVarFlag \?\)( \?\([^,()]*, \?[^,()]*\), \?True)|\1(\2)|g' \
      -i $(git grep -E 'getVarFlag ?\( ?([^,()]*), ?([^,()]*), ?True\)' \
          | cut -d':' -f1 \
          | sort -u)

(From OE-Core rev: 26c74fd10614582e177437608908eb43688ab510)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-02-02 09:50:02 +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
Alex Kiernan
7692ed049d rust: Remove CARGO_VERSION
CARGO_VERSION isn't broken out in rust/src/stage0.json, there's only one
snapshot version, so just use that.

(From OE-Core rev: 9b0f88642570383b09de94238fe1a8ef5119fb47)

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-15 12:23:41 +00:00
Alex Kiernan
afd2d15923 rust: Upgrade 1.66.0 -> 1.66.1
Changes:
  Added validation of SSH host keys for git URLs in Cargo (CVE-2022-46176)

(From OE-Core rev: 3d31afc5666eda95032d0be47ff815859550a65f)

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-15 12:23:41 +00:00
Alex Kiernan
cc9244ca70 rust: Merge all rustc-source patches into rust-source.inc
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>
2023-01-12 23:08:58 +00:00
Khem Raj
a50bad0c58 rust: Fix build with 64bit time_t
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>
2023-01-06 12:03:47 +00:00
Khem Raj
ae4311f25f cargo: Do not use open64 on musl anymore
The same rust getrandom patch is needed for cargo on target as well
as it uses the same crate

(From OE-Core rev: 44441c727a5301ab99ab8b4d8b8b1f61f0a810af)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-31 17:08:29 +00:00
Khem Raj
ed134c9247 rust-llvm: Fix build on latest musl
latest musl has removed lfs64 functions

(From OE-Core rev: 7156416943dc6d772020465917418e3234cc7f66)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-31 17:08:29 +00:00
Khem Raj
755540ec8f rust,libstd-rs: Fix build with latest musl
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>
2022-12-31 17:08:29 +00:00
Khem Raj
96df183b60 rust: Do not use open64 on musl in getrandom crate
LFS64 functions are deprecated in latest musl

(From OE-Core rev: 3b63303c62f9d50d835096602f9e09669779fa3e)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-31 17:08:29 +00:00
Alex Kiernan
d2925c9c11 cargo: Drop exclude from world
On-target cargo now builds/runs.

(From OE-Core rev: eb8b8c5247a32f2bd6b680de6f1a999dc2fcbc5f)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-28 23:59:56 +00:00
Alex Kiernan
a5a8904f8c cargo: Include crossbeam-utils patch
We need patched crossbeam-utils in cargo as well as rust, move cargo
alongside rust so they can both use the same patch.

(From OE-Core rev: 39402790724014a39b265ee1978396a0514fdc98)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-28 23:59:56 +00:00
Alex Kiernan
4323ddb8a1 rust: Move musl-x86 fix for __stack_chk_fail_local to rust-source
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>
2022-12-28 23:59:56 +00:00
Alex Kiernan
510ecb586f rust: Merge .inc into .bb
(From OE-Core rev: a09bcc7db13a7308f523d985332e96461b8feeec)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-28 23:59:56 +00:00
Alex Kiernan
59812918da rust-llvm: Update LLVM_VERSION to match embedded version
(From OE-Core rev: e75f16c5f0d3e70ae08efd7d61a7e7d0c9380e72)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-28 23:59:56 +00:00
Alex Kiernan
4c4cb30301 rust-llvm: Merge .inc into .bb
(From OE-Core rev: 5a8f72fc9ae730be21bbc577d8315ae95f771dba)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-28 23:59:56 +00:00
Alex Kiernan
55dbedbd24 libstd-rs: Move source directory to library/test
Building libstd-rs from library/std omits proc_macro from the sysroot.
Using library/test causes that to be installed which then allows cargo
to build (https://github.com/meta-rust/meta-rust/issues/266)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-23 12:06:35 +00:00
Alex Kiernan
35528aff99 libstd-rs: Merge .inc into .bb
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-23 12:06:35 +00:00
Alejandro Hernandez Samaniego
cb33d63060 rust: Enable building rust from stable, beta and nightly channels
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>
2022-12-21 10:16:31 +00:00
Alex Kiernan
e55f3f911f rust: update 1.65.0 -> 1.66.0
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>
2022-12-17 23:49:56 +00:00
Alex Kiernan
e115fe5472 rust: Install target.json for target rustc
As part of the merging builds, installation of target.json was lost
causing `rustc` to fail on startup with:

  error: Error loading target specification: Could not find specification for target "aarch64-poky-linux-gnu". Run `rustc --print target-list` for a list of built-in targets

We know the full target specification, so just install it directly
rather than using the glob approach from previously.

Fixes: b9b0cd99cdc7 ("rust: Enable nativesdk and target builds + replace rust-tools-cross-canadian")
(From OE-Core rev: b187185ceecf1c852b1fdc47451d157a41962d69)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-17 23:49:56 +00:00
Alex Kiernan
4e16d1c1f6 rust: update 1.64.0 -> 1.65.0
Release notes:
  https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html

(From OE-Core rev: fa8890188e8971a5707bae1504cb010b54ed3cae)

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>
2022-11-07 14:32:42 +00:00
Alexander Kanavin
c6d8d49167 rust: submit a rewritten version of crossbeam_atomic.patch upstream
(From OE-Core rev: 4bbfd7427092063dd612d2ca9e466cb819f5a3e3)

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>
2022-11-03 07:46:46 +00:00
Alexander Kanavin
6bf209947d rust: install rustfmt for riscv32 as well
With the above rust arch fixes it builds just fine.

(From OE-Core rev: f417ae30c79fac99e2549324ed351f6f63cc4a25)

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>
2022-10-28 09:44:52 +01:00
Alex Kiernan
b72193a602 rust: update 1.63.0 -> 1.64.0
Release notes:
  https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html

(From OE-Core rev: 1d81fb264580b96c405075fcfd2a82a6f74b9630)

Signed-off-by: Alex Kiernan <alexk@zuma.ai>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-26 12:28:39 +01:00
Khem Raj
f212ad190c rust: Use libc++ runtime when using clang with llvm runtime
meta-clang has options when it comes to C++ runtime, default is to use
gnu runtime, other options are llvm runtime and android runtime. This
patch helps when a distro is using llvm runtime for C/C++ runtime. It
informs the rust build system about right C++ runtime to configure for
when such a setting is used.

(From OE-Core rev: 521872ab2cac092c88446730772cb8c4e22b0cdc)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-12 08:33:56 +01:00
Khem Raj
e2a1c8bc31 rust: Use variable to specify extra tools to install
All architectures may not support same set of tools, therefore use a
variable to specify this. E.g. on riscv32 rustfmt is not buildable
right now.

(From OE-Core rev: 332df9ebbd75a1825ac99abf1311d2e692d398d7)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-09 14:09:01 +01:00
Sundeep KOKKONDA
dd8fd17a1b rust-cross-canadian: Fix for the issue caused by using sdk shell
This is a fix for the fix in YOCTO #14878. When the shebang is more than
128 characters the default shell /bin/sh is used instead of SDK shell as
a fallback, which causes problems with LD_LIBRARY_PATH. With this patch
shell usage is avoided as we use a C wrapper and unset LD_LIBRARY_PATH
that way.

[YOCTO #14892]

(From OE-Core rev: 7cd6faf4e0147eef557f83fb266a25935e26efff)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-07 08:53:50 +01:00