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

Use cargo-auditable with cross? #95

Closed
NobodyXu opened this issue Dec 11, 2022 · 6 comments
Closed

Use cargo-auditable with cross? #95

NobodyXu opened this issue Dec 11, 2022 · 6 comments

Comments

@NobodyXu
Copy link

Is it possible to use cargo auditable with cross for cross compilation?

@Shnatsel
Copy link
Member

I've used it with cargo build --target=something-other-than-native-target and it worked fine. I haven't tried it with cross specifically. Try it and let me know if it works!

@Shnatsel
Copy link
Member

FWIW sccache required some fixes to work with cargo auditable. If cross doesn't Just Work, I'm happy to accept fixes for supporting cross or to help investigate why it fails.

@NobodyXu
Copy link
Author

Running cross with cargo-auditable gives me subcommand not found error:

❯ cargo auditable cross b --release
error: no such subcommand: `cross`

        View all installed commands with `cargo --list`

While running cross b --release directly works as intended.

@Shnatsel
Copy link
Member

Yeah, that doesn't work because you're calling it cross not cargo cross.

Hmm. I think the best way forward is to file an issue on the cross issue tracker about potentially supporting cargo auditable. Basically a call to cargo auditable sets RUSTC_WORKSPACE_WRAPPER to itself, and saves the arguments it received into an environment variable so that the wrapper then recovers it. That's basically it as far as integration is concerned.

It's also possible to use cargo auditable as a drop-in replacement for cargo, that might come in handy.

@NobodyXu
Copy link
Author

Yeah, that doesn't work because you're calling it cross not cargo cross.

It seems that cargo-cross does not exist and the cross crate only provides binary cross.

@Shnatsel
Copy link
Member

We've identified 2 ways to do today in the linked Cross issue:

  1. Use a custom docker image which overrides cargo with cargo auditable
  2. Use a pre-build hook to install cargo auditable

Additionally support for Cargo subcommands is in the works in cross, which should make it even easier.

I'm going to go ahead and close this since using with cross is possible, but feel free to reopen if there's more to discuss.

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