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

Lazy configure build tasks that require older JDKs #29519

Merged
merged 3 commits into from
Apr 14, 2018

Conversation

jasontedor
Copy link
Member

@jasontedor jasontedor commented Apr 14, 2018

Some build tasks require older JDKs. For example, the BWC build tasks for older versions of Elasticsearch require older JDKs. It is onerous to require these be configured when merely compiling Elasticsearch, the requirement that they be strictly set to appropriate values should only be enforced if these tasks are going to be executed. To address this, we lazy configure these tasks.

Relates #29493

Some build tasks require older JDKs. For example, the BWC build tasks
for older versions of Elasticsearch require older JDKs. It is onerous to
require these be configured when merely compiling Elasticsearch, the
requirement that they be strictly set to appropriate values should only
be enforced if these tasks are going to be executed. To address this, we
lazy configure these tasks.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

} else {
javaHome = project.compilerJavaHome
env = ['JAVA_HOME':project.runtimeJavaHome]
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a mistake from #29493; this should have remained as RUNTIME_JAVA_HOME.

@rjernst
Copy link
Member

rjernst commented Apr 14, 2018

It might be nicer to start using gradles new Property classes (or Provider, I can't remember exactly what they called them), instead of using closures to delay evaluating in a string. Also, it would be nice to still fail to configure if these env vars are not available when the relevant task will be run. For this, we can check if the relevant task is in the task graph after it is constructed, and then verify the envs. I'm happy to do both of these as follow ups.

LGTM

@jasontedor
Copy link
Member Author

It might be nicer to start using gradles new Property classes (or Provider, I can't remember exactly what they called them), instead of using closures to delay evaluating in a string.

Provider.

Also, it would be nice to still fail to configure if these env vars are not available when the relevant task will be run. For this, we can check if the relevant task is in the task graph after it is constructed, and then verify the envs.

+1

@jasontedor jasontedor merged commit b883e12 into elastic:master Apr 14, 2018
jasontedor added a commit that referenced this pull request Apr 14, 2018
Some build tasks require older JDKs. For example, the BWC build tasks
for older versions of Elasticsearch require older JDKs. It is onerous to
require these be configured when merely compiling Elasticsearch, the
requirement that they be strictly set to appropriate values should only
be enforced if these tasks are going to be executed. To address this, we
lazy configure these tasks.
@jasontedor jasontedor deleted the lazy-bwc-java-home-checks branch April 14, 2018 19:48
jasontedor added a commit that referenced this pull request Apr 16, 2018
* 6.x:
  [TEST] REST client request without leading '/' (#29471)
  Prevent accidental changes of default values (#29528)
  [Docs] Add definitions to glossary  (#29127)
  Avoid self-deadlock in the translog (#29520)
  Minor cleanup in NodeInfo.groovy
  Lazy configure build tasks that require older JDKs (#29519)
  Fix usage of NodeInfo#nodeVersion in build
  Control max size/count of warning headers (#28427) (#29516)
  Simplify snapshot check in root build file
  Make NodeInfo#nodeVersion strongly-typed as Version (#29515)
  Enable license header exclusions (#29379)
  Use proper Java version for BWC builds (#29493)
  Mute TranslogTests#testFatalIOExceptionsWhileWritingConcurrently
jasontedor added a commit that referenced this pull request Apr 16, 2018
* master:
  [TEST] REST client request without leading '/' (#29471)
  Using ObjectParser in UpdateRequest (#29293)
  Prevent accidental changes of default values (#29528)
  [Docs] Add definitions to glossary  (#29127)
  Avoid self-deadlock in the translog (#29520)
  Minor cleanup in NodeInfo.groovy
  Lazy configure build tasks that require older JDKs (#29519)
  Simplify snapshot check in root build file
  Make NodeInfo#nodeVersion strongly-typed as Version (#29515)
  Enable license header exclusions (#29379)
  Use proper Java version for BWC builds (#29493)
  Mute TranslogTests#testFatalIOExceptionsWhileWritingConcurrently
  Enable skipping fetching latest for BWC builds (#29497)
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 16, 2018
This commit moves the checks on JAVAX_HOME (where X is the java version
number) existing to the end of gradle's configuration phase, and based
on whether the tasks needing the java home are configured to execute.

relates elastic#29519
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Apr 17, 2018
* master: (96 commits)
  TEST: Mute testEnsureWeReconnect
  Mute full cluster restart test recovery test
  REST high-level client: add support for Indices Update Settings API [take 2] (elastic#29327)
  Plugins: Fix native controller confirmation for non-meta plugin (elastic#29434)
  Remove PipelineExecutionService#executeIndexRequest (elastic#29537)
  Fix overflow error in parsing of long geohashes (elastic#29418)
  Remove unused index.ttl.disable_purge setting (elastic#29527)
  FullClusterRestartIT.testRecovery should wait for all initializing shards
  Build: Fail if any libs depend on non-core libs (elastic#29336)
  [TEST] REST client request without leading '/' (elastic#29471)
  Using ObjectParser in UpdateRequest (elastic#29293)
  Prevent accidental changes of default values (elastic#29528)
  [Docs] Add definitions to glossary  (elastic#29127)
  Avoid self-deadlock in the translog (elastic#29520)
  Minor cleanup in NodeInfo.groovy
  Lazy configure build tasks that require older JDKs (elastic#29519)
  Simplify snapshot check in root build file
  Make NodeInfo#nodeVersion strongly-typed as Version (elastic#29515)
  Enable license header exclusions (elastic#29379)
  Use proper Java version for BWC builds (elastic#29493)
  ...
rjernst added a commit that referenced this pull request Apr 19, 2018
This commit moves the checks on JAVAX_HOME (where X is the java version
number) existing to the end of gradle's configuration phase, and based
on whether the tasks needing the java home are configured to execute.

relates #29519
rjernst added a commit that referenced this pull request Apr 19, 2018
This commit moves the checks on JAVAX_HOME (where X is the java version
number) existing to the end of gradle's configuration phase, and based
on whether the tasks needing the java home are configured to execute.

relates #29519
@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
>bug :Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team v6.3.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants