Repository navigation
Fix broken Windows XDK launcher labels (script changed in Gradle 9.4), adopt stable Gradle 9.x features. Also fix broken JIT Paths for Windows. - #670
Merged
Conversation
lagergren
requested review from
cpurdy,
ggleyzer and
thegridman
and removed request for
ggleyzer
October 5, 2026 10:26
ggleyzer
reviewed
Oct 5, 2026
ggleyzer
reviewed
Oct 5, 2026
lagergren
force-pushed
the
gradle-9.8-fixes-and-stable-features
branch
from
October 5, 2026 17:33
7b9c52c to
232ad01
Compare
cpurdy
approved these changes
Oct 5, 2026
cpurdy
left a comment
Collaborator
There was a problem hiding this comment.
Pushed some small edits and made some notes (TODOs) for the future.
- Windows launchers: the XDK_HOME block jumped to the :end and :fail labels, which the Gradle 9.5 start-script template no longer has. Jump to :exitWithErrorLevel instead, exiting with 1 on the invalid-XDK path. - gradle.properties: fix the org.gradle.configuration-cache.problems key (it was spelled configuration-cache-problems) and drop three configuration-cache keys Gradle does not read. All values were defaults. - Declare configuration-cache compatibility for the XTC plugin to the Plugin Portal. - Retry wrapper distribution downloads up to 3 times. - Run validatePlugins with stricter validation in the build-logic builds, and declare caching intent on the five task types it flagged.
- SafeTarExtractor: check for escapes with Path.toRealPath on the longest existing prefix of the target. File.canonicalFile does not resolve symbolic links on Windows, so an existing link inside the extraction directory could redirect an entry outside it. - SafeTarExtractorTest: TarArchiveEntry's constructor rewrites the platform separator to '/', so on Windows the backslash case never reached the extractor. Rebuild such entries from their header to keep the exact name. - BundlerTest: the duplicate-selection error quotes the path as a string literal, so match the quoted form; Windows backslashes appear escaped. - SourceSetWiringTest: ignore temp directory deletion failures; ProjectBuilder keeps cache files open until the JVM exits, and Windows cannot delete open files.
… form
On Windows, new File("/lib1").getPath() is "\lib1", so matching the literal "/lib1" failed.
- NativeTypeSystem: resolve the javatools location through URL.toURI(). The URL path "/D:/.../javatools.jar" is not a valid Windows path, so every JIT run failed at startup.
- OS file system: Ecstasy Paths only split on '/', so a native Windows path such as "C:\...\test.dat" became a single segment with no parent, and FileNode.parent asserted. OS file nodes now expose a storePathString in Path form, which the bridge parses: paths on the current drive are rooted at "/" ("D:\a\b" is "/a/b"), and other drives become a leading segment ("C:\a" is "/C:/a"). Natives that receive path strings accept both forms, and watcher events report directories in Path form so they match the keys the watchers are registered under. pathString stays native, and nothing changes outside Windows.
The integration test downloads the consumer Maven repository that only the Ubuntu build uploads, so a dispatch with platforms=windows-latest always failed it. Skip the job there, and let the build-complete gate accept that skip.
…etic toStorePath and toOsPath now recognize "C:\" and "/C:/..." with the DRIVE_ROOT and DRIVE_STORE_PATH patterns, and use File.separator and a SEPARATOR constant instead of separator literals.
pathString now returns the path in the '/'-separated form of an Ecstasy Path, so the separate storePathString property is gone and the bridge is unchanged from master. The file system natives already accept that form; the certificate manager, the one other consumer that uses pathString as an OS path, now converts it with xOSFileNode.toOsPath. On Windows, an OS file's toString() shows the Path form ("/C:/a") instead of the native one ("C:\a"); nothing changes elsewhere.
- POSIX launchers (Linux, macOS): report "Unable to locate a valid XDK" and exit 1 when javatools.jar is missing, as the Windows launchers do, instead of failing in Java with a missing main class. - Windows launchers: the XDK_HOME block set and read XDK_CMD, XDK_ID and APP_ID inside one parenthesized block, where cmd.exe expands variables when the block is parsed, so delegating to the launcher of another XDK never happened. Run one statement per line, compare against the .bat itself (%~nx0) rather than the extensionless POSIX script, quote the javatools.jar check so XDK paths with spaces work, and require a set XDK_HOME to name an XDK, as the POSIX launchers do.
test-launchers.sh unpacks the distribution zip into a path with spaces and runs xtc, xcc and xec: the POSIX scripts on Ubuntu, the .bat scripts on Windows (manual dispatch). It checks --version and --help, compiling, running, argument passing, failure exit codes, JAVA_OPTS and XTC_OPTS, relative and (POSIX) symlinked launchers, and XDK_HOME set to this XDK, another XDK, a directory without an XDK and a missing directory, and a broken XDK.
The mapping between Windows paths and the Path form is now a string-only core, windowsToStorePath and storeToWindowsPath, that takes the current drive as a parameter; toStorePath and toOsPath apply it on Windows only. The tests of the core run everywhere, so every Linux build covers the Windows mapping and its edge cases: lowercase drive letters, roots without a drive, UNC and drive-relative paths, no current drive, "/C:/" with a trailing separator, look-alikes such as "/CC:/x", and round trips. The tests on real Windows paths stay Windows-only.
Programs start a batch file through "cmd /c", which drops the quotes of a quoted batch path when quoted arguments follow, so on Windows every check that passed a path with spaces failed before the launcher started. The test now writes each command line to a .cmd file in a path without spaces and runs that, as a cmd.exe prompt would run the command.
cmd.exe ignores leading whitespace, so the one-statement-per-line block can keep the indentation of the nested ifs it replaced.
lagergren
force-pushed
the
gradle-9.8-fixes-and-stable-features
branch
from
October 6, 2026 07:31
d140d33 to
cb20823
Compare
…elegate configurations.creating as a delegated property is deprecated since Gradle 9.6. Register the configuration, which also keeps it lazy.
6 of 9 tasks
The test loads the compiled ecstasy module, so javatools' test resources depended on :xdk:lib-ecstasy:compileXtc while the xdk build depends on javatools. That worked only because no task waits on itself, and because building the XTC plugin compiles javatools before the xdk build is configured, which the task graph does not show. The xdk build already compiles ecstasy.xtc and has tests that depend on javatools, so the test now runs there: its processTestResources consumes the lib-ecstasy artifact within the xdk build, and javatools no longer depends on the xdk build at all. The test moves to package org.xvm.xdk because javatools.jar is sealed, so its packages cannot be extended from another location. The configuration is registered rather than created through the deprecated Kotlin DSL delegate.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
gradle-upgrade.sh rewrites gradle-wrapper.properties after the wrapper task, keeping the wrapper's own policy, but it read that policy from the file the wrapper task had just written, with Gradle's defaults: an upgrade to 9.8.2 turned retries=3, which #670 set, into retries=0. It now reads the policy from a copy of the file taken before the wrapper task runs. Validation: bin/gradle-upgrade.sh 9.8.2 from master's wrapper files keeps retries=3 and retryBackOffMs=500, and writes the same gradle-wrapper.properties as Dependabot's #726; before the fix it wrote retries=0. bash -n and --check pass. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
gradle-upgrade.sh rewrites gradle-wrapper.properties after the wrapper task, keeping the wrapper's own policy, but it read that policy from the file the wrapper task had just written, with Gradle's defaults: an upgrade to 9.8.2 turned retries=3, which #670 set, into retries=0. It now reads the policy from a copy of the file taken before the wrapper task runs. Validation: bin/gradle-upgrade.sh 9.8.2 from master's wrapper files keeps retries=3 and retryBackOffMs=500, and writes the same gradle-wrapper.properties as Dependabot's #726; before the fix it wrote retries=0. bash -n and --check pass. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
gradle-upgrade.sh rewrites gradle-wrapper.properties after the wrapper task, keeping the wrapper's own policy, but it read that policy from the file the wrapper task had just written, with Gradle's defaults: an upgrade to 9.8.2 turned retries=3, which #670 set, into retries=0. It now reads the policy from a copy of the file taken before the wrapper task runs. Validation: bin/gradle-upgrade.sh 9.8.2 from master's wrapper files keeps retries=3 and retryBackOffMs=500, and writes the same gradle-wrapper.properties as Dependabot's #726; before the fix it wrote retries=0. bash -n and --check pass. Limits: none.
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
These changes come from reviewing the Gradle 9.2–9.8 release notes and the 9.x upgrade guide against the build. They contain two fixes and three features that are stable in Gradle 9.8. I deliberately left out the Gradle 10 feature previews (
STABLE_CONFIGURATION_CACHE,NO_IMPLICIT_LOOKUP_IN_PARENT_PROJECTS,ENHANCED_GRAPH_ORDERING) and everything still incubating in 9.8 (parallel configuration-cache store, configure on demand, isolated projects, read-only configuration cache).Fixes
XdkDistributioninjects anXDK_HOMEblock intoxtc.bat,xcc.batandxec.batthat rangoto endandgoto fail.:endor:faillabels; its only exit label is:exitWithErrorLevel, which the template comments as stable. The old labels are visible ingradlew.batbefore Upgrade Gradle 9.4.1 → 9.5.0; bump Develocity to 4.4.1 #450.javatools\javatools.jar),goto failtherefore ended in "The system cannot find the batch label specified".:exitWithErrorLeveland exits with 1 on that path, using the template's own idiom.XDK_HOMEhandling.XDK_CMD,XDK_IDandAPP_IDinside one parenthesized block, and cmd.exe expands variables when it parses the whole block. The block now runs one statement per line..batitself (%~nx0).javatools.jarcheck is now quoted.XDK_HOMEis now an error, as on POSIX, instead of being silently ignored.XDK_HOMEfailed in Java with a missing main class. They now print the same "Unable to locate a valid XDK" message as Windows and exit 1.TypeConstantL1SpecializationTest(from JIT milestone: virtual constructors, enums and more #671) loads the compiledecstasy.xtc. To provide it, javatools'processTestResourcesconsumed:xdk:lib-ecstasy, while the xdk build depends on javatools.--task-graphdoes not show that edge.org.xvm.xdkbecausejavatools.jaris sealed and its packages cannot be extended from another location.by configurations.creatingdelegate. Gradle 9.6 deprecated that delegate, and it produced threew:warnings in CI.gradle.propertiescontained four keys that Gradle 9.8 does not read. I checked them against the property names in the 9.8.0 distribution.org.gradle.configuration-cache-problemsis a misspelling oforg.gradle.configuration-cache.problems; this PR renames it.configuration-cache.debug,.internal.reportand.ignore-valid-build-scriptsdo not exist and are removed, together with their comments.Stable features adopted
plugin/build.gradle.ktsnow hascompatibility { features { configurationCache = true } }(plugin-publish 2.2.1).ConfigurationCacheCompatibilityTestcovers configuration-cache compatibility../gradlew wrapper --gradle-version 9.8.0 --retries 3. Onlyretries=0→retries=3changed; the wrapper scripts and jar are identical.validatePluginsis automatically strict for published plugins, and the XTC plugin already passes. All three build-logic builds now opt in too.RunIdeEnvironmentReportTask,StartLogTailTask,StopLogTailTask:@UntrackedTask, replacing their equivalentdoNotTrackState(...)init blocks;DockerCleanupTask:@UntrackedTask, like the existingDockerTask;ValidateCredentialsTask:@DisableCachingByDefault, likeValidateSnapshotBundleTask.Windows CI (manual dispatch,
platforms=windows-latest)Windows CI stays manual-dispatch only. Running it showed that master fails on Windows: the same tests failed in a dispatch on unchanged master (run 37285236577). The Windows failures this PR fixes:
SafeTarExtractor(security):File.canonicalFiledoes not resolve symbolic links on Windows, so an existing link inside the extraction directory could redirect an entry outside it. Escapes are now checked withPath.toRealPath()on the longest existing prefix of the target.SafeTarExtractorTest: commons-compress'sTarArchiveEntryconstructor rewrites\to/on Windows, so the backslash case never reached the extractor. The test now rebuilds such entries from their header, which keeps the exact name; I checked that technique separately with JShell.BundlerTest,OptionsTest: the tests compared against hard-coded Unix path strings. They now expect the escapedquoted(...)form and theFile.getPath()form that the code produces.SourceSetWiringTest: Gradle'sProjectBuilderkeeps files under the project directory open until the JVM exits, and Windows cannot delete open files. The test's@TempDirnow ignores deletion failures (TempDirDeletionStrategy.IgnoreFailures; experimental in JUnit 6.1).NativeTypeSystembuilt aPathfromURL.getPath(), giving/D:/.../javatools.jar, an invalid Windows path, so every JIT run failed. It now usesPath.of(url.toURI()).Pathonly splits on/, so a native Windows path became a single segment with no parent, andFileNode.parentasserted (TestFiles).pathStringis now inPathform, so the bridge parses it as before and is unchanged./(D:\a\bbecomes/a/b).C:\abecomes/C:/a).Pathform, so they match the keys the watchers are registered under.pathStringas an OS path, converts it back withxOSFileNode.toOsPath.toString()shows/C:/ainstead ofC:\a. Nothing changes outside Windows.windowsToStorePath,storeToWindowsPath);toStorePathandtoOsPathapply it on Windows only.OsPathConversionTesttests that core on every OS, so each Linux build covers the Windows mapping, including these edge cases:/C:/with a trailing separator/CC:/x.github/scripts/test-launchers.shruns in CI after the build. It unpacks the distribution zip into a path with spaces and runsxtc,xccandxec: the POSIX scripts on Ubuntu, the.batscripts on Windows.--versionand--helpJAVA_OPTSandXTC_OPTSXDK_HOMEset to this XDK, to another XDK, to a directory without an XDK and to a missing directory.batas typed at a cmd.exe prompt, because other programs start batch files throughcmd /c, which mangles a quoted batch path followed by quoted arguments.build-completegate accepts that one skip.Type of change
Resolves/Fixes
How Has This Been Tested?
./gradlew buildpasses. Configuring the whole composite without the configuration cache, with lang and manualTests attached and--warning-mode=all, prints no deprecation warnings.validatePluginswith stricter validation passes for:aggregator,:settings-plugins,:common-pluginsand:plugin. I forced those runs with--rerun-tasks, because--rerundid not reliably rerun the build-logic tasks.DockerCleanupTaskannotation: the build fails on that type. With the annotation it passes.RUN_INTEGRATION_TESTS=true): 58 tests, 0 failures, 0 skipped.:common-plugins:test, which includesValidateCredentialsTaskTest): 44 tests, 0 failures.:lang:intellij-plugin:runIdeInfo,startLspLogTailandstopLspLogTailexecute on two consecutive runs, never reported as up to date. The configuration cache was stored and then reused.:docker:cleanImages -PdryRun=true: takes the dry-run path.javatools.jarremoved, it fails, so it catches broken launchers../gradlew :javatools:test --task-graphlists no:xdk:tasks.TypeConstantL1SpecializationTestruns 40 tests with 0 skipped.w:warnings.CI=true ./gradlew spotlessCheck :lang:spotlessCheckpasses.platforms=windows-lateston7b9c52caepasses (run 37339839498).:javatools:test,:common-plugins:test,:plugin:testand the manual tests (includingrunJitTests,runSmallFloatsJitandrunSequential) executed rather than coming from cache, and the integration test was skipped as intended. The Ubuntu PR run on the same commit passes, with its integration test still running.Test Configuration:
./gradlew build./gradlew build --dry-run --no-configuration-cache --warning-mode=all -PincludeBuildLang=true -PincludeBuildAttachLang=true -PincludeBuildAttachManualTests=true./gradlew :aggregator:validatePlugins :settings-plugins:validatePlugins :common-plugins:validatePlugins --rerun-tasks --no-build-cacheRUN_INTEGRATION_TESTS=true ./gradlew :plugin:test --rerun-tasks --no-build-cache./gradlew :common-plugins:test --rerun-tasks --no-build-cacheCI=true ./gradlew spotlessCheck :lang:spotlessCheck -PincludeBuildLang=true -PincludeBuildAttachLang=trueChecklist: