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

cargo build panic 'target' specifier cannot be used without an 'artifact = …' #10634

Closed
llde opened this issue May 5, 2022 · 2 comments
Closed
Labels
C-bug Category: bug Z-bindeps Nightly: binary artifact dependencies

Comments

@llde
Copy link

llde commented May 5, 2022

Problem

Hi,

I get this error
thread 'main' panicked at 'called Result::unwrap()on anErr value: 'target' specifier cannot be used without an 'artifact = …' value (web-sys)', src/tools/cargo/src/cargo/util/toml/mod.rs:1553:14
when I try to compile a project that have some git dependancies. When using the same dependancy from crates all works.
I needed some modification in some dependancies for a program I was working on, so used them with git.

The current behaviour started with
rust 1.61 nightly nightly-2022-04-01-x86_64-unknown-linux-gnu
the version between nightly-2022-02-24-x86_64-unknown-linux-gnu and nightly-2022-03-31-x86_64-unknown-linux-gnu had another error:

error: no matching package named `roctogen` found
location searched: https://github.com/llde/roctogen

roctogen seem the only package affected, not the other packages linked with a git dependancy.

Last nightly version that worked was 2022-02-23

Steps

1.) Create a new project.
2.) use this Cargo.toml manifest: https://gist.github.com/llde/a8d7f437a725534a4a802da6148c715e
3.)cargo build
See the panic happen.
This is a minimal reproducer, with roctogen.

Possible Solution(s)

No response

Notes

Backtrace:
Stack backtrace:

   0: <anyhow::Error>::msg::<alloc::string::String>
   1: <cargo::util::toml::DetailedTomlDependency>::to_dependency
   2: <cargo::util::toml::TomlManifest>::to_real_manifest::process_dependencies
   3: <cargo::util::toml::TomlManifest>::to_real_manifest
   4: cargo::util::toml::read_manifest_from_str
   5: cargo::util::toml::read_manifest
   6: cargo::ops::cargo_read_manifest::read_nested_packages
   7: cargo::ops::cargo_read_manifest::walk
   8: cargo::ops::cargo_read_manifest::read_packages
   9: <cargo::sources::path::PathSource>::read_packages
  10: <cargo::sources::path::PathSource>::update
  11: <cargo::sources::git::source::GitSource as cargo::core::source::Source>::block_until_ready
  12: <cargo::core::registry::PackageRegistry as cargo::core::registry::Registry>::block_until_ready
  13: <cargo::core::registry::PackageRegistry>::ensure_loaded
  14: <cargo::core::registry::PackageRegistry as cargo::core::registry::Registry>::query
  15: <cargo::core::resolver::dep_cache::RegistryQueryer>::query
  16: <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps::{closure#0}
  17: <alloc::vec::Vec<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)> as alloc::vec::spec_from_iter::SpecFromIter<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>), core::iter::adapters::GenericShunt<core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>, <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps::{closure#0}>, core::result::Result<core::convert::Infallible, anyhow::Error>>>>::from_iter
  18: core::iter::adapters::try_process::<core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>, <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps::{closure#0}>, (cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>), core::result::Result<core::convert::Infallible, anyhow::Error>, <core::result::Result<alloc::vec::Vec<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>, anyhow::Error> as core::iter::traits::collect::FromIterator<core::result::Result<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>), anyhow::Error>>>::from_iter<core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>, <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps::{closure#0}>>::{closure#0}, alloc::vec::Vec<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>>
  19: <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps
  20: cargo::core::resolver::activate
  21: cargo::core::resolver::activate_deps_loop
  22: cargo::core::resolver::resolve
  23: cargo::ops::resolve::resolve_with_previous
  24: cargo::ops::resolve::resolve_with_registry
  25: cargo::ops::resolve::resolve_ws_with_opts
  26: cargo::ops::cargo_compile::create_bcx
  27: cargo::ops::cargo_compile::compile_ws
  28: cargo::ops::cargo_compile::compile
  29: cargo::commands::build::exec
  30: cargo::cli::main
  31: cargo::main
  32: std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  33: std::rt::lang_start::<()>::{closure#0}
  34: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/core/src/ops/function.rs:259:13
  35: std::panicking::try::do_call
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/std/src/panicking.rs:492:40
  36: std::panicking::try
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/std/src/panicking.rs:456:19
  37: std::panic::catch_unwind
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/std/src/panic.rs:137:14
  38: std::rt::lang_start_internal::{{closure}}
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/std/src/rt.rs:128:48
  39: std::panicking::try::do_call
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/std/src/panicking.rs:492:40
  40: std::panicking::try
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/std/src/panicking.rs:456:19
  41: std::panic::catch_unwind
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/std/src/panic.rs:137:14
  42: std::rt::lang_start_internal
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/std/src/rt.rs:128:20
  43: main
  44: __libc_start_call_main
  45: __libc_start_main@GLIBC_2.2.5
  46: <unknown>', src/tools/cargo/src/cargo/util/toml/mod.rs:1553:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/core/src/panicking.rs:143:14
   2: core::result::unwrap_failed
             at /rustc/0677edc86e342f333d4828b0ee1ef395a4e70fe5/library/core/src/result.rs:1785:5
   3: <core::result::Result<core::option::Option<alloc::collections::btree::map::BTreeMap<alloc::string::String, cargo::util::toml::TomlDependency>>, anyhow::Error>>::unwrap
   4: <cargo::util::toml::TomlManifest>::to_real_manifest
   5: cargo::util::toml::read_manifest_from_str
   6: cargo::util::toml::read_manifest
   7: cargo::ops::cargo_read_manifest::read_nested_packages
   8: cargo::ops::cargo_read_manifest::walk
   9: cargo::ops::cargo_read_manifest::read_packages
  10: <cargo::sources::path::PathSource>::read_packages
  11: <cargo::sources::path::PathSource>::update
  12: <cargo::sources::git::source::GitSource as cargo::core::source::Source>::block_until_ready
  13: <cargo::core::registry::PackageRegistry as cargo::core::registry::Registry>::block_until_ready
  14: <cargo::core::registry::PackageRegistry>::ensure_loaded
  15: <cargo::core::registry::PackageRegistry as cargo::core::registry::Registry>::query
  16: <cargo::core::resolver::dep_cache::RegistryQueryer>::query
  17: <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps::{closure#0}
  18: <alloc::vec::Vec<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)> as alloc::vec::spec_from_iter::SpecFromIter<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>), core::iter::adapters::GenericShunt<core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>, <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps::{closure#0}>, core::result::Result<core::convert::Infallible, anyhow::Error>>>>::from_iter
  19: core::iter::adapters::try_process::<core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>, <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps::{closure#0}>, (cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>), core::result::Result<core::convert::Infallible, anyhow::Error>, <core::result::Result<alloc::vec::Vec<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>, anyhow::Error> as core::iter::traits::collect::FromIterator<core::result::Result<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>), anyhow::Error>>>::from_iter<core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>, <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps::{closure#0}>>::{closure#0}, alloc::vec::Vec<(cargo::core::dependency::Dependency, alloc::rc::Rc<alloc::vec::Vec<cargo::core::summary::Summary>>, alloc::rc::Rc<alloc::collections::btree::set::BTreeSet<cargo::util::interning::InternedString>>)>>
  20: <cargo::core::resolver::dep_cache::RegistryQueryer>::build_deps
  21: cargo::core::resolver::activate
  22: cargo::core::resolver::activate_deps_loop
  23: cargo::core::resolver::resolve
  24: cargo::ops::resolve::resolve_with_previous
  25: cargo::ops::resolve::resolve_with_registry
  26: cargo::ops::resolve::resolve_ws_with_opts
  27: cargo::ops::cargo_compile::create_bcx
  28: cargo::ops::cargo_compile::compile_ws
  29: cargo::ops::cargo_compile::compile
  30: cargo::commands::build::exec
  31: cargo::cli::main
  32: cargo::main

Version

First version that show the current behaviour (from nightly-2022-04-01-x86_64-unknown-linux-gnu):
cargo 1.61.0-nightly (1ef1e0a 2022-03-31)
release: 1.61.0-nightly
commit-hash: 1ef1e0a12723ce9548d7da2b63119de9002bead8
commit-date: 2022-03-31
host: x86_64-unknown-linux-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1m)
os: Arch Linux Rolling Release [64-bit]

Last version that show the "no matching package named" behaviour (from nightly-2022-03-31-x86_64-unknown-linux-gnu):
cargo 1.61.0-nightly (109bfbd 2022-03-17)
release: 1.61.0-nightly
commit-hash: 109bfbd055325ef87a6e7f63d67da7e838f8300b
commit-date: 2022-03-17
host: x86_64-unknown-linux-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1m)
os: Arch Linux Rolling Release [64-bit]

First version that showed the "no matching package named" (from nightly-2022-02-24-x86_64-unknown-linux-gnu):
cargo 1.61.0-nightly (d6cdde5 2022-02-22)
release: 1.61.0-nightly
commit-hash: d6cdde584a1f15ea086bae922e20fd27f7165431
commit-date: 2022-02-22
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1m)
os: Arch Linux Rolling Release [64-bit]

Last working version: 
cargo 1.61.0-nightly (ea2a21c 2022-02-15)
release: 1.61.0-nightly
commit-hash: ea2a21c994ca1e4d4c49412827b3cf4dcb158b1d
commit-date: 2022-02-15
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1m)
os: Arch Linux Rolling Release [64-bit]
@llde llde added the C-bug Category: bug label May 5, 2022
@ehuss ehuss added the Z-bindeps Nightly: binary artifact dependencies label May 5, 2022
@Aaron1011
Copy link
Member

This is no longer panicking on the latest nightly

@ehuss
Copy link
Contributor

ehuss commented Nov 7, 2023

I'm going to close as fixed. The reproducer is no longer available, and I'm not sure how exactly to reproduce it. Regardless, I think this was a consequence of some intermediate work being done with #10497 that was resolved in some subsequent PRs.

@ehuss ehuss closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Z-bindeps Nightly: binary artifact dependencies
Projects
None yet
Development

No branches or pull requests

3 participants