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

rust-crate.eclass uses invalid TARGET (CHOST value is legal for gentoo, but not rust ) #3

Open
kentfredric opened this issue Sep 25, 2019 · 1 comment

Comments

@kentfredric
Copy link
Member

#  /usr/bin/rustc --target x86_64-pc-linux-gnu
error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

This becomes obvious when running tests for autocfg, which fail under gentoo's portage environment, but pass run in a rustup environment.

# cargo +system test -q

running 10 tests
..error[E0463]: can't find crate for `probe`
 --> <anon>:1:1
  |
1 | extern crate doesnt_exist as probe;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
.warning: trait objects without an explicit `dyn` are deprecated
 --> <anon>:1:18
  |
1 | pub type Probe = std::convert::AsRef<str>;
  |                  ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn std::convert::AsRef<str>`
  |
  = note: #[warn(bare_trait_objects)] on by default

..warning: trait objects without an explicit `dyn` are deprecated
 --> <anon>:1:18
  |
1 | pub type Probe = std::ops::Add<i32, Output = i32>;
  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn std::ops::Add<i32, Output = i32>`
  |
  = note: #[warn(bare_trait_objects)] on by default

....warning: trait objects without an explicit `dyn` are deprecated
 --> <anon>:1:18
  |
1 | pub type Probe = std::iter::Sum<i32>;
  |                  ^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn std::iter::Sum<i32>`
  |
  = note: #[warn(bare_trait_objects)] on by default

.
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out


running 5 tests
test src/lib.rs - AutoCfg::probe_path (line 238) ... ignored
test src/lib.rs - AutoCfg::probe_sysroot_crate (line 219) ... ignored
test src/lib.rs - AutoCfg::probe_trait (line 266) ... ignored
test src/lib.rs - AutoCfg::probe_type (line 295) ... ignored
test src/lib.rs -  (line 18) ... ok

test result: ok. 1 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out
# TARGET="x86_64-pc-linux-gnu" cargo +system test -q

running 10 tests
error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

warning: autocfg could not probe for `std`
.error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

warning: autocfg could not probe for `std`
warning: autocfg could not probe for `std`
error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

warning: autocfg could not probe for `std`
error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

FFerror: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

Ferror: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

warning: autocfg could not probe for `std`
error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

warning: autocfg could not probe for `std`
error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

warning: autocfg could not probe for `std`
error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

warning: autocfg could not probe for `std`
error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

.F.error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

Ferror: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

Ferror: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

warning: autocfg could not probe for `std`
error: Error loading target specification: Could not find specification for target "x86_64-pc-linux-gnu"
  |
  = help: Use `--print target-list` for a list of built-in targets

F
failures:

---- tests::probe_alloc stdout ----
thread 'tests::probe_alloc' panicked at 'assertion failed: missing ^ ac.probe_sysroot_crate("alloc")', src/tests.rs:84:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

---- tests::probe_as_ref stdout ----
thread 'tests::probe_as_ref' panicked at 'assertion failed: ac.probe_path(&as_ref)', src/tests.rs:48:5

---- tests::probe_add stdout ----
thread 'tests::probe_add' panicked at 'assertion failed: ac.probe_path(&add)', src/tests.rs:36:5

---- tests::probe_i128 stdout ----
thread 'tests::probe_i128' panicked at 'assertion failed: missing ^ ac.probe_path(&i128_path)', src/tests.rs:58:5

---- tests::probe_no_std stdout ----
thread 'tests::probe_no_std' panicked at 'assertion failed: ac.probe_type("i32")', src/tests.rs:96:5

---- tests::probe_std stdout ----
thread 'tests::probe_std' panicked at 'assertion failed: `(left == right)`
  left: `false`,
 right: `true`', src/tests.rs:77:5

---- tests::probe_sum stdout ----
thread 'tests::probe_sum' panicked at 'assertion failed: missing ^ ac.probe_path(&sum)', src/tests.rs:68:5


failures:
    tests::probe_add
    tests::probe_alloc
    tests::probe_as_ref
    tests::probe_i128
    tests::probe_no_std
    tests::probe_std
    tests::probe_sum

test result: FAILED. 3 passed; 7 failed; 0 ignored; 0 measured; 0 filtered out
# grep -B2 CHOST= /etc/portage/make.conf
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# /usr/bin/rustc --print target-list | grep x86
x86_64-apple-darwin
x86_64-fortanix-unknown-sgx
x86_64-fuchsia
x86_64-linux-android
x86_64-pc-solaris
x86_64-pc-windows-gnu
x86_64-pc-windows-msvc
x86_64-rumprun-netbsd
x86_64-sun-solaris
x86_64-unknown-cloudabi
x86_64-unknown-dragonfly
x86_64-unknown-freebsd
x86_64-unknown-haiku
x86_64-unknown-hermit
x86_64-unknown-l4re-uclibc
x86_64-unknown-linux-gnu
x86_64-unknown-linux-gnux32
x86_64-unknown-linux-musl
x86_64-unknown-netbsd
x86_64-unknown-openbsd
x86_64-unknown-redox
x86_64-unknown-uefi
# grep "export TARGET" /var/db/repos/rust-dev/eclass/rust-crate.eclass
export TARGET="${CHOST}"
export TARGET_CC="$(tc-getCC)"
# grep "[-]x TARGET" '/var/tmp/portage/dev-rust/autocfg-0.1.6/temp/environment'
declare -x TARGET="x86_64-pc-linux-gnu"
declare -x TARGET_CC="x86_64-pc-linux-gnu-gcc"
# grep HOST /usr/portage/profiles/arch/amd64/make.defaults 
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x86="i686-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
@gyakovlev
Copy link
Contributor

rust-toolchain.eclass (which is in the ::gentoo tree) has some target translation logic we could use here. it's not perfect but should prevent this I think

kentfredric added a commit to kentfredric/rust-dev-overlay that referenced this issue Sep 26, 2019
A src_test that simply "compiles" is better than no test at all,
  and a test that is known to fail, as we want *some* basic assurance
  that the code is not inherently garbage.

But currently tests fail for other reasons

Bug: kentnl-gentoo-rust#3
Package-Manager: Portage-2.3.75, Repoman-2.3.16
Signed-off-by: Kent Fredric <[email protected]>
kentfredric added a commit to kentfredric/rust-dev-overlay that referenced this issue Oct 1, 2019
A src_test that simply "compiles" is better than no test at all,
  and a test that is known to fail, as we want *some* basic assurance
  that the code is not inherently garbage.

But currently tests fail for other reasons

Bug: kentnl-gentoo-rust#3
Package-Manager: Portage-2.3.75, Repoman-2.3.16
Signed-off-by: Kent Fredric <[email protected]>
kentfredric added a commit to kentfredric/rust-dev-overlay that referenced this issue Jan 24, 2020
kentfredric added a commit to kentfredric/rust-dev-overlay that referenced this issue Jan 24, 2020
Due to changes in rust-crate for rust-toolchain, this test
can now be run.

Additionally, examples are now stripped.

Closes: kentnl-gentoo-rust#3
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Kent Fredric <[email protected]>
kentfredric added a commit to kentfredric/rust-dev-overlay that referenced this issue Jan 24, 2020
kentfredric added a commit to kentfredric/rust-dev-overlay that referenced this issue Jan 24, 2020
Due to changes in rust-crate for rust-toolchain, this test
can now be run.

Additionally, examples are now stripped.

Closes: kentnl-gentoo-rust#3
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Kent Fredric <[email protected]>
kentfredric added a commit to kentfredric/rust-dev-overlay that referenced this issue Feb 5, 2020
kentfredric added a commit to kentfredric/rust-dev-overlay that referenced this issue Feb 5, 2020
Due to changes in rust-crate for rust-toolchain, this test
can now be run.

Additionally, examples are now stripped.

Closes: kentnl-gentoo-rust#3
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Kent Fredric <[email protected]>
kentfredric added a commit that referenced this issue Mar 30, 2020
Due to changes in rust-crate for rust-toolchain, this test
can now be run.

Additionally, examples are now stripped.

Closes: #3
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Kent Fredric <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants