#1041: disable Windows wildcard expansion in native image#2139
Open
maybeec wants to merge 1 commit into
Open
Conversation
Collaborator
Coverage Report for CI Build 29012736276Coverage increased (+0.02%) to 72.225%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
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.
This PR fixes #1041
On Windows, GraalVM native images link
setargv.objby default, which makes the C runtimeexpand wildcards (
*) in the command-line arguments before IDEasy's Javamainreceivesthem. As a result
ide set-version gradle *is turned into the list of files/directories in thecurrent working directory (e.g.
conf plugins settings software workspaces), so the intended*(VersionIdentifier for "latest stable") never reaches the version property and the command fails.
This affects cmd, PowerShell and git-bash alike, because the expansion is done by the binary
itself — it cannot be recovered in Java-side argument parsing.
Implemented changes:
cli/pom.xml(nativeprofile): pass the GraalVM native-image option-H:-EnableWildcardExpansionso that
setargv.objis no longer linked and arguments reach IDEasy verbatim. Verified against thepinned GraalVM
25.0.3, whereSubstrateOptions.EnableWildcardExpansion(defaulttrue) is exactlythe flag guarding the
setargv.objlink step for executables.CHANGELOG.adoc: documented the fix under the next open release2026.07.002.Testing instructions
This is a Windows-native-build-only behavior; it cannot be reproduced in a JVM unit test (the C
runtime expands the arguments before Java runs). Verify with a native build:
mvn -B -ntp -Pnative -DskipTests=true package(repo root, on Windows with GraalVM + MSVC).ide set-version gradle **is treated as "latest stable" and the version is set accordingly, instead of failing withInvalid arguments: "set-version" "gradle" "conf" "plugins" ...(the previously expanded directory names).Checklist for this PR
mvn clean testlocally all tests pass and build is successful (no Java changed; only thenativeMaven profile andCHANGELOG.adocare touched, so existing tests are unaffected)#«issue-id»: «brief summary»In Progressand assigned to youChecklist for tool commandlets
Not applicable — this PR does not add a new tool commandlet.