Commit Graph

48 Commits

Author SHA1 Message Date
Florian Eckert 6b6c74dca8 rust: add patch to fix remote filesystem issue
If the download directory is on another filesystem (NFS), then the
current implementation of bootstrapping rust fails. Because the 'syscall'
(rename) does not work on crossing filesystem boundary.

This chnage was already merged upstream to the github main rust repository.
rust-lang/rust#124975

The patch has been rebased so that it can be applied correctly.
No functional change.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-05-16 13:20:37 +02:00
Tianling Shen c1b3e0440f rust: Update to 1.78.0
- Switch back to .gz tarball
- Replace local bootstrap cache hack with upstreamed option

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-05 12:49:58 +08:00
krant 7f01006f96 rust: update to 1.77.0
- Restore patch hunk mis-deleted in dccb910
- Refresh patches
- Remove --enable-missing-tools configure option deleted in the upstream

Signed-off-by: krant <aleksey.vasilenko@gmail.com>
2024-03-26 11:45:24 +02:00
krant dccb910ae0 rust: update to 1.76.0
- Use .xz for source archive
- Refresh patches

Signed-off-by: krant <aleksey.vasilenko@gmail.com>
2024-02-25 16:14:46 +08:00
Tianling Shen 546e6eba4f rust: Update to 1.75.0
Changelog: https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html

Refreshed patches.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-01-01 11:04:28 +08:00
Tianling Shen 9f01010958 rust: unexport host sccache env variable
Users might configure their own env variables on the host, and sometimes
it can lead build failure or unexpected behavior.

Fixes: #22889

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-01-01 11:04:28 +08:00
Tianling Shen 11279e54ed rust: Update to 1.74.0
- Bumped libc to 0.2.147 to align deps.
- Refreshed patches.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-22 22:38:23 +08:00
Jeffery To 54616e7049 rust: Fix compile error for mipsel_24kc+24kf
Currently, rust fails to build for mipsel_24kc+24kf with "opcode not
supported on this processor: mips1 (mips1)" errors when building
libunwind.

Because mipsel_24kc+24kf is hard-float, a certain section of
src/llvm-project/libunwind/src/UnwindRegistersRestore.S is selected to
be compiled; the instructions in this section require MIPS II.

mipsel_24kc+24kf is compiled for MIPS32 Release 2 (MIPS32 is based on
MIPS II), but the C flags used to select this architecture were not
passed to the rust bootstrap (to be passed back to gcc).

This passes the C flags to rust bootstrap to fix this compile error.

This also adds PKG_BUILD_FLAGS:=no-mips16 as attempting to generate
MIPS16 code leads to a different compile error.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-30 13:29:33 -07:00
Jeffery To f9f1e0220f rust: Fix compile error if build dir and DL_DIR on separate filesystems
The rust bootstrap downloads files into a "tmp" directory then moves the
files into the "cache" directory using std::fs::rename. There are no
issues in the original/unpatched case as "tmp" and "cache" are
subdirectories in the build directory ($(HOST_BUILD_DIR)/build) and so
are nearly guaranteed to be on the same filesystem.

35768bf31e changed where files are
saved/cached (in $(DL_DIR)/rustc). If HOST_BUILD_DIR and DL_DIR are on
separate filesystems, then using std::fs::rename to move the files will
fail.[1]

This updates 0002-rustc-bootstrap-cache.patch to account for this case,
i.e. if std::fs::rename fails, fall back to copying the file then
removing the original.

[1]: https://github.com/openwrt/packages/pull/22457

Fixes: 35768bf31e ("rust: Cache bootstrap downloads to $(DL_DIR)/rustc")

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-30 13:29:33 -07:00
Drew Young 3d799c3eee rust: fix build with glibc, ARM and hard floats
Patch the target triple for Rust with glibc to include hard floating
point support.

The GNU target triple used elsewhere does not include hard float support,
instead `-mfloat-abi=hard` is passed separately. For Rust it must be
included in the target triple. This was already being done for musl,
this commit adds the same patching for glibc.

Without this patch Rust compilation fails with an error like this
(abbreviated to fit the line length):

    ld: error: libstd.so uses VFP register arguments, ... does not
    ld: failed to merge target specific data of file ...

Signed-off-by: Drew Young <dyoung@viridiparente.com>
2023-10-16 09:01:43 +08:00
Oskari Rauta d3b1b0d34e rust: update to 1.73.0
patches refreshed.
changelog at https://github.com/rust-lang/rust/releases/tag/1.73.0

Also added a configuration ardument and patch
from https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-lang/rust/files/1.72.0-bump-libc-deps-to-0.2.146.patch?id=515b5920046117355d88b3494c74da269ce9b30a
to provide support for building rust on musl hosts.

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>

rust: add support for musl build hosts

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
2023-10-14 11:25:14 +08:00
Jeffery To 8bf2725f9b
rust: Set release profile settings
* codegen-units, lto, opt-level - Set to values to optimize binary
  size[1].

* overflow-checks - Enabled because in release mode, integer overflows
  are defined as two's complement wrap[2]. It is highly unlikely that
  any program is intentionally relying on this behaviour; it would be
  better to panic instead of continue execution in this case.

* debug, debug-assertions, panic, rpath - Set to their default (release)
  values, to override any settings made by packages, e.g. ripgrep sets
  debug = 1[3].

[1]: https://github.com/johnthagen/min-sized-rust
[2]: https://huonw.github.io/blog/2016/04/myths-and-legends-about-integer-overflow-in-rust/
[3]: https://github.com/BurntSushi/ripgrep/blob/13.0.0/Cargo.toml#L79-L80

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:24 +08:00
Jeffery To b4ec017398
rust: Add option to use sccache
Using sccache makes recompilation of rustc and Rust packages faster.

This also makes the rust package visible in menuconfig, in order for the
sccache options to be accessible.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:24 +08:00
Jeffery To 0dfc1b508d
rust: Use make's jobserver when building packages
This allows cargo to use make's jobserver when building packages, by
marking the cargo command as recursive (with the + prefix[1]) and
setting MAKEFLAGS.

This also:

* Give cargo/x.py the build directory instead of having to change the
  current directory (and opening subshells)

* Set PKG_BUILD_PARALLEL/HOST_BUILD_PARALLEL for Rust packages to enable
  the use of make's jobserver

[1]: https://www.gnu.org/software/make/manual/html_node/POSIX-Jobserver.html

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:24 +08:00
Jeffery To 9db7284d58
rust: Consolidate cargo environment variables
This consolidates all environment variables for cargo into:

* CARGO_HOST_CONFIG_VARS / CARGO_PKG_CONFIG_VARS

  These contain all cargo-specific environment variables, i.e. without
  "common" variables like CC.

* CARGO_HOST_VARS / CARGO_PKG_VARS (renamed from CARGO_VARS)

  These contain all environment variables to be passed to cargo.

This also:

* Set the CARGO_BUILD_TARGET environment variable instead of using the
  --target command-line option

* Update Python include files to use CARGO_HOST_CONFIG_VARS /
  CARGO_PKG_CONFIG_VARS

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:23 +08:00
Jeffery To 853c9c9e86
rust: Move CARGO_HOME to $(DL_DIR)/cargo
As CARGO_HOME mainly functions as a download and source cache[1], moving
it into $(DL_DIR) allows it to persist and be reused between different
buildroots/sdks (when DL_DIR is set to a custom/external location).

[1]: https://doc.rust-lang.org/cargo/guide/cargo-home.html

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:23 +08:00
Jeffery To 5c5123f0f6
rust: Move cargo config options into environment variables
This also:

* Modify the "release" profile in place of adding the "stripped" profile

  Only the profile for target is modified; there are no file size
  constraints for host.

* For host, build with the "release" profile

* For target, build with either the "dev" or "release" profile based on
  CONFIG_DEBUG

There is no environment variable to specify the "strip" option, but
enabling this option is not necessary as the build system will already
strip binaries based on CONFIG_NO_STRIP / CONFIG_USE_STRIP /
CONFIG_USE_SSTRIP.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:23 +08:00
Jeffery To 49aaf19c65
rust: Install to $(STAGING_DIR)/host
This allows rustc/cargo/etc to be called without having to set PATH, as
$(STAGING_DIR)/host/bin is already in PATH.

This also fixes CARGO_HOME not being set during Host/Configure and
Host/Compile.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:22 +08:00
Jeffery To 855623d8cc
rust: Improve Host/Install speed
* Compress dist archives with gzip instead of xz; gzip is faster to
  compress and decompress

* Use a for loop instead of calling find to extract archives

* Use libdeflate's gzip to decompress instead of gzip

* Limit search for install scripts to top level of extracted archives

This also runs the install scripts with bash instead of sh, in
accordance with the shebang lines inside the scripts.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:22 +08:00
Jeffery To 35768bf31e
rust: Cache bootstrap downloads to $(DL_DIR)/rustc
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:22 +08:00
Jeffery To d24095b8fc
rust: Add RUST_HOST_FEATURES for host builds
Features to be enabled for host may not be the same as those for target.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:22 +08:00
Jeffery To a00dae9ed0
rust: Use build host Python
The build system already requires Python to be installed.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-11 15:50:21 +08:00
Jeffery To 37762abcb4
rust: Set rustflags by environment variable
In order to use $(RUSTC_TARGET_ARCH) in HOST_BUILD_DIR, the line to
include rust-values.mk in the Rust makefile was moved in
f489e019ac, causing it to be included
before package.mk is included.

This had the side effect of preventing "-lssp_nonshared" from being
added to RUSTC_LDFLAGS, because PKG_SSP is indirectly set by package.mk
(package.mk includes hardening.mk, hardening.mk sets PKG_SSP).

There is a deeper issue; it is the Rust package's PKG_SSP value that
causes RUSTC_LDFLAGS to be set and written to the Cargo config file. For
packages that use Rust to build, their PKG_SSP value does not affect the
linker flag.

This sets rustflags with the RUSTFLAGS environment variable, instead of
writing the value to the Cargo config file, allowing PKG_SSP from the
package being built to be used and for the package being built to modify
the rustflags used.

This also:

* Fix "-lssp_nonshared" being added to TARGET_CFLAGS instead of
  RUSTC_LDFLAGS, when CONFIG_PKG_CC_STACKPROTECTOR_STRONG is set.

* Remove the use of $(RUSTC_TARGET_ARCH) in HOST_BUILD_DIR and move the
  include line for rust-values.mk back to after package.mk.

  Since the host build directory was moved under the target build
  directory in efdbac38dc, it is no longer
  necessary to separate build directories with RUSTC_TARGET_ARCH;
  $(BUILD_DIR) already separates build directories by target.

* Add BUILDONLY:=1, as the Rust package does not build a target package.

* Install the Cargo config file as "config.toml" instead of "config", as
  this is the preferred form[1].

* Rename RUST_CFLAGS to RUSTC_CFLAGS and CONFIG_HOST_SUFFIX to
  RUSTC_HOST_SUFFIX, for consistency.

* Allow CARGO_VARS to be set before rust-values.mk is included.

[1]: https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure

Fixes: f489e019ac ("rust: compile host package per target")
Fixes: 83785a7ce0 ("rust-lang: Add the rust language support")
Fixes: https://github.com/openwrt/packages/issues/22133

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-09-18 09:30:56 +08:00
Jeffery To 985738b399
rust: Move RUST_ARCH_DEPENDS into rust-values.mk
This allows other packages access to RUST_ARCH_DEPENDS by including
rust-values.mk, instead of rust-package.mk which also sets
Build/Compile.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-09-13 04:27:11 +08:00
Tianling Shen 846ee0b9d0
rust: Update to 1.72.0
Version 1.72.0 (2023-08-24)
==========================

Language
--------
- [Replace const eval limit by a lint and add an exponential backoff warning](https://github.com/rust-lang/rust/pull/103877/)
- [expand: Change how `#![cfg(FALSE)]` behaves on crate root](https://github.com/rust-lang/rust/pull/110141/)
- [Stabilize inline asm for LoongArch64](https://github.com/rust-lang/rust/pull/111235/)
- [Uplift `clippy::undropped_manually_drops` lint](https://github.com/rust-lang/rust/pull/111530/)
- [Uplift `clippy::invalid_utf8_in_unchecked` lint](https://github.com/rust-lang/rust/pull/111543/)
- [Uplift `clippy::cast_ref_to_mut` lint](https://github.com/rust-lang/rust/pull/111567/)
- [Uplift `clippy::cmp_nan` lint](https://github.com/rust-lang/rust/pull/111818/)
- [resolve: Remove artificial import ambiguity errors](https://github.com/rust-lang/rust/pull/112086/)
- [Don't require associated types with Self: Sized bounds in `dyn Trait` objects](https://github.com/rust-lang/rust/pull/112319/)

Compiler
--------
- [Remember names of `cfg`-ed out items to mention them in diagnostics](https://github.com/rust-lang/rust/pull/109005/)
- [Support for native WASM exceptions](https://github.com/rust-lang/rust/pull/111322/)
- [Add support for NetBSD/aarch64-be (big-endian arm64).](https://github.com/rust-lang/rust/pull/111326/)
- [Write to stdout if `-` is given as output file](https://github.com/rust-lang/rust/pull/111626/)
- [Force all native libraries to be statically linked when linking a static binary](https://github.com/rust-lang/rust/pull/111698/)
- [Add Tier 3 support for `loongarch64-unknown-none*`](https://github.com/rust-lang/rust/pull/112310/)
- [Prevent `.eh_frame` from being emitted for `-C panic=abort`](https://github.com/rust-lang/rust/pull/112403/)
- [Support 128-bit enum variant in debuginfo codegen](https://github.com/rust-lang/rust/pull/112474/)
- [compiler: update solaris/illumos to enable tsan support.](https://github.com/rust-lang/rust/pull/112039/)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------
- [Document memory orderings of `thread::{park, unpark}`](https://github.com/rust-lang/rust/pull/99587/)
- [io: soften ‘at most one write attempt’ requirement in io::Write::write](https://github.com/rust-lang/rust/pull/107200/)
- [Specify behavior of HashSet::insert](https://github.com/rust-lang/rust/pull/107619/)
- [Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>`](https://github.com/rust-lang/rust/pull/111074/)
- [Update runtime guarantee for `select_nth_unstable`](https://github.com/rust-lang/rust/pull/111974/)
- [Return `Ok` on kill if process has already exited](https://github.com/rust-lang/rust/pull/112594/)
- [Implement PartialOrd for `Vec`s over different allocators](https://github.com/rust-lang/rust/pull/112632/)
- [Use 128 bits for TypeId hash](https://github.com/rust-lang/rust/pull/109953/)
- [Don't drain-on-drop in DrainFilter impls of various collections.](https://github.com/rust-lang/rust/pull/104455/)
- [Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata](https://github.com/rust-lang/rust/pull/106450/)

Rustdoc
-------
- [Allow whitespace as path separator like double colon](https://github.com/rust-lang/rust/pull/108537/)
- [Add search result item types after their name](https://github.com/rust-lang/rust/pull/110688/)
- [Search for slices and arrays by type with `[]`](https://github.com/rust-lang/rust/pull/111958/)
- [Clean up type unification and "unboxing"](https://github.com/rust-lang/rust/pull/112233/)

Stabilized APIs
---------------
- [`impl<T: Send> Sync for mpsc::Sender<T>`](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html#impl-Sync-for-Sender%3CT%3E)
- [`impl TryFrom<&OsStr> for &str`](https://doc.rust-lang.org/nightly/std/primitive.str.html#impl-TryFrom%3C%26'a+OsStr%3E-for-%26'a+str)
- [`String::leak`](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.leak)

These APIs are now stable in const contexts:

- [`CStr::from_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul)
- [`CStr::to_bytes`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul)
- [`CStr::to_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul)
- [`CStr::to_str`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul)

Cargo
-----
- Enable `-Zdoctest-in-workspace` by default. When running each documentation
  test, the working directory is set to the root directory of the package the
  test belongs to.
  [docs](https://doc.rust-lang.org/nightly/cargo/commands/cargo-test.html#working-directory-of-tests)
  [#12221](https://github.com/rust-lang/cargo/pull/12221)
  [#12288](https://github.com/rust-lang/cargo/pull/12288)
- Add support of the "default" keyword to reset previously set `build.jobs`
  parallelism back to the default.
  [#12222](https://github.com/rust-lang/cargo/pull/12222)

Compatibility Notes
-------------------
- [Alter `Display` for `Ipv6Addr` for IPv4-compatible addresses](https://github.com/rust-lang/rust/pull/112606/)
- Cargo changed feature name validation check to a hard error. The warning was
  added in Rust 1.49. These extended characters aren't allowed on crates.io, so
  this should only impact users of other registries, or people who don't publish
  to a registry.
  [#12291](https://github.com/rust-lang/cargo/pull/12291)

Refreshed patches.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-08-26 18:00:03 +08:00
Jonas Jelonek c287e98af2 rust: correct mistake in previous host-build fix
Fixes the commit 105fa3920e which was intended to make rust/host build
on aarch64 darwin working again. However, the fix contains a mistake
because it sets RUSTC_TARGET_ARCH instead of RUSTC_HOST_ARCH. Thus, the
fix doesn't work.
This properly sets the correct variable RUSTC_HOST_ARCH.

Fixes: 105fa3920e ("rust: fix host build on aarch64 darwin")
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2023-08-19 14:26:43 +08:00
Jonas Jelonek 105fa3920e rust: fix host build on aarch64 darwin
rust/host failed to compile on macOS running on Apple Silicon M1 Pro
because the host target triple is autogenerated to be
'arm64-unknown-linux-'. Rust doesn't have such a target triple, thus the
build failes because there are no pre-built artifacts for bootstrapping.

Fix this by setting RUSTC_HOST_ARCH to 'aarch64-apple-darwin' in case
our host is HOST_ARCH=arm64 and HOST_OS=darwin.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2023-08-17 09:39:24 +02:00
Tianling Shen a896412813 rust: Update to 1.71.1
Version 1.71.1 (2023-08-03)
===========================

- Fix CVE-2023-38497: Cargo did not respect the umask when extracting dependencies
- Fix bash completion for users of Rustup
- Do not show `suspicious_double_ref_op` lint when calling `borrow()`
- Fix ICE: substitute types before checking inlining compatibility
- Fix ICE: don't use `can_eq` in `derive(..)` suggestion for missing method
- Fix building Rust 1.71.0 from the source tarball

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-08-07 02:36:02 +08:00
Tianling Shen efdbac38dc rust: put host build dir to target build dir
When user runs `make clean` command, everything in `$(STAGING_DIR)`
(where we installed rust) will be removed, but `$(BUILD_DIR_HOST)`
(where we compiled rust and stored build stage) is untouched.

So when user starts a new build after that, OpenWrt buildroot will
still consider `rust` is installed already, resulting the build error
"cargo: command not found".

Fix this by moving to target build dir as well.

Fixes: f489e019ac ("rust: compile host package per target")

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-07-23 00:14:49 +08:00
Tianling Shen 971d326768 rust: Update to 1.71.0
Refreshed patches.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-07-18 04:49:50 +08:00
Orne Brocaar f489e019ac rust: compile host package per target
While the compiled binaries are intended to run on the host system, the
rust/host package does include the target matching the configured
OpenWrt target.

If using (for example) ./scripts/env to switch between different
OpenWrt configurations, this will cause issues if the different
configuration is for a different target. In such case there will be a
mismatch between the available Rust target and OpenWrt target and the
following error will be printed:

> error[E0463]: can't find crate for `core`
> note: the `XXX` target may not be installed

This fix will add the RUSTC_TARGET_ARCH as HOST_BUILD_DIR and CARGO_HOME
suffix, such that rust/host will be compiled in case an OpenWrt
configuration change causes the RUSTC_TARGET_ARCH to change.

Fixes: #21530

Signed-off-by: Orne Brocaar <info@brocaar.com>
[Applied Jeffery To's suggestion for build and install path]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-07-18 04:49:50 +08:00
Tianling Shen 7ace3bb7d6
rust: enable riscv64 support
rust natively supports riscv64 so let's enable it.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-06-07 19:17:08 +08:00
Tianling Shen ba267237e7
rust: bump libc to 0.2.146
Fixes build with musl 1.2.4.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-06-07 15:06:34 +08:00
Luca Barbato 81add12294 rust: update to 1.70.0
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2023-06-05 15:12:23 +08:00
Luca Barbato 1f9baddd43 rust: update to 1.69.0
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2023-04-21 06:09:47 +08:00
Luca Barbato 0db6a13526 rust: update to 1.68.2
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2023-04-03 02:30:53 +08:00
Oskari Rauta 49782b3db4 rust: update to 1.68.1
also add new variable CARGO_VARS to make it possible
to pass environment variables for cargo process.
This is necessary when for example, cross-compiling
netavark.

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
2023-03-31 03:35:41 +08:00
Tianling Shen bb3082a1c5 rust: fix build with glibc
Don't set musl-specific options/ldflags when using glibc.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-24 02:08:47 +08:00
Tianling Shen 09d482c3b2 rust: enable use of prebuilt llvm toolchain
llvm-bpf is not ready for generic usage, so use prebuilt llvm toolchain
provided by the rust project to speedup build (~1hour faster).

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-24 02:08:47 +08:00
Tianling Shen 65ce42c401 maturin: adapt new rust build standard
While at it, move maturin out of rust directory.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-24 02:08:47 +08:00
Tianling Shen e7016bb4bc rust: refactor build helper
Added new RustBinPackage, RustBinHostBuild wrapper.
Added new RUST_PKG_FEATURES flag.
Moved CARGO_HOME to STAGING_DIR_HOSTPKG.
Overrode default Build/Compile and Host/Compile to Cargo build.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-24 02:08:47 +08:00
Tianling Shen 473bc722ea rust: remove useless target dependencies and configuration
They are for the target build which is not supported yet, drop them.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-24 02:08:47 +08:00
Tianling Shen 513f751bcb rust: remove useless tarball package
These tarball cannot be reused, so simply drop them.

Also move cargo config to a file instead of using echo command.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-24 02:08:47 +08:00
Luca Barbato e784c54b76 rust-lang: update to 1.68.0
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2023-03-13 19:48:34 +08:00
Luca Barbato 2d3e0da711 rust-lang: Add an Host/Compile helper as well
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2023-03-10 14:24:16 +00:00
Luca Barbato 44d1d22a16 rust-lang: Apply suggestions from code review
Co-authored-by: Tianling Shen <cnsztl@gmail.com>
Signed-off-by: Luca Barbato <luca.barbato@gmail.com>
2023-03-10 14:24:16 +00:00
Luca Barbato 674bad0559 maturin: Add package
Build tool for rust-python packages.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2023-03-10 14:24:16 +00:00
Luca Barbato 83785a7ce0 rust-lang: Add the rust language support
Based on work from Donald Hoskins <grommish@gmail.com>.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2023-03-10 14:24:16 +00:00