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

Add a platform agnostic release for java_tools. #8406

Closed
iirina opened this issue May 20, 2019 · 7 comments
Closed

Add a platform agnostic release for java_tools. #8406

iirina opened this issue May 20, 2019 · 7 comments
Assignees
Labels
area-java-toolchains javabase, java_toolchain flags, JDK selection, java_toolchain rules, java_tools repository P2 We'll consider working on this in future. (Assignee optional) team-Rules-Java Issues for Java rules type: feature request

Comments

@iirina
Copy link
Contributor

iirina commented May 20, 2019

Create a way to release a java_tools version (in addition to the linux, darwin and winodws versions) without including pre-built ijar and singlejar.

@iirina iirina self-assigned this May 20, 2019
@iirina iirina added team-Rules-Java Issues for Java rules P2 We'll consider working on this in future. (Assignee optional) labels May 20, 2019
@varming
Copy link

varming commented Jun 1, 2020

I ran into this issue today. Is there a workaround? Even with the parameters --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 bazel still downloads remote_java_tool_linux with the broken ijar

@comius comius self-assigned this Nov 20, 2020
@comius comius added the area-java-toolchains javabase, java_toolchain flags, JDK selection, java_toolchain rules, java_tools repository label Nov 20, 2020
@fosslinux
Copy link

Despite the commit closing this issue, I am still having issues with ijar on a non-standard system (musl). How can I force bazel to rebuild ijar now that this should be supported?

@comius
Copy link
Contributor

comius commented Dec 26, 2020

Add

load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain", "NONPREBUILT_TOOLCHAIN_CONFIGURATION")
default_java_toolchain(
   name = 'custom',
   configuration = NONPREBUILT_TOOLCHAIN_CONFIGURATION,
)

to a BUILD file and use --extra_toolchains=//:custom_definition --incompatible_use_toolchain_resolution_for_java_rules with bazel@head.

Be careful to add _definition suffix when specifying the flag.

@fosslinux I'd be glad if you confirm this is working. We don't have any non-standard systems in our test stand.

@fosslinux
Copy link

I appended that block to the root BUILD file in a checkout of this bazel repository and added that flag to the end of my bazel build command. However, it fails with:

ERROR: Traceback (most recent call last):
        File "/builddir/bazel-3.7.2/BUILD", line 241, column 87, in <toplevel>
                load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain", "NONPREBUILT_TOOLCHAIN_CONFIGURATION")
Error: file '@bazel_tools//tools/jdk:default_java_toolchain.bzl' does not contain symbol 'NONPREBUILT_TOOLCHAIN_CONFIGURATION'

Grepping through the checkout yields no results for NONPREBUILT_TOOLCHAIN_CONFIGURATION. Why is this so?

@fosslinux
Copy link

Oops, I wasn't on master. Now, this symbol is most def in tools/jdk/default_java_toolchain.bzl, but the build system still gives the same error....

@comius
Copy link
Contributor

comius commented Jan 7, 2021

For building Bazel itself it's a bit different. The NONPREBUILT_TOOLCHAIN_CONFIG is not found, because it is not part of released Bazel you're using (and this change hasn't been released yet). You can wait for it to be released or you could try bootstraping Bazel, instructions are here https://docs.bazel.build/versions/master/install-compile-source.html#bootstrap-bazel. The bootstrapping already builds everything from scratch so no modifications should be necessary.

After bootstrapping you can use the recipe for either building Bazel or something else.

@wglacier
Copy link

Add

load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain", "NONPREBUILT_TOOLCHAIN_CONFIGURATION")
default_java_toolchain(
   name = 'custom',
   configuration = NONPREBUILT_TOOLCHAIN_CONFIGURATION,
)

to a BUILD file and use --extra_toolchains=//:custom_definition --incompatible_use_toolchain_resolution_for_java_rules with bazel@head.

Be careful to add _definition suffix when specifying the flag.

@fosslinux I'd be glad if you confirm this is working. We don't have any non-standard systems in our test stand.

Hi Comius, this change worked for us on rhel6, thanks so much for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-java-toolchains javabase, java_toolchain flags, JDK selection, java_toolchain rules, java_tools repository P2 We'll consider working on this in future. (Assignee optional) team-Rules-Java Issues for Java rules type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants