-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Coverage spreads to nested cargo invocation #212
Comments
I don't know the details of your build script, so I can't provide any specific suggestions, but any of the following may work:
|
This doesn't help. It seems like it avoids applying RUSTFLAGS for the build.rs compilation. But the problem is actually the cargo invocation which is performed in the build.rs file and the coverage stuff seems to spreads to that command.
This seems to be the correct workaround, but it unfortunately doesn't work alone. I did some digging and it seems like even though the coverage stuff doesn't make it into That means I have found a workaround so feel free to close the issue unless you feel like the nested cargo invocation needs first class support. It is admittedly not a common use case so it is totally understandable for this to be a "wontfix". Also let me know if there's anything I can do to help out. |
Considering that |
I'm working with code running on GPUs using cuda. I'm experimenting with writing the code being run on the GPU in rust and use a buildscript (build.rs) to invoke cargo with
--target nvptx64-nvidia-cuda
. I then embed the resulting assembly (ptx) into the final executable using theinclude_str!
macro. The nvptx64 target needs to be build as a#![no_std]
target using-Zbuild-std
.It seems like the cargo invocation made in the buildscript for building the GPU assembly is also being called with the
-C instrument-coverage
flag. This is a problem as it is not supported on#![no_std]
targets. It seems to persist even when clearing theRUSTFLAGS
env variable or explicitly setting-C instrument-coverage=off
for the nested cargo invocation.Is this the preferred behavior or would it be better to require the nested cargo invocation to explicitly ask for coverage for it to be generated? Are there any known workarounds?
The text was updated successfully, but these errors were encountered: