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 install fails with latest on Ubuntu 22.04 #1495

Closed
fquinner opened this issue Jan 11, 2023 · 4 comments · Fixed by #1496
Closed

Cargo install fails with latest on Ubuntu 22.04 #1495

fquinner opened this issue Jan 11, 2023 · 4 comments · Fixed by #1496

Comments

@fquinner
Copy link

Cargo build fails on default Ubuntu 22.04

The Cargo / rustc version is 1.61.0.

Fails when running:

cargo install just

The failure is:

error[E0015]: cannot call non-const fn `std::sync::Mutex::<interrupt_handler::InterruptHandler>::new` in statics
  --> /home/fquinn/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/just-1.10.0/src/interrupt_handler.rs:17:48
   |
17 |     static INSTANCE: Mutex<InterruptHandler> = Mutex::new(InterruptHandler::new());
   |                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants

For more information about this error, try `rustc --explain E0015`.

And it happens for both 1.10.0 and 1.11.0 (1.9.0 works fine) if specified explicitly on cargo command line so thinking it may be related to #1442

@benmoss
Copy link
Contributor

benmoss commented Jan 11, 2023

Any reason you don't want to use Rust 1.63 or newer? Are you using the apt packages and they're still on 1.61?

@fquinner
Copy link
Author

Yeah all apt based defaults trying to keep it vanilla. No reason other than default / out of the box defaults.

@benmoss
Copy link
Contributor

benmoss commented Jan 11, 2023

I think you're out of luck, I'd use rustup to get a newer version or use a prebuilt binary

@casey
Copy link
Owner

casey commented Jan 12, 2023

I just merged #1496, which should make the error message better in the future. (@benmoss thanks for the PR!)

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

Successfully merging a pull request may close this issue.

3 participants