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

Set the Rust target platform triplet using the toolchain description #99

Closed
wants to merge 2 commits into from

Conversation

damienmg
Copy link
Collaborator

This change add a 'triplet' information to the toolchain that is
then used to specify the target platform to Rust.

This change add a 'triplet' information to the toolchain that is
then used to specify the target platform to Rust.
@acmcarther
Copy link
Collaborator

acmcarther commented Jun 14, 2018

This LGTM with a note:

At some later stage, we're going to also want to convert that triple into a fully specified set of flags and vars to make them available for final dependency resolution. This is a stage possibly separate from locking, as described in #100

An example of these details:
https://github.com/acmcarther/cargo-raze-examples/blob/8dba8be7d0ef1e71a4258a5d43c6808f884a7c7f/bazel/complicated_cargo_library/Cargo.bzl#L10-L71

This list was generated via shelling out to rustc --print=cfg --target=$TARGET and could be invoked in any manner. It shouldn't change based on the environment it is run under:
https://github.com/acmcarther/cargo-raze/blob/1a2759645ba1e69a230695d1f5d0527a9453789d/src/util.rs#L41-L50

Those details are what are required to fully resolve optional dependencies and flags.

EDIT: Docs: https://doc.rust-lang.org/reference/attributes.html#conditional-compilation

@damienmg
Copy link
Collaborator Author

@acmcarther sorry I do not follow, do you mean you want to download the dependency based on the target? The list of config in rustc is set by rustc directly and derived from the target triplet.

@damienmg
Copy link
Collaborator Author

Was there any follow-up to be taken here?

@acmcarther
Copy link
Collaborator

Sorry for the delay.

I don't have any follow up, except to ask that this PR not be submitted. I have a more specific PR that has to break this down by exec and target which should be ready in a couple of days:

https://github.com/bazelbuild/rules_rust/compare/acm-proper-platform-support#diff-90a5d7c3813ba42b7fcb679e5bb86085R293

@damienmg damienmg closed this Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants