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
Provide a documented way to use cargo auditable
as a drop-in replacement for cargo
#89
Comments
Cargo sets only one environment variable when calling subcommands, and that's a path to itself in the Just following that convention (and letting people set it to the real cargo when using as a drop-in replacement) sounds good. I'm not going to require that variable to be set because I'm not sure if that would break anything (especially exotic things like sccache). I think if I add another env var for ignoring unsupported platforms, we should be good. So something like this would work, if placed in #!/bin/sh
export CARGO='/path/to/real/cargo'
export CARGO_AUDITABLE_IGNORE_UNSUPPORTED=true
cargo-auditable auditable "$@" btw @figsoda @zowoq would this work for Nix? I could write this as a Rust executable as well, but I think a shell script is way easier to understand and debug - a compiled Rust binary would just be a black box. Transparency is key when you override default behavior. |
Didn't test anything out, but this should work for nix. I think a shell script in nixpkgs is good enough, no rust needed here. |
Alright, I'll implement support for these two environment variables then! |
As of commit 00030f0 the The |
Support for |
Actually you can just use |
I'm open to feedback on whether continuing the build but printing a warning when targeting an unsupported platform should just be the default. Maybe a configuration option is overkill, since this behavior is basically never desirable. |
I am not sure about the semver aspect of this, but it (warning instead of error) definitely sounds like a saner default to me |
I'll ship it as 0.6 just to be on the safe side |
This came up in the pull request about enabling
cargo auditable
in Nix by defaut.There are two hurdles here:
cargo auditable
callscargo
internally quite a lot. We need to make sure it doesn't recurse.cargo auditable
will error out in this case. This is not an option for a drop-in replacement forcargo
- we need to print a warning and keep going.The text was updated successfully, but these errors were encountered: