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

Support platform specific dependencies #9

Merged
merged 12 commits into from
Oct 22, 2020
Merged

Conversation

wildarch
Copy link
Owner

@wildarch wildarch commented Oct 18, 2020

Add select({})s to deps attributes that select dependencies based on the rules_rust target platform matched. This allows generating a single cargo_dependencies.bzl file that can be used for any target triple.

For now we only support 64-bit Linux and Mac. Other targets should work too, but we cannot test them with the currrent CI setup.

Builds on https://github.com/SirWindfield/blackjack/pull/1 to retrieve the correct cargo executable on all platforms and pass the cargo executable and manifest paths in args.

I would like to add support for windows too (and got pretty far into supporting that), but ran into some issues with winapi, which is hard for me to debug without access to a Windows machine outside of CI.

@wildarch wildarch force-pushed the platform_specific branch 2 times, most recently from a284b08 to f2372e7 Compare October 20, 2020 21:07
@wildarch wildarch mentioned this pull request Oct 20, 2020
@wildarch wildarch marked this pull request as ready for review October 20, 2020 22:52
@wildarch
Copy link
Owner Author

@sirwindfield this approach seems to work quite well, do you think it covers your needs for #5?

@mainrs
Copy link

mainrs commented Oct 22, 2020

Looks good! What problems did you encounter when trying to add Windows?

@wildarch
Copy link
Owner Author

Looks good! What problems did you encounter when trying to add Windows?

The winapi crate was giving me some issues. I think it's just about enabling the right flag (looks like normally the build script takes care of that), but without an interactive windows environment to test I couldn't get things to build. If someone has access to a Windows machine and can get this sorted, that would be awesome 😊

@mainrs
Copy link

mainrs commented Oct 22, 2020

google/cargo-raze#41 contains a good amount of code related to special crates. Might come handy :)

@wildarch wildarch merged commit a99442e into master Oct 22, 2020
@wildarch wildarch deleted the platform_specific branch October 22, 2020 19:59
@wildarch wildarch mentioned this pull request Oct 22, 2020
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

Successfully merging this pull request may close these issues.

2 participants