-
Notifications
You must be signed in to change notification settings - Fork 319
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
fix #267, BAZELISK_NOJDK support #315
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
platforms/platforms.go
Outdated
@@ -54,7 +56,11 @@ func DetermineBazelFilename(version string, includeSuffix bool) (string, error) | |||
filenameSuffix = DetermineExecutableFilenameSuffix() | |||
} | |||
|
|||
return fmt.Sprintf("bazel-%s-%s-%s%s", version, osName, machineName, filenameSuffix), nil | |||
bazelFlavor := "bazel" | |||
if val, ok := os.LookupEnv("BAZELISK_NOJDK"); ok && (val != "0") { |
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 would be great to fall back to read it from the config as well with getEnvOrConfig :
Line 182 in 70694fe
func GetEnvOrConfig(name string) string { |
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.
done. but package core
has to be splited to break import loop
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.
I would love to get this merged early as I want to start doing some experimentation with nojdk bazel. Thanks!
@@ -77,6 +77,8 @@ As mentioned in the previous section, the `<FORK>/<VERSION>` version format allo | |||
If you want to create a fork with your own releases, you have to follow the naming conventions that we use in `bazelbuild/bazel` for the binary file names. | |||
The URL format looks like `https://github.com/<FORK>/bazel/releases/download/<VERSION>/<FILENAME>`. | |||
|
|||
If the environment variable `BAZELISK_NOJDK` is set and `!= 0`, it will use the `nojdk` version of bazel. |
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.
If the environment variable `BAZELISK_NOJDK` is set and `!= 0`, it will use the `nojdk` version of bazel. | |
If `BAZELISK_NOJDK` is set in environment variable or `.bazeliskrc` to a value that is not `"0"`, bazelisk will use the `nojdk` version of bazel. |
@@ -59,7 +62,11 @@ func DetermineBazelFilename(version string, includeSuffix bool) (string, error) | |||
filenameSuffix = DetermineExecutableFilenameSuffix() | |||
} | |||
|
|||
return fmt.Sprintf("bazel-%s-%s-%s%s", version, osName, machineName, filenameSuffix), nil | |||
bazelFlavor := "bazel" | |||
if configs.GetEnvOrConfig("BAZELISK_NOJDK") != "0" && configs.GetEnvOrConfig("BAZELISK_NOJDK") != "" { |
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.
why don't we just set the convention to that BAZELISK_NOJDK=1
is accepted, and everything else is rejected?
That would make this a lot easier to use/manage vs having to read the code to find these 2 magic values to avoid.
If we want to stay consistent with the python implementation then we would want GetEnvOrConfig here to accept a default return value in case both env and config were not set?
no longer requeried |
fix
BAZELISK_NOJDK
support