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

Error compiling with latest nightly - asm syntax outdated #23

Closed
dunnock opened this issue Jun 1, 2020 · 4 comments
Closed

Error compiling with latest nightly - asm syntax outdated #23

dunnock opened this issue Jun 1, 2020 · 4 comments

Comments

@dunnock
Copy link

dunnock commented Jun 1, 2020

Hi, I've got following error in my project https://github.com/tari-project/validator-node/runs/722688938#step:8:234 compiling with latest nightly with clear_on_drop:0.2.3 dependency:

error: legacy asm! syntax is no longer supported
##[error]  --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/clear_on_drop-0.2.3/src/hide.rs:38:17
   |
38 |                 asm!("" : : "r" (ptr as *mut u8) : "memory");
   |                 ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                 |
   |                 help: replace with: `llvm_asm!`

error: legacy asm! syntax is no longer supported
##[error]  --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/clear_on_drop-0.2.3/src/hide.rs:47:17
   |
47 |                 asm!("" : "=*m" (ptr) : "*0" (ptr));
   |                 ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                 |
   |                 help: replace with: `llvm_asm!`
dunnock added a commit to tari-project/validator-node that referenced this issue Jun 1, 2020
Krakaw pushed a commit to tari-project/validator-node that referenced this issue Jun 1, 2020
@cesarb
Copy link
Owner

cesarb commented Jun 1, 2020

That is a strange one. Both asm!() are within a #[cfg(feature = "nightly")], so they should not break unless you set the nightly feature for this crate, but from what I could see you are not doing that. I triggered a CI run of this crate to see if after rust-lang/rust#70173 it breaks even if the asm!() is inside a #[cfg]'ed out block, but as you can see at https://travis-ci.org/github/cesarb/clear_on_drop/builds/693501576 it breaks only when the nightly feature is being used (as expected), and compiles fine without the nightly feature. I have no idea why your build is breaking, unless the dependency is coming from somewhere I didn't look, and that place is setting the nightly feature for this crate.

@dunnock
Copy link
Author

dunnock commented Jun 2, 2020

That's strange indeed, from our side setting nightly version to nightly-2020-05-07 helped... And that can be reproduced from our project but not when directly building your lib:

❯ cargo +nightly-2020-05-07-x86_64-apple-darwin build
warning: unused variable: `asset_id`
  --> cli/src/commands/assets.rs:95:28
   |
95 |             Self::Tokens { asset_id } => {
   |                            ^^^^^^^^ help: try ignoring the field: `asset_id: _`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 1.25s
❯ cargo +nightly-2020-05-30-x86_64-apple-darwin build
   Compiling proc-macro2 v1.0.17
   Compiling unicode-xid v0.2.0
...
error: legacy asm! syntax is no longer supported
   --> /Users/max/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.2.2/src/lib.rs:150:14
    |
150 |     unsafe { asm!("" : "=r"(input) : "0"(input) ) }
    |              ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |              |
    |              help: replace with: `llvm_asm!`

error: aborting due to previous error

error: could not compile `subtle`.

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

prob something sneaked into latest nightlies

@cesarb
Copy link
Owner

cesarb commented Jun 4, 2020

I changed it to use llvm_asm! (unfortunately, the new asm! cannot be used due to rust-lang/rust#72965) and released 0.2.4, could you check if it it works for you, and if it does, close this issue?

@dunnock
Copy link
Author

dunnock commented Jun 4, 2020

Hi @cesarb, many thanks that helped, it worked fine after updating! Closing this issue

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