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

Reduce platform dependant selects in //tools/jdk/BUILD #12324

Closed

Conversation

comius
Copy link
Contributor

@comius comius commented Oct 21, 2020

Macro default_java_toolchain used to create a java_toolchain rule with each attribute set using a platform dependent select. For example ijar attribute was set to //tools/jdk:ijar, which was a macro remote_java_tools_filegroup. That macro contains a select choosing the right @remote_java_tools repository.

With Java toolchainisation this become a fragile mechanism (selects need to match the toolchain...), which would be hard to maintain.

In previous commits java_toolchain_default was implemented, which is part of each java_tools repository and does not use any selects.

For backward compatibility default_java_toolchain was reimplemented to invoke java_toolchain_default. Implementation is not perfect, because it load 3 java_tools repositories (linux,darwin,windows). Not to invoke this misfeature, some macros were moved into utils.bzl. The use of default_java_toolchain should be discouraged.

remote_java_tools_filegroup/import targets in //tools/jdk/BUILD that were previous used only by default_java_toolchain were removed.

default_java_toolchain targets in //tools/jdk/BUILD were replaced with select aliases. Those will be removed when Java toolchainsation is complete.

legacy_toolchain was removed as a fall-back - it was an awkard one - going from Java 11 to Java 8 language level.

@google-cla google-cla bot added the cla: yes label Oct 21, 2020
@jin jin added WIP team-Rules-Server Issues for serverside rules included with Bazel labels Oct 26, 2020
@comius comius force-pushed the remove-default-java-toolchain branch from e702e5f to 20d13f1 Compare October 27, 2020 13:34
@comius comius removed the team-Rules-Server Issues for serverside rules included with Bazel label Oct 28, 2020
@comius comius force-pushed the remove-default-java-toolchain branch from 442edca to 744897f Compare November 5, 2020 17:48
@philwo philwo removed the WIP label Nov 10, 2020
@comius comius force-pushed the remove-default-java-toolchain branch from 744897f to 7f464b0 Compare November 16, 2020 13:24
@comius comius force-pushed the remove-default-java-toolchain branch from 57e317a to 0ec9954 Compare November 19, 2020 11:15
@comius comius changed the title Remove default_java_toolchain rule. Replace uses of default_java_toolchain with java_toolchain_default. Nov 19, 2020
@comius comius changed the title Replace uses of default_java_toolchain with java_toolchain_default. Reduce platform dependant selects in //tools/jdk/BUILD Nov 19, 2020
@comius
Copy link
Contributor Author

comius commented Nov 19, 2020

Downstream tests at https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1779
Failing gerrit, because of labels used in default_java_toolchain.

@comius comius closed this Nov 27, 2020
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

3 participants