Go to file
Romain Naour 34effd4a47 package/rust: install rustc and rust-std built by Buildroot
The test TestRust is currently broken with ripgrep package with
the following error:

error[E0514]: found crate `core` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.58.1) (consider running `cargo clean` first)
  = note: the following crate versions were found:
          crate `core` compiled by rustc 1.58.1 (db9d1b20b 2022-01-20): TestRust/host/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-6cfcec236d576603.rlib

error[E0514]: found crate `std` compiled by an incompatible version of rustc

The problem is not really a cross-compilation issue (we are building
for an armv7 target on x86_64 host) but a problem with rust-std libraries
(rlib).

We can notice that "rustc 1.58.1 (db9d1b20b 2022-01-20)" is the same
version as the prebuilt rustc used to bootstrap the build:

TestRust/host/bin/rustc --version
rustc 1.58.1

TestRustBin/host/bin/rustc --version
rustc 1.58.1 (db9d1b20b 2022-01-20)

Indeed we are using host-rust-bin to bootstrap the host-rust compiler
package built by Buildroot. The problem is that the
libcore-6cfcec236d576603.rlib file come from host-rust-bin (rust-std)
and is not removed before installing host-rust built by Buildroot.

We actually spent a lot of time to build host-rust with rust-std
and forget to install this important library HOST_DIR.

Looking at the host-rust build directory we can notice two installer
script "install.sh" (the same scripts used to install host-rust-bin):

TestRust/build/host-rust-1.58.1/build/tmp/tarball/rust/x86_64-unknown-linux-gnu/rust-1.58.1-x86_64-unknown-linux-gnu/install.sh
TestRust/build/host-rust-1.58.1/build/tmp/tarball/rust-std/armv7-unknown-linux-gnueabihf/rust-std-1.58.1-armv7-unknown-linux-gnueabihf/install.sh

The "tarball" directory is generated by the "python x.py dist" during
the install step, we have to keep it.

Replace "python x.py install" by theses two install scripts.
Installing rust-std with the install.sh script replace the rust-std
libraries installed by host-rust-bin.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/2116202544

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
[Arnout: remove redundant parenthesis; only use a variable for the
common install opts]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit 1568249391)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2022-03-20 18:31:24 +01:00
arch core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH 2022-02-08 21:20:23 +01:00
board fix links to Technologic Systems web resources 2022-03-17 22:32:15 +01:00
boot boot/uboot: fix build with host-gcc 10+ 2022-02-12 21:38:18 +01:00
configs fix links to Technologic Systems web resources 2022-03-17 22:32:15 +01:00
docs Update for 2022.02 2022-03-08 23:08:11 +01:00
fs fs/common.mk: use find instead of shell glob patterns 2022-03-19 19:57:25 +01:00
linux linux: bump CIP RT kernel to version 5.10.100-cip2-rt2 2022-03-07 23:22:20 +01:00
package package/rust: install rustc and rust-std built by Buildroot 2022-03-20 18:31:24 +01:00
support support/testing: TestRust{Bin} use ripgrep package for testing 2022-03-20 18:30:05 +01:00
system system/skeleton: provide run/lock directory 2022-01-12 20:38:09 +01:00
toolchain toolchain: fix gcc bug 99140 condition 2022-02-14 21:38:27 +01:00
utils utils/checkpackagelib/lib_mk.py: check CONF_OPTS 2022-03-07 23:15:46 +01:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig
.flake8
.gitignore
.gitlab-ci.yml utils/checkpackagelib/lib_sysv: run shellcheck 2022-02-06 18:27:03 +01:00
CHANGES Update for 2022.02 2022-03-08 23:08:11 +01:00
Config.in support/download: Add SFTP support 2022-01-06 09:34:05 +01:00
Config.in.legacy package/python-pycli: drop package 2022-03-07 22:57:18 +01:00
COPYING
DEVELOPERS package/python-pycli: drop package 2022-03-07 22:57:18 +01:00
Makefile Update for 2022.02 2022-03-08 23:08:11 +01:00
Makefile.legacy
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches