Allow users to pick cargo for custom target builds #431
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to fix #325.
We want to use the target
x86_64-alpine-linux-musl
(available from alpine's rustc) to build musl-based binaries and when using cross with something not in the standard rustc/rustup targets, cross errors out as detailed in the issue above.For a non-standard target, cross defaults to using
xargo
right now (behavior introduced in #217), but in our case, since we wantcargo
to run ultimately, I had to also ensure that settingxargo = false
actually works from the cross config file. If there's a better way of handling this without breaking the current default behavior, please let me know.Also updated the docs on xargo usage accordingly (including the parts that were lagging even without this PR).
A working example of cross use based on the changes here are available at:
https://github.com/wayfair-tremor/tremor-runtime/blob/f72e133f971adca67f6e6b6e265a4f5d5e96380d/Cross.toml#L30-L37
Thanks for providing a tool like cross btw! It's been really useful to us as we are looking to streamline our release process 😃