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

does not compile with latest rust toolchains. #3

Closed
bat-serjo opened this issue May 22, 2020 · 12 comments
Closed

does not compile with latest rust toolchains. #3

bat-serjo opened this issue May 22, 2020 · 12 comments

Comments

@bat-serjo
Copy link

What rust toolchain are you using to compile the project.
It failed with multiple toolchains on different packages for different reasons.

So far I've tried:
stable-x86_64-unknown-linux-gnu
nightly-2019-09-11-x86_64-unknown-linux-gnu
nightly-2019-12-11-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

NONE of these is able to compile and run the simple example:
cargo run --bin generator -- -g grammars/lua.py -t 100

@eqv
Copy link
Contributor

eqv commented May 22, 2020

If you want help, I would recommend to add some information that actually help me to understand the problem... compile errors, stacktraces...

@bat-serjo
Copy link
Author

Basically every single toolchain i've tried failed for a different reason trying to compile :)
Like so:

$ rustup toolchain list
stable-x86_64-unknown-linux-gnu
nightly-2019-09-11-x86_64-unknown-linux-gnu
nightly-2019-12-11-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

$ cargo run --bin generator -- -g grammars/lua.py -t 100
Compiling timeout-readwrite v0.3.1
Compiling parking_lot v0.10.0
Compiling clap v2.33.0
Compiling rand_chacha v0.2.2
Compiling loaded_dice v0.1.1
Compiling serde v1.0.104
Compiling paste-impl v0.1.7
Compiling indoc-impl v0.3.4
error: legacy asm! syntax is no longer supported
--> /home/serj/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot-0.10.0/src/elision.rs:77:13
|
77 | asm!("xacquire; lock; cmpxchgq $2, $1"
| ^---
| |
| help: replace with: llvm_asm!
| |
78 | | : "={rax}" (prev), "+*m" (self)
79 | | : "r" (new), "{rax}" (current)
80 | | : "memory"
81 | | : "volatile");
| |
__________________^

error: legacy asm! syntax is no longer supported
--> /home/serj/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot-0.10.0/src/elision.rs:108:13
|
108 | asm!("xrelease; lock; xaddq $2, $1"
| ^---
| |
| help: replace with: llvm_asm!
| |
109 | | : "=r" (prev), "+*m" (self)
110 | | : "0" (val.wrapping_neg())
111 | | : "memory"
112 | | : "volatile");
| |
__________________^

Compiling num-rational v0.2.4
Compiling inventory v0.1.5
error: aborting due to 2 previous errors

error: could not compile parking_lot.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed


$ rustup toolchain list
stable-x86_64-unknown-linux-gnu (default)
nightly-2019-09-11-x86_64-unknown-linux-gnu
nightly-2019-12-11-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu

$ cargo run --bin generator -- -g grammars/lua.py -t 100
Compiling lock_api v0.3.3
Compiling quote v1.0.3
Compiling doc-comment v0.3.3
Compiling num-traits v0.2.11
Compiling getrandom v0.1.14
Compiling rand v0.4.6
Compiling parking_lot_core v0.7.0
Compiling subprocess v0.1.20
Compiling time v0.1.42
error[E0554]: #![feature] may not be used on the stable release channel
--> /home/serj/.cargo/registry/src/github.com-1ecc6299db9ec823/lock_api-0.3.3/src/lib.rs:89:34
|
89 | #![cfg_attr(feature = "nightly", feature(const_fn))]
| ^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try rustc --explain E0554.
error: could not compile lock_api.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed


$ rustup toolchain list
stable-x86_64-unknown-linux-gnu
nightly-2019-09-11-x86_64-unknown-linux-gnu
nightly-2019-12-11-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu

$ cargo run --bin generator -- -g grammars/lua.py -t 100
Compiling serde_derive v1.0.104
Compiling proc-macro-hack v0.5.12
Compiling inventory-impl v0.1.5
Compiling ghost v0.1.1
Compiling snafu-derive v0.6.2
Compiling ctor v0.1.13
Compiling pyo3-derive-backend v0.9.0
Compiling tempfile v3.1.0
error[E0658]: subslice patterns are unstable
--> /home/serj/.cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-derive-backend-0.9.0/src/pyfunction.rs:194:21
|
194 | [(_, span), ..] => Err(syn::Error::new(
| ^^
|
= note: for more information, see rust-lang/rust#62254
= help: add #![feature(slice_patterns)] to the crate attributes to enable

error[E0658]: subslice patterns are unstable
--> /home/serj/.cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-derive-backend-0.9.0/src/pymethod.rs:724:14
|
724 | [py, rest @ ..] if utils::if_type_is_python(&py.ty) => (Some(py), rest),
| ^^^^^^^^^
|
= note: for more information, see rust-lang/rust#62254
= help: add #![feature(slice_patterns)] to the crate attributes to enable

error: aborting due to 2 previous errors

For more information about this error, try rustc --explain E0658.
error: could not compile pyo3-derive-backend.
warning: build failed, waiting for other jobs to finish...
error: build failed

$ git status
On branch master
Your branch is up to date with 'origin/master'.

$ git remote -v
origin https:/nautilus-fuzz/nautilus.git (fetch)
origin https:/nautilus-fuzz/nautilus.git (push)

@eqv
Copy link
Contributor

eqv commented May 23, 2020

Hmm, it's expected that Nautilus doesn't compile on stable. However, it works for me on nightly... However, the error that you had (llvm_asm) appears after I run cargo update. Are you still using the cargo.lock from the git?

@bat-serjo
Copy link
Author

bat-serjo commented May 23, 2020

Yes Cargo.lock is unchanged in fact all code is pristine as stated by git status output.
I guess this change in the toolchain is recent and if I know exact date of a viable toolchain version I should be able to compile.

@eqv
Copy link
Contributor

eqv commented May 23, 2020

I'm using:

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.43.0-nightly (442ae7f04 2020-02-06)

But this is worrysome, as this means that new users can't really use Nautilus. I will look into this.

@bat-serjo
Copy link
Author

bat-serjo commented May 23, 2020

Aieee, 2020-02-06 works like a charm!
Just note this in the readme for future users.
Rust landscape changes very often and causes such problems, at least switching versions is effortles.

@eqv
Copy link
Contributor

eqv commented May 23, 2020

No this sucks... I'm currently version bumping this, I think the 10.* version of pyo3 fixes this on the current nightly (but its broken on my old nightly). Unfortunately we don't work on stable, so at least nautilus should work on the current nightly.

@eqv
Copy link
Contributor

eqv commented May 23, 2020

Should be fixed by 774f775. If you can confirm, please close this issue.

@bat-serjo
Copy link
Author

Hmm, sorry but it still doesn't:
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

$ git log -n 3
commit 56d86bf (HEAD -> master, origin/master, origin/HEAD)
Merge: 774f775 6177fb5
Author: coco [email protected]
Date: Sat May 23 22:30:50 2020 +0200

Merge branch 'master' of github.com:nautilus-fuzz/nautilus

commit 774f775
Author: coco [email protected]
Date: Sat May 23 22:30:38 2020 +0200

version bump, should work with newest nighly rust now

commit 84a0228
Author: coco [email protected]
Date: Sat May 23 22:14:31 2020 +0200

bumped rand

$ rustc --version
rustc 1.45.0-nightly (46e85b432 2020-05-24)

$ cargo run --bin generator -- -g grammars/lua.py -t 1000
...
Compiling grammartec v0.1.0 (/opt/nautilus/grammartec)
error[E0407]: method replace_one is not a member of trait Step
--> grammartec/src/newtypes.rs:88:5
|
88 | / fn replace_one(&mut self) -> Self {
89 | | return NodeID::from(0);
90 | | }
| |_____^ not a member of trait Step

error[E0407]: method replace_zero is not a member of trait Step
--> grammartec/src/newtypes.rs:91:5
|
91 | / fn replace_zero(&mut self) -> Self {
92 | | return NodeID::from(1);
93 | | }
| |_____^ not a member of trait Step

error[E0407]: method add_one is not a member of trait Step
--> grammartec/src/newtypes.rs:94:5
|
94 | / fn add_one(&self) -> Self {
95 | | return self.add(1);
96 | | }
| |_____^ not a member of trait Step

error[E0407]: method sub_one is not a member of trait Step
--> grammartec/src/newtypes.rs:97:5
|
97 | / fn sub_one(&self) -> Self {
98 | | return NodeID(self.0 - 1);
99 | | }
| |_____^ not a member of trait Step

error[E0407]: method add_usize is not a member of trait Step
--> grammartec/src/newtypes.rs:100:5
|
100 | / fn add_usize(&self, n: usize) -> Option {
101 | | match self.0.checked_add(n) {
102 | | Some(x) => return Some(NodeID::from(x)),
103 | | None => return None,
104 | | }
105 | | }
| |_____^ not a member of trait Step

error[E0200]: the trait std::iter::Step requires an unsafe impl declaration
--> grammartec/src/newtypes.rs:79:1
|
79 | / impl Step for NodeID {
80 | | fn steps_between(start: &Self, end: &Self) -> Option {
81 | | let start_i = start.to_i();
82 | | let end_i = end.to_i();
... |
105 | | }
106 | | }
| |_^

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0200, E0407.
For more information about an error, try rustc --explain E0200.
error: could not compile grammartec.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

@eqv
Copy link
Contributor

eqv commented May 26, 2020

works for me with rustc 1.45.0-nightly (a74d1862d 2020-05-14),
It seems I can't install 2020-05-24 due to

info: latest update on 2020-05-26, rust version 1.45.0-nightly (f93bb2a50 2020-05-25)
info: skipping nightly which is missing installed component 'rls-preview'

I'll see if I can make it work with stable.. I think that are some pretty small changes

@eqv
Copy link
Contributor

eqv commented May 26, 2020

Hmm dang. Pyo3 needs nightly... so I guess It'll be a note in the readme for now...

@eqv
Copy link
Contributor

eqv commented May 26, 2020

I added a rustup-toolchain file that specifies a known good version. If you are using rustup, this should automatically pick the right version of rustc/cargo etc..

@eqv eqv closed this as completed May 26, 2020
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