Skip to content

Conversation

@tanishiking
Copy link
Contributor

fix #1431

Description

  • This PR enables to override JAVABIN in the wrapper script generated by scala_binary rule
  • This behavior aligns to the wrapper script generated by java_binary (sorry I couldn't find where the wrapper script for java_binary defined, but something like)
    • for java_binary: JAVABIN=${JAVABIN:-${JAVA_RUNFILES}/local_jdk/bin/java}

Motivation

please see: #1431

Copy link
Collaborator

@liucijus liucijus left a comment

Choose a reason for hiding this comment

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

Thanks, @tanishiking!

@liucijus
Copy link
Collaborator

(sorry I couldn't find where the wrapper script for `java_binary` defined, but something like)

The Java rule logic ant the wrapper template seem to be located in this package: https://github.com/bazelbuild/bazel/tree/master/src/main/java/com/google/devtools/build/lib/bazel/rules/java

Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

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

Thanks @tanishiking

@simuons simuons merged commit 4960e77 into bazel-contrib:master Oct 10, 2022
@tanishiking
Copy link
Contributor Author

The Java rule logic ant the wrapper template seem to be located in this package: https://github.com/bazelbuild/bazel/tree/master/src/main/java/com/google/devtools/build/lib/bazel/rules/java

Thanks!
Oh, looks like java_binary uses := instead of :- (where := fall back to default value for the empty input ''), but it's ok with :- assuming users won't set JAVABIN= (empty).

@tanishiking tanishiking deleted the javabin-override branch October 10, 2022 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable to override JAVABIN in the wrapper script for scala_binary rule

3 participants