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

Cannot install using cargo #111

Closed
macthestack opened this issue Jan 27, 2021 · 6 comments
Closed

Cannot install using cargo #111

macthestack opened this issue Jan 27, 2021 · 6 comments

Comments

@macthestack
Copy link

I'm trying to install using cargo install trunk and cargo install trunk --git=https://github.com/thedodd/trunk on nightly rustc 1.51.0-nightly (d1aed50ab 2021-01-26) as well as stable rustc 1.49.0 (e1884a8e3 2020-12-29)

I'm getting this error (and many more):

error[E0277]: the trait bound `std::string::String: log::kv::value::ToValue` is not satisfied
  --> /home/martin/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tide-0.13.0/src/listener/failover_listener.rs:90:21
   |
90 | /                     crate::log::info!("unable to listen", {
91 | |                         listener: listener.to_string(),
92 | |                         error: e.to_string()
93 | |                     });
   | |_______________________^ the trait `log::kv::value::ToValue` is not implemented for `std::string::String`
   |
   = note: required for the cast to the object type `dyn log::kv::value::ToValue`
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

I'm on:

  Operating System: Pop!_OS 20.10
            Kernel: Linux 5.8.0-7630-generic
      Architecture: x86-64
@rakshith-ravi
Copy link
Contributor

Can confirm this happens on Ubuntu 20.10 as well with trunk on crates.io. However, building it locally seems to build fine. This seems to happen because of a tide update, I believe. Not sure. Will get time to investigate further this weekend.

@MartinKavik
Copy link
Contributor

However, building it locally seems to build fine.

Try to run cargo install with the parameter --locked (docs). It looks like just another case of rust-lang/cargo#7169

@rakshith-ravi
Copy link
Contributor

Try to run cargo install with the parameter --locked (docs). It looks like just another case of rust-lang/cargo#7169

Yup. cargo install --locked trunk seems to work well for me. @thedodd should we update the docs perhaps, to avoid confusion?

@thedodd
Copy link
Member

thedodd commented Jan 27, 2021

@macthestack thanks for the report! And @MartinKavik thanks for the quick response with the fix.

@rakshith-ravi that sounds perfect, thanks for jumping on the PR! I'll give it an eye and merge it real quick.

@macthestack before we close this issue, do you mind just verifying that @MartinKavik 's recommendation works for you as well?

@macthestack
Copy link
Author

Thanks for the responses and the fix. Yes, it works! 👍

@DzenanJupic
Copy link
Contributor

Doesn't compile using 1.51.0-nightly (04caa632d 2021-01-30)

I just tried to install trunk using cargo install trunk --locked, and got:

Cargo warnings
warning: package `arc-swap v0.4.7` in Cargo.lock is yanked in registry `crates.io`, consider running without --locked
warning: package `async-h1 v2.1.3` in Cargo.lock is yanked in registry `crates.io`, consider running without --locked
warning: package `miow v0.2.1` in Cargo.lock is yanked in registry `crates.io`, consider running without --locked
warning: package `net2 v0.2.35` in Cargo.lock is yanked in registry `crates.io`, consider running without --locked
warning: package `socket2 v0.3.15` in Cargo.lock is yanked in registry `crates.io`, consider running without --locked
Error messages
error: internal compiler error: failed to process buffered lint here
  --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/trunk-0.7.4/src/pipelines/rust_worker.rs:37:9
   |
37 |         bail!(r#"the rust web worker asset type `<link data-trunk rel="rust-worker" .../>` is not yet supported"#)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/compiler/rustc_lint/src/early.rs:384:18
   = note: this error: internal compiler error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: failed to process buffered lint here
  --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/trunk-0.7.4/src/pipelines/mod.rs:69:18
   |
69 |   ...   _ => bail!(
   |  ____________^
70 | | ...       r#"unknown <link data-trunk .../> attr value `rel="{}"`; please ensure the value is lowercase and is a supported asset type"#,
71 | | ...       rel.as_ref()
72 | | ...   ),
   | |_______^
   |
   = note: delayed at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/compiler/rustc_lint/src/early.rs:384:18
   = note: this error: internal compiler error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: failed to process buffered lint here
   --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/trunk-0.7.4/src/pipelines/mod.rs:152:21
    |
152 |             None => bail!("asset has no file name {:?}", &path),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: delayed at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/compiler/rustc_lint/src/early.rs:384:18
    = note: this error: internal compiler error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: failed to process buffered lint here
   --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/trunk-0.7.4/src/pipelines/mod.rs:156:21
    |
156 |             None => bail!("asset has no file name stem {:?}", &path),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: delayed at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/compiler/rustc_lint/src/early.rs:384:18
    = note: this error: internal compiler error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: failed to process buffered lint here
   --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/trunk-0.7.4/src/pipelines/mod.rs:160:21
    |
160 |             None => bail!("asset has no file extension {:?}", &path),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: delayed at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/compiler/rustc_lint/src/early.rs:384:18
    = note: this error: internal compiler error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:974:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.51.0-nightly (04caa632d 2021-01-30) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C panic=abort -C lto=fat -C codegen-units=1 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: failed to compile `trunk v0.7.4`, intermediate artifacts can be found at `/tmp/cargo-installF8U3nP`

After some experimenting and compiling trunk versions back till 0.4, I found out that it's actually a bug (rust-lang/rust#81531) in nightly (I guess I should have listened to the error messages). So, when someone has the nightly toolchain set as default, trunk will not compile (currently version 1.51.0).

To fix it, just run:

# If stable is not installed
# rustup toolchain install stable
cargo +stable install trunk --locked

(Btw: stable does not resolve the Cargo warnings)

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

5 participants