Skip to content

Bat scripts to work with JAVA_HOME with parentheses backport(#39712) #40768

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

Merged
merged 6 commits into from
Apr 5, 2019

Conversation

pgomulka
Copy link
Contributor

@pgomulka pgomulka commented Apr 3, 2019

the elasticsearch.bat and elasticsearch-env.bat won't work if JAVA
contains parentheses. This seems to be the limitation of FOR /F IN
(command) DO syntax.
The JAVA variable present in a command contains a path to a binary to
start elasticsearch (with spaces & parens). We can workaround the
problem of spaces and parentheses in this path by referring this
variable with a CALL command.
Note that executing binaries with CALL is an undocumented behaviour (but works)
closes #38578
closes #38624
closes #33405
closes #30606

  • Have you signed the contributor license agreement?
  • Have you followed the contributor guidelines?
  • If submitting code, have you built your formula locally prior to submission with gradle check?
  • If submitting code, is your pull request against master? Unless there is a good reason otherwise, we prefer pull requests against master and will backport as needed.
  • If submitting code, have you checked that your submission is for an OS that we support?
  • If you are submitting this code for a class then read our policy for that.

…39712)

the elasticsearch.bat and elasticsearch-env.bat won't work if JAVA
contains parentheses. This seems to be the limitation of FOR /F IN
(command) DO syntax.
The JAVA variable present in a command contains a path to a binary to
start elasticsearch (with spaces & parens). We can workaround the
problem of spaces and parentheses in this path by referring this
variable with a CALL command.
Note that executing binaries with CALL is an undocumented behaviour (but works)
closes elastic#38578
closes elastic#38624
closes elastic#33405
closes elastic#30606
@pgomulka pgomulka added :Core/Infra/Core Core issues without another label backport labels Apr 3, 2019
@pgomulka pgomulka self-assigned this Apr 3, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@pgomulka pgomulka added the >bug label Apr 3, 2019
@pgomulka pgomulka added :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts and removed :Core/Infra/Core Core issues without another label labels Apr 4, 2019
We don't always have java home defined in packaging tests, as we want to
use the bundled jdk most of the time. This commit fixes the java home
with special characters test to link to SYSTEM_JAVA_HOME on windows.

closes elastic#40797
@pgomulka pgomulka force-pushed the bp/6.7/39712-windows-java branch from 03c0ecb to ee14f7a Compare April 4, 2019 09:21
@pgomulka pgomulka merged commit da2f6be into elastic:6.7 Apr 5, 2019
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport >bug :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants