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

Migrate to the modern linker input API. #463

Merged
merged 3 commits into from
Nov 5, 2020

Conversation

benjaminp
Copy link
Contributor

@google-cla google-cla bot added the cla: yes label Oct 23, 2020
Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Do you know what the minimum version of Bazel this supports is?

@benjaminp
Copy link
Contributor Author

3.0.0

@dfreese
Copy link
Collaborator

dfreese commented Oct 23, 2020

docs/index.md mentions 0.26.0, so that should probably be updated. I don't have a good way of verifying 0.26.0 still works.

@UebelAndre
Copy link
Collaborator

Does anyone know what it would take to remove legacy_cc_starlark_api_shim.bzl ?

@benjaminp
Copy link
Contributor Author

It should probably just be renamed or inlined into the callers as desired.

@UebelAndre
Copy link
Collaborator

So this pull request addresses the usage of any legacy/deprecated behavior in this file?

@benjaminp
Copy link
Contributor Author

Yes.

@UebelAndre
Copy link
Collaborator

Would it make sense to move those methods into rust/private/utils.bzl then?

@benjaminp
Copy link
Contributor Author

Probably. I can do that in this PR if you like.

@UebelAndre
Copy link
Collaborator

I think that'd be a nice improvement but I leave it up to @illicitonion and @dfreese 😃

@UebelAndre
Copy link
Collaborator

UebelAndre commented Oct 30, 2020

Pinging this PR. It'd be nice to be able clean up those legacy files

@UebelAndre
Copy link
Collaborator

@damienmg do you have time during your day today to check this out?
@benjaminp If the "legacy" aspect of the modified files no longer applies, could you move the code to rust/private/utils.bzl?

docs/index.md Show resolved Hide resolved
@@ -11,8 +11,8 @@ def get_libs_for_static_executable(dep):
Returns:
depset: A depset[File]
"""
libraries_to_link = dep[CcInfo].linking_context.libraries_to_link
return depset([_get_preferred_artifact(lib) for lib in libraries_to_link.to_list()])
linker_inputs = dep[CcInfo].linking_context.linker_inputs.to_list()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you delete this file and move the contents into util.bzl?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We should probably try to set up CI running the claimed minimum supported version at some point, but that's definitely not a matter for this PR :)

Over to @damienmg to merge!

@damienmg
Copy link
Collaborator

damienmg commented Nov 5, 2020

LGTM

We should probably try to set up CI running the claimed minimum supported version at some point, but that's definitely not a matter for this PR :)

Yes unfortunately this is a large task as the bazel CI is unlikely to do so. Also Bazel 4 is supposed to be a LTS and I would expect they would test rules with LTS for the support duration of the LTS. At which point the minimal version should always probably be the oldest LTS still supported.

Over to @damienmg to merge!

Done 👍
Thanks for the contributions!

@damienmg
Copy link
Collaborator

damienmg commented Nov 5, 2020

Sorry for merging, I spoke too fast. We need to wait a bit more to see if the rebasing worked.

@damienmg damienmg merged commit 107e432 into bazelbuild:master Nov 5, 2020
@benjaminp benjaminp deleted the modern-linking branch November 5, 2020 13:25
@UebelAndre UebelAndre mentioned this pull request Nov 10, 2020
wchargin added a commit to tensorflow/tensorboard that referenced this pull request Nov 10, 2020
Summary:
We pull in bazelbuild/rules_rust#468 to make it easier to build protos,
while not pulling in bazelbuild/rules_rust#463, because that would
require us to update Bazel to 3.0.0. Happily, the commit that we need
merged immediately before the commit that we don’t want! (Yes, this is a
wee bit precarious; we’re working on the Bazel upgrade: #4277.)

Test Plan:
With both Bazel 2.1.0 and Bazel 3.7.0, everything builds, all tests
pass, and TensorBoard looks okay enough.

wchargin-branch: rules-rust-20201105a
wchargin-source: bb3180a3a2a415d800d6a2a925fef0cb4e376d2f
wchargin added a commit to tensorflow/tensorboard that referenced this pull request Nov 10, 2020
Summary:
We pull in bazelbuild/rules_rust#468 to make it easier to build protos,
while not pulling in bazelbuild/rules_rust#463, because that would
require us to update Bazel to 3.0.0. Happily, the commit that we need
merged immediately before the commit that we don’t want! (Yes, this is a
wee bit precarious; we’re working on the Bazel upgrade: #4277.)

Test Plan:
With both Bazel 2.1.0 and Bazel 3.7.0, everything builds, all tests
pass, and TensorBoard looks okay enough.

wchargin-branch: rules-rust-20201105a
dfreese pushed a commit to dfreese/rules_rust that referenced this pull request Nov 11, 2020
Brought up in the discussion of bazelbuild#463, was that testing against multiple
bazel versions with bazelci didn't seem possible without a fair bit of
work.

Judging based on usage that I have seen, we probably moved too quickly
on bumping the minimum version to 3.0.0, but until we can actually test
against our minimum version, we won't be able to reasonably version
breaking changes as suggested by bazelbuild#415.

This initial PR leaves a lot of on the table in terms of potential
optimizations, and is fixed on Ubuntu 20.04 LTS for the moment.
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.

None yet

5 participants