Skip to contentSkip to conversation

kbuild: rust: remove now-unneeded `rusttest` custom sysroot handling

PATCH Applied Miguel Ojeda 2 participants 2 messages May 28, 2024 – Jul 9, 2024

Subsystems (3)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/1 kbuild: rust: remove now-unneeded `rusttest` custom sysroot handling

Since we dropped our custom alloc in commit 9d0441bab775 ("rust: alloc:
remove our fork of the alloc crate"), there is no need anymore to keep the custom sysroot hack.

Thus delete it, which makes the target way simpler and faster too.

This also means we are not using Cargo for anything at the moment, and that no download is required anymore, so update the main Makefile and the documentation accordingly.

---
 Documentation/rust/quick-start.rst | 14 ------
 Documentation/rust/testing.rst     |  5 +--
 Makefile                           |  3 +-
 rust/Makefile                      | 70 ++++--------------------------
 4 files changed, 11 insertions(+), 81 deletions(-)
Documentation/rust/quick-start.rst +0 -14
index cc3f11e0d441..5ca13be451f5 100644
@@ -164,20 +164,6 @@ can be installed manually::
 The standalone installers also come with ``clippy``.
 
 
-cargo
-*****
-
-``cargo`` is the Rust native build system. It is currently required to run
-the tests since it is used to build a custom standard library that contains
-the facilities provided by the custom ``alloc`` in the kernel. The tests can
-be run using the ``rusttest`` Make target.
-
-If ``rustup`` is being used, all the profiles already install the tool,
-thus nothing needs to be done.
-
-The standalone installers also come with ``cargo``.
-
-
 rustdoc
 *******
 
Documentation/rust/testing.rst +2 -3
index acfd0c2be48d..568b71b415a4 100644
@@ -131,9 +131,8 @@ Additionally, there are the ``#[test]`` tests. These can be run using the
 
 	make LLVM=1 rusttest
 
-This requires the kernel ``.config`` and downloads external repositories. It
-runs the ``#[test]`` tests on the host (currently) and thus is fairly limited in
-what these tests can test.
+This requires the kernel ``.config``. It runs the ``#[test]`` tests on the host
+(currently) and thus is fairly limited in what these tests can test.
 
 The Kselftests
 --------------
Makefile +1 -2
index f975b6396328..f368a9167de8 100644
@@ -507,7 +507,6 @@ RUSTDOC		= rustdoc
 RUSTFMT		= rustfmt
 CLIPPY_DRIVER	= clippy-driver
 BINDGEN		= bindgen
-CARGO		= cargo
 PAHOLE		= pahole
 RESOLVE_BTFIDS	= $(objtree)/tools/bpf/resolve_btfids/resolve_btfids
 LEX		= flex
@@ -601,7 +600,7 @@ endif
 export RUSTC_BOOTSTRAP := 1
 
 export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG
-export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN CARGO
+export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN
 export HOSTRUSTC KBUILD_HOSTRUSTFLAGS
 export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
 export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
rust/Makefile +8 -62

121 lines not on this page · raw message

base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0

Signature · 1 line
2.45.1
Applied
#1 lore raw
Quoted 5 lines · Miguel Ojeda

Since we dropped our custom alloc in commit 9d0441bab775 ("rust: alloc:
remove our fork of the alloc crate"), there is no need anymore to keep the custom sysroot hack.

Quoted 7 lines

Thus delete it, which makes the target way simpler and faster too.

This also means we are not using Cargo for anything at the moment, and that no download is required anymore, so update the main Makefile and the documentation accordingly.

Applied to rust-next.

Cheers,
Miguel