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

Unable to find extra-filename rustc flag #16

Open
samsartor opened this issue Jul 12, 2020 · 2 comments
Open

Unable to find extra-filename rustc flag #16

samsartor opened this issue Jul 12, 2020 · 2 comments

Comments

@samsartor
Copy link

ptx-builder is failing with "Unable to find extra-filename rustc flag" when I am building my project. When I run cargo rustc --target nvptx64-nvidia-cuda -v .. myself I get:

rustc --crate-name sidequest_core --edition=2018 core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --crate-type rlib --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no -C debuginfo=2 --crate-type cdylib -C metadata=d9bb1f26303a4731 --out-dir /side/Code/sidequest-meet/target/nvptx64-nvidia-cuda/release/deps --target nvptx64-nvidia-cuda -L dependency=/side/Code/sidequest-meet/target/nvptx64-nvidia-cuda/release/deps -L dependency=/side/Code/sidequest-meet/target/release/deps --extern fnv=/side/Code/sidequest-meet/target/nvptx64-nvidia-cuda/release/deps/libfnv-3eeaa6958d9eb02f.rlib --extern nalgebra=/side/Code/sidequest-meet/target/nvptx64-nvidia-cuda/release/deps/libnalgebra-f28e713a257293dd.rlib --extern num_traits=/side/Code/sidequest-meet/target/nvptx64-nvidia-cuda/release/deps/libnum_traits-72ce644de10ae911.rlib --extern rand=/side/Code/sidequest-meet/target/nvptx64-nvidia-cuda/release/deps/librand-c254e8c85c3e4e8a.rlib --extern rustacuda_core=/side/Code/sidequest-meet/target/nvptx64-nvidia-cuda/release/deps/librustacuda_core-f3f21a55d0150a50.rlib --extern rustacuda_derive=/side/Code/sidequest-meet/target/release/deps/librustacuda_derive-d2b9f2aba2ab89c4.so

The same happens whether or not I include "rlib" as an additional crate type.

Interestingly, all my dependencies' rustc invokations appear to be getting the "extra-filename" param. It is just the final invocation (the one ptx-builder actually cares about) which is missing extra-filename.

If needed, I can take the time to create a minimal repro for you. But I'm guessing it is simply a problem with a newer cargo version which doesn't pass the argument.

I'm running:

  • cargo 1.46.0-nightly (4f74d9b2a 2020-07-08)
  • rustc 1.46.0-nightly (346aec9b0 2020-07-11)
  • Arch BTW
@samsartor
Copy link
Author

samsartor commented Jul 12, 2020

Figured out the difference! "-C extra-filename=..." won't be passed if in my Cargo.toml I have:

[lib]
crate-type = ["cdylib", "rlib"]

Unfortunately if I remove that section, I then get error: crate [dependency] required to be available in rlib format, but was not found in this form for some of my dependencies.

@samsartor
Copy link
Author

samsartor commented Jul 13, 2020

Cargo yelling about crate [dependency] required to be available in rlib format, but was not found in this form turned out to be a bug that I can fix by setting set_var("CARGO_BUILD_PIPELINING", "false") in my build.rs.

I'm not sure if you want to handle the "crate-type" case gracefully or not so I'll leave the bug open. But if you decide it is not a problem, you can close it. I have my workaround!

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

1 participant