Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

MIRAI installation error #1137

Closed
ya0guang opened this issue Mar 15, 2022 · 1 comment · Fixed by #1139
Closed

MIRAI installation error #1137

ya0guang opened this issue Mar 15, 2022 · 1 comment · Fixed by #1139

Comments

@ya0guang
Copy link
Contributor

ya0guang commented Mar 15, 2022

Issue

Error occurs while running cargo install --path ./checker.

Steps to Reproduce

Install MIRAI normally on Ubuntu 20.04 following the document.

Expected Behavior

Successful installation.

Actual Results

Error message:

   Compiling parking_lot v0.11.2
error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.8/src/atomic.rs:314:6
    |
314 | impl<T: ?Sized + Pointable> Atomic<T> {
    |      ^
...
346 |     pub const fn null() -> Atomic<T> {
    |     -------------------------------- function declared as const here
    |
    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

   Compiling petgraph v0.6.0
   Compiling clap v3.1.6
For more information about this error, try `rustc --explain E0658`.
error: could not compile `crossbeam-epoch` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `mirai v1.1.0 (/MIRAI/checker)`, intermediate artifacts can be found at `/MIRAI/target`

Root Cause

In Cargo install, Cargo fetches the latest versions of the components, which means the locked components (in Cargo.lock) will not be used, and therefore the updates in dependent components may lead to malfunction or error.

In this error, crossbeam-epoch just update to 0.9.8 today, where a recent commit requires up-to-date rust nightly toolchain.

Quick Fix

use cargo install --locked --path ./checker instead.

Fix

Fixing this error can be easy: updating Rust toolchain. However, when I update it, rusts complains because of changes in ``rustc_target::abi::Layout`. I'll also try to fix them.

Nevertheless, I believe it would be better to manage the dependencies in a more elegant way. Currently the working versions are all in the lock file, however the toml file records nearly all dependencies versions as *. Maybe we can stabilize the compatible versions in that toml file.

@hermanventer
Copy link
Contributor

hermanventer commented Mar 18, 2022

I suspect that the "quick fix" is actually also the right fix. I'm more than a little bit surprised that it is not the default. I'll update the documentation accordingly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants