From 22ffaa5a174c0924ddccaff566d5ac606ae5d2f3 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 9 Nov 2021 10:41:15 -0600 Subject: [PATCH 01/20] Squash other changes by devin to track this down --- build.gradle | 16 ---------------- buildSrc/src/main/groovy/TestTools.groovy | 22 ---------------------- 2 files changed, 38 deletions(-) diff --git a/build.gradle b/build.gradle index aae9c130f9d..fa11efd4e1f 100644 --- a/build.gradle +++ b/build.gradle @@ -125,14 +125,9 @@ Set modsSpotless = subprojects - modsAreExternal - modsAreBasic - modsA allprojects { - apply plugin: 'jacoco' apply plugin: 'idea' apply plugin: 'license' - jacoco { - toolVersion = '0.8.7' - } - license { header rootProject.file('license-header') include "**/*.java" @@ -197,15 +192,6 @@ configure(modsAreDockerRegistry) { configure modsRegular, { Project p -> - p.tasks.jacocoTestReport { - reports { - xml.enabled true - csv.enabled true - html.enabled true -// html.destination "${buildDir}/jacocoHtml" - } - } - p.tasks.create 'sourceJar', Jar, { Jar j -> j.classifier = 'sources' @@ -306,8 +292,6 @@ configure modsRegular, } exclude 'io/deephaven/**/NoTest*' - - finalizedBy jacocoTestReport } } } diff --git a/buildSrc/src/main/groovy/TestTools.groovy b/buildSrc/src/main/groovy/TestTools.groovy index 05ec7eb0fa8..545fe5d3ec8 100644 --- a/buildSrc/src/main/groovy/TestTools.groovy +++ b/buildSrc/src/main/groovy/TestTools.groovy @@ -8,9 +8,6 @@ import org.gradle.api.reporting.internal.SimpleReport import org.gradle.api.tasks.SourceSetContainer import org.gradle.api.tasks.testing.Test import org.gradle.api.tasks.testing.junit.JUnitOptions -import org.gradle.testing.jacoco.plugins.JacocoTaskExtension -import org.gradle.testing.jacoco.tasks.JacocoReport -import org.gradle.testing.jacoco.tasks.JacocoReportsContainer import java.util.concurrent.Callable @@ -150,26 +147,7 @@ By default only runs in CI; to run locally: .replace "${separator}test$separator", "$separator$type$separator" (report as SimpleReport).destination = new File(rebased) } - // this is not part of the standard class; it is glued on later by jacoco plugin; - // we want to give each test it's own output files for jacoco analysis, - // so we don't accidentally stomp on previous output. - // TODO: verify jenkins is analyzing _all_ information here. - (t['jacoco'] as JacocoTaskExtension).with { - destinationFile = project.provider({ new File(project.buildDir, "jacoco/${type}.exec".toString()) } as Callable) - classDumpDir = new File(project.buildDir, "jacoco/${type}Dumps".toString()) - } - (project['jacocoTestReport'] as JacocoReport).with { - reports { - JacocoReportsContainer c -> - c.xml.enabled = true - c.csv.enabled = true - c.html.enabled = true - } - } - } - project.tasks.findByName('jacocoTestReport').mustRunAfter(t) - return t } From 5427f9d5452f654cc184b45f18a81c1e9f2e3f43 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 9 Nov 2021 15:37:42 -0600 Subject: [PATCH 02/20] Run more tests, fail a bit faster --- .github/workflows/nightly-check-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-check-ci.yml b/.github/workflows/nightly-check-ci.yml index 44f4f4adf03..3ba42fab8e9 100644 --- a/.github/workflows/nightly-check-ci.yml +++ b/.github/workflows/nightly-check-ci.yml @@ -45,7 +45,7 @@ jobs: uses: burrunan/gradle-cache-action@v1 with: job-id: check - arguments: --scan --continue --rerun-tasks check + arguments: --rerun-tasks check testOutOfBand testParallel testSerial gradle-version: wrapper - name: Upload Test Results From 6a95e478de5cbea97539e1dc49c8969b2ffe4de4 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 9 Nov 2021 15:41:59 -0600 Subject: [PATCH 03/20] stop telling slack --- .github/workflows/nightly-check-ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nightly-check-ci.yml b/.github/workflows/nightly-check-ci.yml index 3ba42fab8e9..fc035f34d6c 100644 --- a/.github/workflows/nightly-check-ci.yml +++ b/.github/workflows/nightly-check-ci.yml @@ -80,13 +80,13 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} report_paths: '**/build/test-results/*/TEST-*.xml' - - name: Slack Nightly Failure - uses: slackapi/slack-github-action@v1.15.0 - id: slack-nightly-failure - if: ${{ failure() && github.repository_owner == 'deephaven' }} - # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} +# - name: Slack Nightly Failure +# uses: slackapi/slack-github-action@v1.15.0 +# id: slack-nightly-failure +# if: ${{ failure() && github.repository_owner == 'deephaven' }} +# # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} testSerial: if: ${{ github.repository_owner == 'deephaven' || github.event_name != 'schedule' }} From 396060cc18743c224f00a8bf137cdb78855459b0 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 9 Nov 2021 16:16:38 -0600 Subject: [PATCH 04/20] try to capture core dumps, consolidate other output --- .github/workflows/nightly-check-ci.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/nightly-check-ci.yml b/.github/workflows/nightly-check-ci.yml index fc035f34d6c..bd3f83d51dc 100644 --- a/.github/workflows/nightly-check-ci.yml +++ b/.github/workflows/nightly-check-ci.yml @@ -52,22 +52,19 @@ jobs: uses: actions/upload-artifact@v2 if: always() with: - name: nightly-check-ci-results - path: '**/build/test-results/*/TEST-*.xml' - - - name: Upload Test Reports - uses: actions/upload-artifact@v2 - if: always() - with: - name: nightly-check-ci-reports - path: '**/build/reports/tests/**' + name: nightly-check-ci-test-results + path: | + **/build/test-results/*/TEST-*.xml + **/build/reports/tests/** - name: Upload JVM Error Logs uses: actions/upload-artifact@v2 if: failure() with: name: nightly-check-ci-jvm-err - path: '**/*_pid*.log' + path: | + **/*_pid*.log + **/core.* if-no-files-found: ignore - name: Publish Test Results From 45beb6587d6d4b051af72dd39f681cafa3b548f4 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 9 Nov 2021 10:41:34 -0600 Subject: [PATCH 05/20] Log more details of tests, and disable the 5 bad methods seen --- .../io.deephaven.java-conventions.gradle | 19 +++++++++++++++++++ engine/table/build.gradle | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index 813d3dc1b23..8ca34872314 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -74,12 +74,31 @@ tasks.withType(JavaCompile).configureEach { } } +def extraJvmArgs = { runtimeJavaVersion -> + if (runtimeJavaVersion > 8) { + // Allow reflection, disable broken jit + return [ + '--add-opens', 'java.base/java.lang=ALL-UNNAMED', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.ssmpercentile.DoublePercentileTypeMedianHelper::setResult', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.IncrementalChunkedByAggregationStateManager::buildTable', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.ssmpercentile.SsmChunkedPercentileOperator::addChunk', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.RightIncrementalChunkedCrossJoinStateManager::addToIndex', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedNaturalJoinStateManager::buildTable', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedOperatorAggregationStateManager::buildTable', + ] + } + return [] +} + tasks.withType(JavaExec).configureEach { javaLauncher.set runtimeLauncher + jvmArgs += extraJvmArgs(runtimeVersion) + // todo: configure create start scripts } tasks.withType(Test).configureEach { javaLauncher.set testRuntimeLauncher + jvmArgs += extraJvmArgs(testRuntimeVersion) } tasks.withType(GroovyCompile).configureEach { diff --git a/engine/table/build.gradle b/engine/table/build.gradle index 8a159167e0d..be699e51f83 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -118,3 +118,10 @@ tasks.testParallel.maxHeapSize = maxHeapSize tasks.testSerial.maxHeapSize = maxHeapSize tasks.testOutOfBand.maxHeapSize = maxHeapSize tasks.test.maxHeapSize = maxHeapSize + +// log lots of progress of the tests as they run +tasks.withType(Test) { + testLogging { + events "PASSED", "SKIPPED", "FAILED", "STANDARD_OUT", "STANDARD_ERROR" + } +} \ No newline at end of file From c7f70df99d7f2722d9ca995ce6649f113e842242 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 9 Nov 2021 16:29:44 -0600 Subject: [PATCH 06/20] oh look, another mole to whack --- buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index 8ca34872314..eccb3287a8c 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -85,6 +85,7 @@ def extraJvmArgs = { runtimeJavaVersion -> '-XX:CompileCommand=exclude,io.deephaven.db.v2.RightIncrementalChunkedCrossJoinStateManager::addToIndex', '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedNaturalJoinStateManager::buildTable', '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedOperatorAggregationStateManager::buildTable', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.IncrementalChunkedOperatorAggregationStateManager::buildTable', ] } return [] From 7e04106a2fd4587f5d04c3c99fdbc60152aa4a99 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 9 Nov 2021 21:46:32 -0600 Subject: [PATCH 07/20] add a new entry and sort --- .../src/main/groovy/io.deephaven.java-conventions.gradle | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index eccb3287a8c..ceb21dffd6c 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -80,12 +80,13 @@ def extraJvmArgs = { runtimeJavaVersion -> return [ '--add-opens', 'java.base/java.lang=ALL-UNNAMED', '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.ssmpercentile.DoublePercentileTypeMedianHelper::setResult', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.IncrementalChunkedByAggregationStateManager::buildTable', '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.ssmpercentile.SsmChunkedPercentileOperator::addChunk', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.IncrementalChunkedByAggregationStateManager::buildTable', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.IncrementalChunkedOperatorAggregationStateManager::buildTable', '-XX:CompileCommand=exclude,io.deephaven.db.v2.RightIncrementalChunkedCrossJoinStateManager::addToIndex', '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedNaturalJoinStateManager::buildTable', + '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedNaturalJoinStateManager::decorationProbe', '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedOperatorAggregationStateManager::buildTable', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.IncrementalChunkedOperatorAggregationStateManager::buildTable', ] } return [] From bd56c3fc47e4484e9f50ee940adcf54f6168d54d Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 11 Feb 2022 15:23:24 -0600 Subject: [PATCH 08/20] Replace excludes with disabling c2 only --- .../io.deephaven.java-conventions.gradle | 62 +++++++++++++++---- 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index ceb21dffd6c..12bbe875882 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -1,3 +1,5 @@ +import groovy.json.JsonBuilder + plugins { id 'java' } @@ -74,33 +76,67 @@ tasks.withType(JavaCompile).configureEach { } } -def extraJvmArgs = { runtimeJavaVersion -> +def tier4CompilationExcludes = [ + 'io.deephaven.engine.table.impl.by.ssmpercentile.DoublePercentileTypeMedianHelper':['setResult'], + 'io.deephaven.engine.table.impl.by.ssmpercentile.FloatPercentileTypeMedianHelper':['setResult'], + 'io.deephaven.engine.table.impl.by.ssmpercentile.SsmChunkedPercentileOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManager':['buildTable'], + 'io.deephaven.engine.table.impl.RightIncrementalChunkedCrossJoinStateManager':['addToIndex', 'decorationProbe'], + 'io.deephaven.engine.table.impl.IncrementalChunkedNaturalJoinStateManager':['buildTable', 'decorationProbe'], +] +def createCompilerDirectives = tasks.register('createCompilerDirectives') { + def c2ExcludesFile = project.layout.buildDirectory.file('c2-excludes.txt') + it.outputs.file(c2ExcludesFile) + + doFirst { + def excludesAsList = [] + tier4CompilationExcludes.forEach({type, methods -> + methods.forEach {method -> + excludesAsList += "${type}::${method}" + } + }) + def builder = new JsonBuilder() + builder([{ + match excludesAsList + c2 { + Exclude true + } + }]) + c2ExcludesFile.get().asFile.text = builder.toPrettyString() + } +} + +def extraJvmArgs = { int runtimeJavaVersion, File c2ExcludesFile -> + def args = [ + '-XX:Tier4CompileThreshold=1000', +// '-XX:+PrintFlagsFinal', +// '-XX:+PrintCompilation', + '-XX:+UnlockDiagnosticVMOptions', + "-XX:CompilerDirectivesFile=${c2ExcludesFile}", + ] if (runtimeJavaVersion > 8) { // Allow reflection, disable broken jit - return [ + args += [ '--add-opens', 'java.base/java.lang=ALL-UNNAMED', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.ssmpercentile.DoublePercentileTypeMedianHelper::setResult', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.ssmpercentile.SsmChunkedPercentileOperator::addChunk', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.IncrementalChunkedByAggregationStateManager::buildTable', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.by.IncrementalChunkedOperatorAggregationStateManager::buildTable', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.RightIncrementalChunkedCrossJoinStateManager::addToIndex', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedNaturalJoinStateManager::buildTable', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedNaturalJoinStateManager::decorationProbe', - '-XX:CompileCommand=exclude,io.deephaven.db.v2.IncrementalChunkedOperatorAggregationStateManager::buildTable', ] } - return [] + return args } tasks.withType(JavaExec).configureEach { + def c2ExcludesFile = createCompilerDirectives.get().outputs.files + inputs.files c2ExcludesFile javaLauncher.set runtimeLauncher - jvmArgs += extraJvmArgs(runtimeVersion) + jvmArgs += extraJvmArgs(runtimeVersion, c2ExcludesFile.singleFile) // todo: configure create start scripts } tasks.withType(Test).configureEach { + def c2ExcludesFile = createCompilerDirectives.get().outputs.files + inputs.files c2ExcludesFile + javaLauncher.set testRuntimeLauncher - jvmArgs += extraJvmArgs(testRuntimeVersion) + jvmArgs += extraJvmArgs(testRuntimeVersion, c2ExcludesFile.singleFile) } tasks.withType(GroovyCompile).configureEach { From e4e101887b1444a4fbb011adc6eadab85909232a Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 11 Feb 2022 15:24:53 -0600 Subject: [PATCH 09/20] stop telling slack more --- .github/workflows/nightly-check-ci.yml | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/nightly-check-ci.yml b/.github/workflows/nightly-check-ci.yml index bd3f83d51dc..72a2be8c49b 100644 --- a/.github/workflows/nightly-check-ci.yml +++ b/.github/workflows/nightly-check-ci.yml @@ -155,13 +155,13 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} report_paths: '**/build/test-results/*/TEST-*.xml' - - name: Slack Nightly Failure - uses: slackapi/slack-github-action@v1.15.0 - id: slack-nightly-failure - if: ${{ failure() && github.repository_owner == 'deephaven' }} - # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} +# - name: Slack Nightly Failure +# uses: slackapi/slack-github-action@v1.15.0 +# id: slack-nightly-failure +# if: ${{ failure() && github.repository_owner == 'deephaven' }} +# # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} testParallel: if: ${{ github.repository_owner == 'deephaven' || github.event_name != 'schedule' }} @@ -233,13 +233,13 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} report_paths: '**/build/test-results/*/TEST-*.xml' - - name: Slack Nightly Failure - uses: slackapi/slack-github-action@v1.15.0 - id: slack-nightly-failure - if: ${{ failure() && github.repository_owner == 'deephaven' }} - # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} +# - name: Slack Nightly Failure +# uses: slackapi/slack-github-action@v1.15.0 +# id: slack-nightly-failure +# if: ${{ failure() && github.repository_owner == 'deephaven' }} +# # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} testOutOfBand: if: ${{ github.repository_owner == 'deephaven' || github.event_name != 'schedule' }} @@ -311,10 +311,10 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} report_paths: '**/build/test-results/*/TEST-*.xml' - - name: Slack Nightly Failure - uses: slackapi/slack-github-action@v1.15.0 - id: slack-nightly-failure - if: ${{ failure() && github.repository_owner == 'deephaven' }} - # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} +# - name: Slack Nightly Failure +# uses: slackapi/slack-github-action@v1.15.0 +# id: slack-nightly-failure +# if: ${{ failure() && github.repository_owner == 'deephaven' }} +# # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} From 6b8f017f23c62fef7ed72e5bbe75d89eb7157288 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 11 Feb 2022 15:25:00 -0600 Subject: [PATCH 10/20] specific test case that works for ryan to repro --- .../deephaven/engine/table/impl/QueryTableAggregationTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java index 39c5c9ba0c1..fd4748bc90f 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java @@ -2439,9 +2439,8 @@ private void testMedianByIncremental(int size) { final Random random = new Random(0); final ColumnInfo[] columnInfo; final QueryTable queryTable = getTable(size, random, - columnInfo = initColumnInfos(new String[] {"Sym", "intCol", "doubleCol", "floatCol"}, + columnInfo = initColumnInfos(new String[] {"Sym", "doubleCol", "floatCol"}, new SetGenerator<>("a", "b", "c", "d"), - new IntGenerator(10, 100), new SetGenerator<>(10.1, 20.1, 30.1), new FloatGenerator(0, 100.0f))); final Table withoutFloats = queryTable.dropColumns("floatCol"); From 02bff2cde366d37bed49b9dee131575a610f4f0f Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 15 Feb 2022 11:07:01 -0600 Subject: [PATCH 11/20] Custom start scripts, c2Excludes set everywhere --- .../io.deephaven.java-conventions.gradle | 33 +-- .../src/main/resources/unixStartScript.txt | 188 ++++++++++++++++++ .../src/main/resources/windowsStartScript.txt | 93 +++++++++ 3 files changed, 299 insertions(+), 15 deletions(-) create mode 100644 buildSrc/src/main/resources/unixStartScript.txt create mode 100644 buildSrc/src/main/resources/windowsStartScript.txt diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index 12bbe875882..e0efa6dfb1c 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -106,29 +106,18 @@ def createCompilerDirectives = tasks.register('createCompilerDirectives') { } } -def extraJvmArgs = { int runtimeJavaVersion, File c2ExcludesFile -> - def args = [ - '-XX:Tier4CompileThreshold=1000', -// '-XX:+PrintFlagsFinal', -// '-XX:+PrintCompilation', +def c2ExcludesJvmArgs = { String c2ExcludesFile -> + return [ '-XX:+UnlockDiagnosticVMOptions', "-XX:CompilerDirectivesFile=${c2ExcludesFile}", ] - if (runtimeJavaVersion > 8) { - // Allow reflection, disable broken jit - args += [ - '--add-opens', 'java.base/java.lang=ALL-UNNAMED', - ] - } - return args } tasks.withType(JavaExec).configureEach { def c2ExcludesFile = createCompilerDirectives.get().outputs.files inputs.files c2ExcludesFile javaLauncher.set runtimeLauncher - jvmArgs += extraJvmArgs(runtimeVersion, c2ExcludesFile.singleFile) - // todo: configure create start scripts + jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) } tasks.withType(Test).configureEach { @@ -136,13 +125,27 @@ tasks.withType(Test).configureEach { inputs.files c2ExcludesFile javaLauncher.set testRuntimeLauncher - jvmArgs += extraJvmArgs(testRuntimeVersion, c2ExcludesFile.singleFile) + jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) } tasks.withType(GroovyCompile).configureEach { javaLauncher.set groovyCompilerLauncher } +plugins.withType(ApplicationPlugin) { + applicationDistribution.into('lib') { + from(createCompilerDirectives.get().outputs.files) + } +} +tasks.withType(CreateStartScripts).configureEach { + inputs.properties(['scriptVers': Math.random()]) + windowsStartScriptGenerator.template = resources.text.fromUri(getClass().classLoader.getResource('windowsStartScript.txt')) + unixStartScriptGenerator.template = resources.text.fromUri(getClass().classLoader.getResource('unixStartScript.txt')) + // Note that we don't call c2ExcludesJvmArgs() at this time, there is no way to template those strings. + // Instead, we hard code the expected paths in the above templates to match the path lib/c2-excludes.txt +// defaultJvmOpts += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) +} + tasks.withType(Jar).configureEach { Jar jar -> jar.preserveFileTimestamps = false diff --git a/buildSrc/src/main/resources/unixStartScript.txt b/buildSrc/src/main/resources/unixStartScript.txt new file mode 100644 index 00000000000..151a2830daf --- /dev/null +++ b/buildSrc/src/main/resources/unixStartScript.txt @@ -0,0 +1,188 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## ${applicationName} start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: \$0 may be a link +PRG="\$0" +# Need this for relative symlinks. +while [ -h "\$PRG" ] ; do + ls=`ls -ld "\$PRG"` + link=`expr "\$ls" : '.*-> \\(.*\\)\$'` + if expr "\$link" : '/.*' > /dev/null; then + PRG="\$link" + else + PRG=`dirname "\$PRG"`"/\$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null +APP_HOME="`pwd -P`" +cd "\$SAVED" >/dev/null + +APP_NAME="${applicationName}" +APP_BASE_NAME=`basename "\$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. +DEFAULT_JVM_OPTS=${defaultJvmOpts} + +# Customization for deephaven-core to reference a compiler directives file +DEFAULT_JVM_OPTS="\${DEFAULT_JVM_OPTS} -XX:+UnlockDiagnosticVMOptions -XX:CompilerDirectivesFile=\"\${APP_HOME}/lib/c2-excludes.txt\"" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "\$*" +} + +die () { + echo + echo "\$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$classpath +<% if ( mainClassName.startsWith('--module ') ) { %>MODULE_PATH=$modulePath<% } %> + +# Determine the Java command to use to start the JVM. +if [ -n "\$JAVA_HOME" ] ; then + if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="\$JAVA_HOME/jre/sh/java" + else + JAVACMD="\$JAVA_HOME/bin/java" + fi + if [ ! -x "\$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ \$? -eq 0 ] ; then + if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then + MAX_FD="\$MAX_FD_LIMIT" + fi + ulimit -n \$MAX_FD + if [ \$? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: \$MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if \$darwin; then + GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "\$cygwin" = "true" -o "\$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "\$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` +<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=`cygpath --path --mixed "\$MODULE_PATH"`<% } %> + JAVACMD=`cygpath --unix "\$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in \$ROOTDIRSRAW ; do + ROOTDIRS="\$ROOTDIRS\$SEP\$dir" + SEP="|" + done + OURCYGPATTERN="(^(\$ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "\$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "\$@" ; do + CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` + CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option + + if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` + else + eval `echo args\$i`="\"\$arg\"" + fi + i=`expr \$i + 1` + done + case \$i in + 0) set -- ;; + 1) set -- "\$args0" ;; + 2) set -- "\$args0" "\$args1" ;; + 3) set -- "\$args0" "\$args1" "\$args2" ;; + 4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; + 5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; + 6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; + 7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; + 8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; + 9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\\\n "\$i" | sed "s/'/'\\\\\\\\''/g;1s/^/'/;\\\$s/\\\$/' \\\\\\\\/" ; done + echo " " +} +APP_ARGS=`save "\$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "\"\$MODULE_PATH\"" <% } %>${mainClassName} "\$APP_ARGS" + +exec "\$JAVACMD" "\$@" diff --git a/buildSrc/src/main/resources/windowsStartScript.txt b/buildSrc/src/main/resources/windowsStartScript.txt new file mode 100644 index 00000000000..abcd56c83f4 --- /dev/null +++ b/buildSrc/src/main/resources/windowsStartScript.txt @@ -0,0 +1,93 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem ${applicationName} startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=.\ + +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME%${appHomeRelativePath} + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. +set DEFAULT_JVM_OPTS=${defaultJvmOpts} + +@rem Customization for deephaven-core to reference a compiler directives file +set DEFAULT_JVM_OPTS=%DEFAULT_JVM_OPTS% -XX:CompilerDirectivesFile=%APP_HOME%/c2-excludes.txt + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=$classpath +<% if ( mainClassName.startsWith('--module ') ) { %>set MODULE_PATH=$modulePath<% } %> + +@rem Execute ${applicationName} +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "%MODULE_PATH%" <% } %>${mainClassName} %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%${exitEnvironmentVar}%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From 6f2cc112073f3386205870ebd6ed87678ced67a4 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 15 Feb 2022 11:09:51 -0600 Subject: [PATCH 12/20] revert unnecessary stuff from earlier testing, except the unit test itself --- .github/workflows/nightly-check-ci.yml | 75 ++++++++++++----------- build.gradle | 16 +++++ buildSrc/src/main/groovy/TestTools.groovy | 22 +++++++ engine/table/build.gradle | 7 --- 4 files changed, 77 insertions(+), 43 deletions(-) diff --git a/.github/workflows/nightly-check-ci.yml b/.github/workflows/nightly-check-ci.yml index 72a2be8c49b..44f4f4adf03 100644 --- a/.github/workflows/nightly-check-ci.yml +++ b/.github/workflows/nightly-check-ci.yml @@ -45,26 +45,29 @@ jobs: uses: burrunan/gradle-cache-action@v1 with: job-id: check - arguments: --rerun-tasks check testOutOfBand testParallel testSerial + arguments: --scan --continue --rerun-tasks check gradle-version: wrapper - name: Upload Test Results uses: actions/upload-artifact@v2 if: always() with: - name: nightly-check-ci-test-results - path: | - **/build/test-results/*/TEST-*.xml - **/build/reports/tests/** + name: nightly-check-ci-results + path: '**/build/test-results/*/TEST-*.xml' + + - name: Upload Test Reports + uses: actions/upload-artifact@v2 + if: always() + with: + name: nightly-check-ci-reports + path: '**/build/reports/tests/**' - name: Upload JVM Error Logs uses: actions/upload-artifact@v2 if: failure() with: name: nightly-check-ci-jvm-err - path: | - **/*_pid*.log - **/core.* + path: '**/*_pid*.log' if-no-files-found: ignore - name: Publish Test Results @@ -77,13 +80,13 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} report_paths: '**/build/test-results/*/TEST-*.xml' -# - name: Slack Nightly Failure -# uses: slackapi/slack-github-action@v1.15.0 -# id: slack-nightly-failure -# if: ${{ failure() && github.repository_owner == 'deephaven' }} -# # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger -# env: -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} + - name: Slack Nightly Failure + uses: slackapi/slack-github-action@v1.15.0 + id: slack-nightly-failure + if: ${{ failure() && github.repository_owner == 'deephaven' }} + # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} testSerial: if: ${{ github.repository_owner == 'deephaven' || github.event_name != 'schedule' }} @@ -155,13 +158,13 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} report_paths: '**/build/test-results/*/TEST-*.xml' -# - name: Slack Nightly Failure -# uses: slackapi/slack-github-action@v1.15.0 -# id: slack-nightly-failure -# if: ${{ failure() && github.repository_owner == 'deephaven' }} -# # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger -# env: -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} + - name: Slack Nightly Failure + uses: slackapi/slack-github-action@v1.15.0 + id: slack-nightly-failure + if: ${{ failure() && github.repository_owner == 'deephaven' }} + # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} testParallel: if: ${{ github.repository_owner == 'deephaven' || github.event_name != 'schedule' }} @@ -233,13 +236,13 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} report_paths: '**/build/test-results/*/TEST-*.xml' -# - name: Slack Nightly Failure -# uses: slackapi/slack-github-action@v1.15.0 -# id: slack-nightly-failure -# if: ${{ failure() && github.repository_owner == 'deephaven' }} -# # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger -# env: -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} + - name: Slack Nightly Failure + uses: slackapi/slack-github-action@v1.15.0 + id: slack-nightly-failure + if: ${{ failure() && github.repository_owner == 'deephaven' }} + # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} testOutOfBand: if: ${{ github.repository_owner == 'deephaven' || github.event_name != 'schedule' }} @@ -311,10 +314,10 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} report_paths: '**/build/test-results/*/TEST-*.xml' -# - name: Slack Nightly Failure -# uses: slackapi/slack-github-action@v1.15.0 -# id: slack-nightly-failure -# if: ${{ failure() && github.repository_owner == 'deephaven' }} -# # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger -# env: -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} + - name: Slack Nightly Failure + uses: slackapi/slack-github-action@v1.15.0 + id: slack-nightly-failure + if: ${{ failure() && github.repository_owner == 'deephaven' }} + # TODO(deephaven-core#947): Parameterize nightly ci failure workflow and trigger + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_FAILURE }} diff --git a/build.gradle b/build.gradle index fa11efd4e1f..aae9c130f9d 100644 --- a/build.gradle +++ b/build.gradle @@ -125,9 +125,14 @@ Set modsSpotless = subprojects - modsAreExternal - modsAreBasic - modsA allprojects { + apply plugin: 'jacoco' apply plugin: 'idea' apply plugin: 'license' + jacoco { + toolVersion = '0.8.7' + } + license { header rootProject.file('license-header') include "**/*.java" @@ -192,6 +197,15 @@ configure(modsAreDockerRegistry) { configure modsRegular, { Project p -> + p.tasks.jacocoTestReport { + reports { + xml.enabled true + csv.enabled true + html.enabled true +// html.destination "${buildDir}/jacocoHtml" + } + } + p.tasks.create 'sourceJar', Jar, { Jar j -> j.classifier = 'sources' @@ -292,6 +306,8 @@ configure modsRegular, } exclude 'io/deephaven/**/NoTest*' + + finalizedBy jacocoTestReport } } } diff --git a/buildSrc/src/main/groovy/TestTools.groovy b/buildSrc/src/main/groovy/TestTools.groovy index 545fe5d3ec8..05ec7eb0fa8 100644 --- a/buildSrc/src/main/groovy/TestTools.groovy +++ b/buildSrc/src/main/groovy/TestTools.groovy @@ -8,6 +8,9 @@ import org.gradle.api.reporting.internal.SimpleReport import org.gradle.api.tasks.SourceSetContainer import org.gradle.api.tasks.testing.Test import org.gradle.api.tasks.testing.junit.JUnitOptions +import org.gradle.testing.jacoco.plugins.JacocoTaskExtension +import org.gradle.testing.jacoco.tasks.JacocoReport +import org.gradle.testing.jacoco.tasks.JacocoReportsContainer import java.util.concurrent.Callable @@ -147,7 +150,26 @@ By default only runs in CI; to run locally: .replace "${separator}test$separator", "$separator$type$separator" (report as SimpleReport).destination = new File(rebased) } + // this is not part of the standard class; it is glued on later by jacoco plugin; + // we want to give each test it's own output files for jacoco analysis, + // so we don't accidentally stomp on previous output. + // TODO: verify jenkins is analyzing _all_ information here. + (t['jacoco'] as JacocoTaskExtension).with { + destinationFile = project.provider({ new File(project.buildDir, "jacoco/${type}.exec".toString()) } as Callable) + classDumpDir = new File(project.buildDir, "jacoco/${type}Dumps".toString()) + } + (project['jacocoTestReport'] as JacocoReport).with { + reports { + JacocoReportsContainer c -> + c.xml.enabled = true + c.csv.enabled = true + c.html.enabled = true + } + } + } + project.tasks.findByName('jacocoTestReport').mustRunAfter(t) + return t } diff --git a/engine/table/build.gradle b/engine/table/build.gradle index be699e51f83..8a159167e0d 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -118,10 +118,3 @@ tasks.testParallel.maxHeapSize = maxHeapSize tasks.testSerial.maxHeapSize = maxHeapSize tasks.testOutOfBand.maxHeapSize = maxHeapSize tasks.test.maxHeapSize = maxHeapSize - -// log lots of progress of the tests as they run -tasks.withType(Test) { - testLogging { - events "PASSED", "SKIPPED", "FAILED", "STANDARD_OUT", "STANDARD_ERROR" - } -} \ No newline at end of file From a0c6e5403f5f306897ab0b6783901b226857127c Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 15 Feb 2022 11:11:29 -0600 Subject: [PATCH 13/20] easier debugging to spot the issue --- .../main/groovy/io.deephaven.java-conventions.gradle | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index e0efa6dfb1c..cc6e4c8c3b6 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -113,11 +113,16 @@ def c2ExcludesJvmArgs = { String c2ExcludesFile -> ] } +def debugJvmArgs = [ '-XX:Tier3CompileThreshold=100', '-XX:Tier4CompileThreshold=1000', // this optional line makes it easier to trigger the c2 error on the above methods + '-XX:+PrintFlagsFinal', // this optional line makes it easier to explore the final values for compiler args + '-XX:+PrintCompilation', // this optional line shows jit operations as they happen + ] + tasks.withType(JavaExec).configureEach { def c2ExcludesFile = createCompilerDirectives.get().outputs.files inputs.files c2ExcludesFile javaLauncher.set runtimeLauncher - jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) + jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) + debugJvmArgs } tasks.withType(Test).configureEach { @@ -125,7 +130,7 @@ tasks.withType(Test).configureEach { inputs.files c2ExcludesFile javaLauncher.set testRuntimeLauncher - jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) + jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) + debugJvmArgs } tasks.withType(GroovyCompile).configureEach { @@ -144,6 +149,7 @@ tasks.withType(CreateStartScripts).configureEach { // Note that we don't call c2ExcludesJvmArgs() at this time, there is no way to template those strings. // Instead, we hard code the expected paths in the above templates to match the path lib/c2-excludes.txt // defaultJvmOpts += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) + defaultJvmOpts += debugJvmArgs } tasks.withType(Jar).configureEach { From 8da28b6241ce7e1e2a80081086631fff8d5f6d9c Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 15 Feb 2022 15:57:05 -0600 Subject: [PATCH 14/20] Leave dev jvm args in but empty --- .../io.deephaven.java-conventions.gradle | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index cc6e4c8c3b6..4b5ee07ed14 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -113,16 +113,18 @@ def c2ExcludesJvmArgs = { String c2ExcludesFile -> ] } -def debugJvmArgs = [ '-XX:Tier3CompileThreshold=100', '-XX:Tier4CompileThreshold=1000', // this optional line makes it easier to trigger the c2 error on the above methods - '-XX:+PrintFlagsFinal', // this optional line makes it easier to explore the final values for compiler args - '-XX:+PrintCompilation', // this optional line shows jit operations as they happen - ] +// Utility to add jvm args to all executions, whether intellij or from a application script or gradle javaexec +def devJvmArgs = [ +// '-XX:Tier4CompileThreshold=1000', // this optional line makes it easier to trigger the c2 error on the above methods +// '-XX:+PrintFlagsFinal', // this optional line makes it easier to explore the final values for compiler args +// '-XX:+PrintCompilation', // this optional line shows jit operations as they happen +] tasks.withType(JavaExec).configureEach { def c2ExcludesFile = createCompilerDirectives.get().outputs.files inputs.files c2ExcludesFile javaLauncher.set runtimeLauncher - jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) + debugJvmArgs + jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) + devJvmArgs } tasks.withType(Test).configureEach { @@ -130,7 +132,7 @@ tasks.withType(Test).configureEach { inputs.files c2ExcludesFile javaLauncher.set testRuntimeLauncher - jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) + debugJvmArgs + jvmArgs += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) + devJvmArgs } tasks.withType(GroovyCompile).configureEach { @@ -149,7 +151,8 @@ tasks.withType(CreateStartScripts).configureEach { // Note that we don't call c2ExcludesJvmArgs() at this time, there is no way to template those strings. // Instead, we hard code the expected paths in the above templates to match the path lib/c2-excludes.txt // defaultJvmOpts += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) - defaultJvmOpts += debugJvmArgs + + defaultJvmOpts += devJvmArgs } tasks.withType(Jar).configureEach { @@ -173,4 +176,4 @@ jar { configurations { testOutput.extendsFrom testRuntimeClasspath -} \ No newline at end of file +} From 79e4effc4358ab8265910247c0c19740a1d5bc90 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 15 Feb 2022 15:59:26 -0600 Subject: [PATCH 15/20] Revert ryan's test --- .../deephaven/engine/table/impl/QueryTableAggregationTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java index fd4748bc90f..39c5c9ba0c1 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAggregationTest.java @@ -2439,8 +2439,9 @@ private void testMedianByIncremental(int size) { final Random random = new Random(0); final ColumnInfo[] columnInfo; final QueryTable queryTable = getTable(size, random, - columnInfo = initColumnInfos(new String[] {"Sym", "doubleCol", "floatCol"}, + columnInfo = initColumnInfos(new String[] {"Sym", "intCol", "doubleCol", "floatCol"}, new SetGenerator<>("a", "b", "c", "d"), + new IntGenerator(10, 100), new SetGenerator<>(10.1, 20.1, 30.1), new FloatGenerator(0, 100.0f))); final Table withoutFloats = queryTable.dropColumns("floatCol"); From 682a1f340f3b33ef563436a91961175d4122826b Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 16 Feb 2022 11:31:57 -0600 Subject: [PATCH 16/20] Fix windows script, rename output file --- .../io.deephaven.java-conventions.gradle | 22 +++++++++---------- .../src/main/resources/unixStartScript.txt | 2 +- .../src/main/resources/windowsStartScript.txt | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index 4b5ee07ed14..6ad4cb343a8 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -85,8 +85,8 @@ def tier4CompilationExcludes = [ 'io.deephaven.engine.table.impl.IncrementalChunkedNaturalJoinStateManager':['buildTable', 'decorationProbe'], ] def createCompilerDirectives = tasks.register('createCompilerDirectives') { - def c2ExcludesFile = project.layout.buildDirectory.file('c2-excludes.txt') - it.outputs.file(c2ExcludesFile) + def compilerDirectivesFile = project.layout.buildDirectory.file('dh-compiler-directives.txt') + it.outputs.file(compilerDirectivesFile) doFirst { def excludesAsList = [] @@ -95,14 +95,14 @@ def createCompilerDirectives = tasks.register('createCompilerDirectives') { excludesAsList += "${type}::${method}" } }) - def builder = new JsonBuilder() - builder([{ - match excludesAsList - c2 { - Exclude true - } - }]) - c2ExcludesFile.get().asFile.text = builder.toPrettyString() + def builder = new JsonBuilder([{ + match excludesAsList + c2 { + Exclude true + } + }]) + + compilerDirectivesFile.get().asFile.text = builder.toPrettyString() } } @@ -149,7 +149,7 @@ tasks.withType(CreateStartScripts).configureEach { windowsStartScriptGenerator.template = resources.text.fromUri(getClass().classLoader.getResource('windowsStartScript.txt')) unixStartScriptGenerator.template = resources.text.fromUri(getClass().classLoader.getResource('unixStartScript.txt')) // Note that we don't call c2ExcludesJvmArgs() at this time, there is no way to template those strings. - // Instead, we hard code the expected paths in the above templates to match the path lib/c2-excludes.txt + // Instead, we hard code the expected paths in the above templates to match the path lib/dh-compiler-directives.txt // defaultJvmOpts += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) defaultJvmOpts += devJvmArgs diff --git a/buildSrc/src/main/resources/unixStartScript.txt b/buildSrc/src/main/resources/unixStartScript.txt index 151a2830daf..44db5630994 100644 --- a/buildSrc/src/main/resources/unixStartScript.txt +++ b/buildSrc/src/main/resources/unixStartScript.txt @@ -47,7 +47,7 @@ APP_BASE_NAME=`basename "\$0"` DEFAULT_JVM_OPTS=${defaultJvmOpts} # Customization for deephaven-core to reference a compiler directives file -DEFAULT_JVM_OPTS="\${DEFAULT_JVM_OPTS} -XX:+UnlockDiagnosticVMOptions -XX:CompilerDirectivesFile=\"\${APP_HOME}/lib/c2-excludes.txt\"" +DEFAULT_JVM_OPTS="\${DEFAULT_JVM_OPTS} -XX:+UnlockDiagnosticVMOptions -XX:CompilerDirectivesFile=\"\${APP_HOME}/lib/dh-compiler-directives.txt\"" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" diff --git a/buildSrc/src/main/resources/windowsStartScript.txt b/buildSrc/src/main/resources/windowsStartScript.txt index abcd56c83f4..76a4fe52de3 100644 --- a/buildSrc/src/main/resources/windowsStartScript.txt +++ b/buildSrc/src/main/resources/windowsStartScript.txt @@ -37,7 +37,7 @@ for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi set DEFAULT_JVM_OPTS=${defaultJvmOpts} @rem Customization for deephaven-core to reference a compiler directives file -set DEFAULT_JVM_OPTS=%DEFAULT_JVM_OPTS% -XX:CompilerDirectivesFile=%APP_HOME%/c2-excludes.txt +set DEFAULT_JVM_OPTS=%DEFAULT_JVM_OPTS% -XX:+UnlockDiagnosticVMOptions "-XX:CompilerDirectivesFile=%APP_HOME%/dh-compiler-directives.txt" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome From e7ec74aa0adf67ae34f9285c7a54b08128b97988 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 16 Feb 2022 12:17:37 -0600 Subject: [PATCH 17/20] Ensure changes to template scripts update the output --- .../src/main/groovy/io.deephaven.java-conventions.gradle | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index 6ad4cb343a8..b72fa1c143f 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -145,9 +145,12 @@ plugins.withType(ApplicationPlugin) { } } tasks.withType(CreateStartScripts).configureEach { - inputs.properties(['scriptVers': Math.random()]) - windowsStartScriptGenerator.template = resources.text.fromUri(getClass().classLoader.getResource('windowsStartScript.txt')) - unixStartScriptGenerator.template = resources.text.fromUri(getClass().classLoader.getResource('unixStartScript.txt')) + def windowsStartScript = resources.text.fromUri(getClass().classLoader.getResource('windowsStartScript.txt')) + def unixStartScript = resources.text.fromUri(getClass().classLoader.getResource('unixStartScript.txt')) + inputs.files windowsStartScript + inputs.files unixStartScript + windowsStartScriptGenerator.template = windowsStartScript + unixStartScriptGenerator.template = unixStartScript // Note that we don't call c2ExcludesJvmArgs() at this time, there is no way to template those strings. // Instead, we hard code the expected paths in the above templates to match the path lib/dh-compiler-directives.txt // defaultJvmOpts += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) From 3985b2ac0e3594803e4a63b0a0a1b2fdda365109 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 16 Feb 2022 14:38:52 -0600 Subject: [PATCH 18/20] fix windows path --- buildSrc/src/main/resources/windowsStartScript.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/resources/windowsStartScript.txt b/buildSrc/src/main/resources/windowsStartScript.txt index 76a4fe52de3..78335c78f0b 100644 --- a/buildSrc/src/main/resources/windowsStartScript.txt +++ b/buildSrc/src/main/resources/windowsStartScript.txt @@ -37,7 +37,7 @@ for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi set DEFAULT_JVM_OPTS=${defaultJvmOpts} @rem Customization for deephaven-core to reference a compiler directives file -set DEFAULT_JVM_OPTS=%DEFAULT_JVM_OPTS% -XX:+UnlockDiagnosticVMOptions "-XX:CompilerDirectivesFile=%APP_HOME%/dh-compiler-directives.txt" +set DEFAULT_JVM_OPTS=%DEFAULT_JVM_OPTS% -XX:+UnlockDiagnosticVMOptions "-XX:CompilerDirectivesFile=%APP_HOME%\lib\dh-compiler-directives.txt" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome From 0dea29f14497705aafad48f226ca6fafb37c3e35 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 16 Feb 2022 16:47:43 -0600 Subject: [PATCH 19/20] Expand list of types to exclude --- .../io.deephaven.java-conventions.gradle | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index b72fa1c143f..8146ab7549c 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -77,12 +77,42 @@ tasks.withType(JavaCompile).configureEach { } def tier4CompilationExcludes = [ + // All ChunkedSumOperators + 'io.deephaven.engine.table.impl.by.BigDecimalChunkedSumOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.BigIntegerChunkedSumOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.BooleanChunkedSumOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.ByteChunkedSumOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.CharChunkedSumOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.DoubleChunkedSumOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.FloatChunkedSumOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.IntChunkedSumOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.LongChunkedSumOperator':['addChunk'], + 'io.deephaven.engine.table.impl.by.ShortChunkedSumOperator':['addChunk'], + + // All PercentileTypeMedianHelpers + 'io.deephaven.engine.table.impl.by.ssmpercentile.BooleanPercentileTypeMedianHelper':['setResult'], + 'io.deephaven.engine.table.impl.by.ssmpercentile.BytePercentileTypeMedianHelper':['setResult'], + 'io.deephaven.engine.table.impl.by.ssmpercentile.CharPercentileTypeMedianHelper':['setResult'], 'io.deephaven.engine.table.impl.by.ssmpercentile.DoublePercentileTypeMedianHelper':['setResult'], 'io.deephaven.engine.table.impl.by.ssmpercentile.FloatPercentileTypeMedianHelper':['setResult'], + 'io.deephaven.engine.table.impl.by.ssmpercentile.IntPercentileTypeMedianHelper':['setResult'], + 'io.deephaven.engine.table.impl.by.ssmpercentile.LongPercentileTypeMedianHelper':['setResult'], + 'io.deephaven.engine.table.impl.by.ssmpercentile.ShortPercentileTypeMedianHelper':['setResult'], + 'io.deephaven.engine.table.impl.by.ssmpercentile.SsmChunkedPercentileOperator':['addChunk'], - 'io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManager':['buildTable'], - 'io.deephaven.engine.table.impl.RightIncrementalChunkedCrossJoinStateManager':['addToIndex', 'decorationProbe'], - 'io.deephaven.engine.table.impl.IncrementalChunkedNaturalJoinStateManager':['buildTable', 'decorationProbe'], + + // All types emitted by ReplicateHashTable + 'io.deephaven.engine.table.impl.IncrementalChunkedNaturalJoinStateManager':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.RightIncrementalChunkedNaturalJoinStateManager':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.StaticChunkedAsOfJoinStateManager':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.StaticChunkedNaturalJoinStateManager':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.RightIncrementalChunkedAsOfJoinStateManager':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.SymbolTableCombiner':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.LeftOnlyIncrementalChunkedCrossJoinStateManager':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.RightIncrementalChunkedCrossJoinStateManager':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.StaticChunkedCrossJoinStateManager':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.by.StaticChunkedOperatorAggregationStateManager':['addToIndex', 'buildTable', 'decorationProbe'], + 'io.deephaven.engine.table.impl.by.IncrementalChunkedOperatorAggregationStateManager':['addToIndex', 'buildTable', 'decorationProbe'], ] def createCompilerDirectives = tasks.register('createCompilerDirectives') { def compilerDirectivesFile = project.layout.buildDirectory.file('dh-compiler-directives.txt') From f60793f8b38b29caa85a4a05e902b5ddd1627d37 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 18 Feb 2022 10:10:16 -0600 Subject: [PATCH 20/20] Exclude windows since it doesn't work anyway, and emit a message --- .../io.deephaven.java-conventions.gradle | 11 ++- .../src/main/resources/windowsStartScript.txt | 93 ------------------- 2 files changed, 8 insertions(+), 96 deletions(-) delete mode 100644 buildSrc/src/main/resources/windowsStartScript.txt diff --git a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle index 8146ab7549c..03cae47335d 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-conventions.gradle @@ -175,12 +175,17 @@ plugins.withType(ApplicationPlugin) { } } tasks.withType(CreateStartScripts).configureEach { - def windowsStartScript = resources.text.fromUri(getClass().classLoader.getResource('windowsStartScript.txt')) def unixStartScript = resources.text.fromUri(getClass().classLoader.getResource('unixStartScript.txt')) - inputs.files windowsStartScript inputs.files unixStartScript - windowsStartScriptGenerator.template = windowsStartScript unixStartScriptGenerator.template = unixStartScript + // For now we only modify the *nix script, as the windows .bat file doesn't seem to work properly anyway, + // and we don't yet have a requirement for it. + windowsStartScriptGenerator.template = resources.text.fromString("echo Sorry, Windows .bat is not currently supported, please use WSL2\nexit 1") + +// def windowsStartScript = resources.text.fromUri(getClass().classLoader.getResource('windowsStartScript.txt')) +// inputs.files windowsStartScript +// windowsStartScriptGenerator.template = windowsStartScript + // Note that we don't call c2ExcludesJvmArgs() at this time, there is no way to template those strings. // Instead, we hard code the expected paths in the above templates to match the path lib/dh-compiler-directives.txt // defaultJvmOpts += c2ExcludesJvmArgs(c2ExcludesFile.singleFile.path) diff --git a/buildSrc/src/main/resources/windowsStartScript.txt b/buildSrc/src/main/resources/windowsStartScript.txt deleted file mode 100644 index 78335c78f0b..00000000000 --- a/buildSrc/src/main/resources/windowsStartScript.txt +++ /dev/null @@ -1,93 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem ${applicationName} startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=.\ - -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME%${appHomeRelativePath} - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@rem Customization for deephaven-core to reference a compiler directives file -set DEFAULT_JVM_OPTS=%DEFAULT_JVM_OPTS% -XX:+UnlockDiagnosticVMOptions "-XX:CompilerDirectivesFile=%APP_HOME%\lib\dh-compiler-directives.txt" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %>set MODULE_PATH=$modulePath<% } %> - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "%MODULE_PATH%" <% } %>${mainClassName} %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega