-
Notifications
You must be signed in to change notification settings - Fork 442
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
Links attribute #480
Links attribute #480
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Windows CI is failing - I'm guessing adding a windows condition to the openssl BUILD file which says shared libraries should be .dll
may fix it? (Also Buildifier CI is failing)
@dfreese How do you feel about the openssl example? I think it's very useful to have...
"ssh", | ||
"ssh_key_from_memory", | ||
], | ||
# LOCALLY MODIFIED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For other reviewers: These files are slightly modified from the cargo-raze generated versions, because they require attributes raze doesn't currently set. This feels like a pretty reasonable approach, as if people re-gen the git diff
will show the local modifications to re-apply (at least, until Raze supports them)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue open on cargo-raze
for what you ran into here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -165,6 +167,10 @@ _build_script_run = rule( | |||
"crate_name": attr.string( | |||
doc = "Name of the crate associated with this build script target", | |||
), | |||
"links": attr.string( | |||
default = "", | |||
doc = "The name of the native library this crate links against.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you run docs/update_docs.sh
to update the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is default = "",
necessary?
Making an attempt at fixing the windows build (using CI as I don't have a Windows machine handy). |
7a41c37
to
44e476a
Compare
@@ -165,6 +167,10 @@ _build_script_run = rule( | |||
"crate_name": attr.string( | |||
doc = "Name of the crate associated with this build script target", | |||
), | |||
"links": attr.string( | |||
default = "", | |||
doc = "The name of the native library this crate links against.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is default = "",
necessary?
examples/complex_sys/Cargo.toml
Outdated
[raze] | ||
workspace_path = "//complex_sys/raze" | ||
genmode = "Remote" | ||
incompatible_relative_workspace_path = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should not be necessary anymore. The default is true
now
44e476a
to
4c9c59e
Compare
The name of the environment variables present in the `.depenv` files for sys packages should not be inferred from the package name but from the `links` Cargo.toml attribute instead, like cargo does. For backward-compatibility reasons, we fall back to inferring the value from the name if the `links` attribute is unset.
4c9c59e
to
1ddf51f
Compare
@UebelAndre @dae @illicitonion I think I addressed your comments, PTAL! |
Thanks! |
@sitaktif Hey, sorry to ping this out of the blue, I was trying to regenerate the outputs of the |
@UebelAndre ACK - looking to fix that right now 👍 |
I opened #549 to address (assuming I understood the issue!) |
This was added to rules_rust in bazelbuild/rules_rust#480 and we started parsing out the metadata in cargo_raze in google#281 but didn't start populating it in generated BUILD files. This enables us to remove a hack in rules_rust where we try to infer the correct value for the `links` attribute if it wasn't set, based on the name, which in turn will allow us to remove the `crate_name` attribute completely.
This was added to rules_rust in bazelbuild/rules_rust#480 and we started parsing out the metadata in cargo_raze in #281 but didn't start populating it in generated BUILD files. This enables us to remove a hack in rules_rust where we try to infer the correct value for the `links` attribute if it wasn't set, based on the name, which in turn will allow us to remove the `crate_name` attribute completely.
links
attribute to our rule to allow inferring depenv environment variable names correctly.${pwd}
in the values of the depenv environment variables.This allows building packages with sys transitive dependencies (e.g. when depending on crates such as
git2
).