Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

"Can't find crate forrustc_*" when cross-compiling a crate withrustc_private on #3255

Closed as not planned
Labels
@momvart

Description

@momvart

Problem

In our project, we are usingrustc components. When building for ax86_64 target it's fine. However, when setting the target toi686-unknown-linux-gnu, cargo (rustc) starts complaining about components not existing.

I think this is a problem due to components installation throughrustup. It doesn't look to be installing them for the specified target.

The initial install is done through the following command.

$> rustup toolchain install nightly-2023-01-26 --target i686-unknown-linux-gnu --component rust-src rustc-dev llvm-tools-preview info: syncing channel updates for 'nightly-2023-01-26-x86_64-unknown-linux-gnu'info: latest update on 2023-01-26, rust version 1.69.0-nightly (c18a5e8a5 2023-01-25)info: downloading component 'cargo'info: downloading component 'clippy'info: downloading component 'llvm-tools'info: downloading component 'rust-docs'info: downloading component 'rust-src'info: downloading component 'rust-std' for 'i686-unknown-linux-gnu'info: downloading component 'rust-std'info: downloading component 'rustc' 68.3 MiB /  68.3 MiB (100 %)  45.8 MiB/s in  1s ETA:  0sinfo: downloading component 'rustc-dev'111.1 MiB / 111.1 MiB (100 %)  44.5 MiB/s in  2s ETA:  0sinfo: downloading component 'rustfmt'info: installing component 'cargo'info: installing component 'clippy'info: installing component 'llvm-tools' 32.8 MiB /  32.8 MiB (100 %)  23.6 MiB/s in  1s ETA:  0sinfo: installing component 'rust-docs' 19.4 MiB /  19.4 MiB (100 %)  17.7 MiB/s in  1s ETA:  0sinfo: installing component 'rust-src'info: installing component 'rust-std' for 'i686-unknown-linux-gnu' 28.1 MiB /  28.1 MiB (100 %)  20.7 MiB/s in  1s ETA:  0sinfo: installing component 'rust-std' 30.1 MiB /  30.1 MiB (100 %)  20.5 MiB/s in  1s ETA:  0sinfo: installing component 'rustc' 68.3 MiB /  68.3 MiB (100 %)  23.2 MiB/s in  2s ETA:  0sinfo: installing component 'rustc-dev'111.1 MiB / 111.1 MiB (100 %)  21.6 MiB/s in  5s ETA:  0sinfo: installing component 'rustfmt'  nightly-2023-01-26-x86_64-unknown-linux-gnu installed - rustc 1.69.0-nightly (c18a5e8a5 2023-01-25)

However, during building rustup complaints as follows.

$> cargo build --target=i686-unknown-linux-gnu...error[E0463]: can't find crate for `rustc_middle`  --> compiler/src/lib.rs:19:1   |19 | extern crate rustc_middle;   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate   |   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

Trying to install components again raises a conflict issue.

$> rustup component add --target i686-unknown-linux-gnu rust-src rustc-dev llvm-tools-preview  info: component 'rust-src' is up to dateinfo: downloading component 'rustc-dev' for 'i686-unknown-linux-gnu'info: installing component 'rustc-dev' for 'i686-unknown-linux-gnu'128.4 MiB / 128.4 MiB (100 %)  21.6 MiB/s in  5s ETA:  0sinfo: rolling back changeserror: failed to install component: 'rustc-dev-i686-unknown-linux-gnu', detected conflict: 'lib/rustlib/rustc-src/rust/Cargo.lock'

Originally, we are usingrust-toolchain.toml to define the components and targets. In both cases, these issues exist. Also tried installing it side by side thex86_64 target and the same issue exists.

Steps

  1. Create a project usingrustc components.
  2. Create arust-toolchain.toml to override the toolchain and define components and targets as follows.
[toolchain]channel ="nightly-2023-01-26"components = ["rust-src","rustc-dev","llvm-tools-preview"]targets = ["i686-unknown-linux-gnu"]
  1. Build usingcargo build --target=i686-unknown-linux-gnu.

Possible Solution(s)

No response

Notes

No response

Rustup version

rustup 1.25.2 (17db695f1 2023-02-01)

Installed toolchains

Default host: x86_64-unknown-linux-gnurustup home:  ...installed toolchains--------------------stable-x86_64-unknown-linux-gnunightly-2023-01-26-x86_64-unknown-linux-gnunightly-x86_64-unknown-linux-gnu (default)installed targets for active toolchain--------------------------------------i686-unknown-linux-gnux86_64-unknown-linux-gnuactive toolchain----------------nightly-2023-01-26-x86_64-unknown-linux-gnu (overridden by '.../rust-toolchain.toml')rustc 1.69.0-nightly (c18a5e8a5 2023-01-25)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp