Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom rust versions are not supported #6145

Open
hgy59 opened this issue Jun 15, 2024 · 3 comments
Open

custom rust versions are not supported #6145

hgy59 opened this issue Jun 15, 2024 · 3 comments
Assignees

Comments

@hgy59
Copy link
Contributor

hgy59 commented Jun 15, 2024

As discussed in #6123 (comment) it is not possible yet, to have a specific rust version (i.e. 1.77.2, 1.78, nightly, ...) for a specific cross package.

A solution is now required, since /cross/fd_8.7.0 fails to build for hi3535 arch with rust >= 1.79.

@th0ma7
Copy link
Contributor

th0ma7 commented Jan 4, 2025

I don't believe this is the issue... The installer tries by default to install a newer version of the rust toolchain using the minimal version needed.... in this case version 1.81 so it looks for a 1.81.0-armv7l-unknown-linux-gnueabi. Such version no longer exists for armv7l since 1.77.2.

Interestingly I do have a locally compiled and accessible 1.82.0-armv7l-unknown-linux-gnueabi but it doesn't even try to use it.

The solution is probably to find a way to override this behavior to avoid the cargo call:

  ==> Cargo install rust package fd (rustc +1.81.0-armv7l-unknown-linux-gnueabi -vV)
error: toolchain '1.81.0-armv7l-unknown-linux-gnueabi' is not installable
```
So it enforces using the version already available along with using the rust armv7l build from #6364.

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 5, 2025

I don't believe this is the issue... The installer tries by default to install a newer version of the rust toolchain using the minimal version needed.... in this case version 1.81 so it looks for a 1.81.0-armv7l-unknown-linux-gnueabi. Such version no longer exists for armv7l since 1.77.2.

But when I clean the syno-hi3535-6.2.4 toolchain and build a package for hi3535-6.2.4 it installs the toolchain and rustc is version 1.83.0

===>  Installing rustc toolchain for syno-hi3535
===>  - rustup installation PATH: /spksrc/distrib/rustup
===>  - cargo installation PATH: /spksrc/distrib/cargo
===>  - default PATH: /spksrc/distrib/cargo/bin:/scripts:/usr/local/bin:/usr/bin:/bin:/usr/games
===>  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
info: downloading installer
warning: it looks like you have an existing installation of Rust at:
warning: /spksrc/distrib/cargo/bin
warning: It is recommended that rustup be the primary Rust installation.
warning: Otherwise you may have confusion unless you are careful with your PATH
warning: If you are sure that you want both rustup and your already installed Rust
warning: then please reply `y' or `yes' or set RUSTUP_INIT_SKIP_PATH_CHECK to yes
warning: or pass `-y' to ignore all ignorable checks.
error: cannot install while Rust is installed
warning: continuing (because the -y flag is set and the error is ignorable)
error: $HOME differs from euid-obtained home directory: you may be using sudo
error: $HOME directory: /home
error: euid-obtained home directory: /home/user
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
warning: Updating existing toolchain, profile choice will be ignored
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.83.0 (90b35a623 2024-11-26)


Rust is installed now. Great!

To get started you need Cargo's bin directory (/spksrc/distrib/cargo/bin) in
your PATH
environment variable. This has not been done automatically.

To configure your current shell, you need to source
the corresponding env file under /spksrc/distrib/cargo.

This is usually done by running one of the following (note the leading DOT):
. "/spksrc/distrib/cargo/env"            # For sh/bash/zsh/ash/dash/pdksh
source "/spksrc/distrib/cargo/env.fish"  # For fish
env make --no-print-directory rust_toml > /spksrc/toolchain/syno-hi3535-6.2.4/work/hi3535.toml 2>/dev/null;
===>  rustup toolchain install stable
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.83.0 (90b35a623 2024-11-26)

info: checking for self-update
===>  rustup default stable
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.83.0 (90b35a623 2024-11-26)

info: note that the toolchain 'stable-x86_64-unknown-linux-gnu' is currently in use (directory override for '/spksrc/toolchain/syno-hi3535-6.2.4')
===>  rustup target add armv7-unknown-linux-gnueabi
rustup override set stable
info: override toolchain for '/spksrc/toolchain/syno-hi3535-6.2.4' set to 'stable-x86_64-unknown-linux-gnu'
rustup target add armv7-unknown-linux-gnueabi
info: component 'rust-std' for target 'armv7-unknown-linux-gnueabi' is up to date
rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /spksrc/distrib/rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
1.77.2-x86_64-unknown-linux-gnu
1.82.0-powerpc-unknown-linux-gnuspe
1.54-x86_64-unknown-linux-gnu
1.63-x86_64-unknown-linux-gnu
1.64-x86_64-unknown-linux-gnu
qoriq
stage2-powerpc-unknown-linux-gnuspe

installed targets for active toolchain
--------------------------------------

aarch64-unknown-linux-gnu
armv5te-unknown-linux-gnueabi
armv7-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
i686-unknown-linux-gnu
powerpc-unknown-linux-gnu
x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (directory override for '/spksrc/toolchain/syno-hi3535-6.2.4')
rustc 1.83.0 (90b35a623 2024-11-26)

And when building cross/bat for hi3535 is uses rustc 1.83.0 with --target armv7-unknown-linux-gnueabi:

===>  Extracting for bat
tar -xzpf /spksrc/cross/bat/../../distrib/bat-0.24.0.tar.gz -C /spksrc/cross/bat/work-hi3535-6.2.4
===>  Patching for bat
===>  Configuring for bat
===>  - Configure ARGS:
===>  - Install prefix: /usr/local/bat
===>  Compiling for bat
===>  Installing for bat
find /spksrc/cross/bat/work-hi3535-6.2.4/install//usr/local/bat/ \! -type d -printf '%P\n' | sed 's?^target/??g' | sort > /spksrc/cross/bat/work-hi3535-6.2.4/bat.plist.tmp
  ==> Cargo install rust package bat (rustc +stable -vV)
rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu
release: 1.83.0
LLVM version: 19.1.1
cargo +stable install --path /spksrc/cross/bat/work-hi3535-6.2.4/bat-0.24.0 --root /spksrc/cross/bat/work-hi3535-6.2.4/install/usr/local/bat --target armv7-unknown-linux-gnueabi
  Installing bat v0.24.0 (/spksrc/cross/bat/work-hi3535-6.2.4/bat-0.24.0)
    Updating crates.io index

I think the mismatch is armv7l-unknown-linux-gnueabi vs. armv7-unknown-linux-gnueabi vs. armv7-unknown-linux-gnueabihf

IMHO we do need armv7l-*-gnueabi but armv7-*-gnueabi and the difference between ARMv7L and ARMv7 is gnueabi vs gnueabihf and not armv7l vs. armv7.

IMPORTANT NOTE:
ARMv7L does not mean armv7l.

All DSM 32bit arm archs have uname -m = armv7l (ARMv7_ARCHS and I guess ARMv7L_ARCHS too).

@th0ma7
Copy link
Contributor

th0ma7 commented Jan 5, 2025

I think the mismatch is armv7l-unknown-linux-gnueabi vs. armv7-unknown-linux-gnueabi vs. armv7-unknown-linux-gnueabihf

Indeed, that could well be it... in spksrc.cross-rust-env.mk we have:

ifeq ($(findstring $(RUST_ARCH), $(ARMv7_ARCHS)),$(RUST_ARCH))
RUST_TARGET = armv7-unknown-linux-gnueabihf
endif
ifeq ($(findstring $(RUST_ARCH), $(ARMv7L_ARCHS)),$(RUST_ARCH))
RUST_TARGET = armv7-unknown-linux-gnueabi
endif

So from fd error, should hi3535 be using armv7-unknown-linux-gnueabi instead?

===>  Installing for fd
find /home/spksrc/rust-arm/spksrc/cross/fd_8.7.0/work-hi3535-6.2.4/install//usr/local/fd/ \! -type d -printf '%P\n' | sed 's?^target/??g' | sort > /home/spksrc/rust-arm/spksrc/cross/fd_8.7.0/work-hi3535-6.2.4/fd.plist.tmp
  ==> Cargo install rust package fd (rustc +1.81.0-armv7l-unknown-linux-gnueabi -vV)
error: toolchain '1.81.0-armv7l-unknown-linux-gnueabi' is not installable

IMHO we do need armv7l-*-gnueabi but armv7-*-gnueabi and the difference between ARMv7L and ARMv7 is gnueabi vs gnueabihf and not armv7l vs. armv7.

IMPORTANT NOTE: ARMv7L does not mean armv7l.

All DSM 32bit arm archs have uname -m = armv7l (ARMv7_ARCHS and I guess ARMv7L_ARCHS too).

EDIT: and armv7l-unknown-linux-gnueabi does not exists https://rust-lang.github.io/rustup-components-history/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants