-
Notifications
You must be signed in to change notification settings - Fork 104
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
Is the raze-level "target" setting still needed? #131
Comments
In the current implementation, Bazel doesn't actually play much of a role until after Cargo's knowledge (metadata, primarily) is already gone. This is why we need to know the target ahead of time. Long long ago in a distant land a tool very similar to this one simply converted the known information into a Cargo.bzl file which could be ingested by bazel and used at build time to generate the rules. This ran into a problem (which may no longer exist) around the "phases" of the build as defined by bazel. I'm not sure if the issue was a real blocker or merely me lacking enough depth in bazel's implementation and support for workspace rules. I suspect it was that cargo's notion of dependency resolution doesn't fit well into either the loading phase (where it needs to be in order to result in BUILD rules) or the analysis phase (where it needs to be in order to access bzl files[1]). This can be worked around by doing work ahead of time or pushing This is still a valid question, and I think the issue should stay open. [1] I'm not sure about this. |
rust-lang/cargo#5583, focused on distinguishing between dev deps and normal deps, target information for each dep, and crate renaming was just closed (as fixed). This information is probably sufficient to generate BUILD rules for all targets as well as generating rust_test rules. |
So is it still needed? |
I'm also confused - do I need a separate Cargo.toml for each platform I want to target? |
I don't think |
Does #212 solve for this issue? |
It seems like this should be set by Bazel itself.
The text was updated successfully, but these errors were encountered: