Skip to content

#1041: disable Windows wildcard expansion in native image#2139

Open
maybeec wants to merge 1 commit into
devonfw:mainfrom
maybeec:bugfix/1041-native-image-globbing
Open

#1041: disable Windows wildcard expansion in native image#2139
maybeec wants to merge 1 commit into
devonfw:mainfrom
maybeec:bugfix/1041-native-image-globbing

Conversation

@maybeec

@maybeec maybeec commented Jul 9, 2026

Copy link
Copy Markdown
Member

This PR fixes #1041

On Windows, GraalVM native images link setargv.obj by default, which makes the C runtime
expand wildcards (*) in the command-line arguments before IDEasy's Java main receives
them. As a result ide set-version gradle * is turned into the list of files/directories in the
current 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 (native profile): pass the GraalVM native-image option -H:-EnableWildcardExpansion
    so that setargv.obj is no longer linked and arguments reach IDEasy verbatim. Verified against the
    pinned GraalVM 25.0.3, where SubstrateOptions.EnableWildcardExpansion (default true) is exactly
    the flag guarding the setargv.obj link step for executables.
  • CHANGELOG.adoc: documented the fix under the next open release 2026.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:

  1. Build the native image: mvn -B -ntp -Pnative -DskipTests=true package (repo root, on Windows with GraalVM + MSVC).
  2. From any directory that contains sub-directories/files, run: ide set-version gradle *
  3. The * is treated as "latest stable" and the version is set accordingly, instead of failing with
    Invalid arguments: "set-version" "gradle" "conf" "plugins" ... (the previously expanded directory names).

Checklist for this PR

  • When running mvn clean test locally all tests pass and build is successful (no Java changed; only the native Maven profile and CHANGELOG.adoc are touched, so existing tests are unaffected)
  • PR title is of the form #«issue-id»: «brief summary»
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

Checklist for tool commandlets

Not applicable — this PR does not add a new tool commandlet.

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jul 9, 2026
@maybeec maybeec moved this from 🆕 New to Team Review in IDEasy board Jul 9, 2026
@maybeec maybeec requested a review from hohwille July 9, 2026 10:47
@maybeec maybeec added this to the release:2026.07.002 milestone Jul 9, 2026
@maybeec maybeec added CLI IDEasy command-line-interface (parsing args, etc.) core FileAccess, ProcessUtil, IdeContext, etc. bugfix PR that fixes a bug issue windows specific for Microsoft Windows OS labels Jul 9, 2026
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29012736276

Coverage increased (+0.02%) to 72.225%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 16708
Covered Lines: 12572
Line Coverage: 75.25%
Relevant Branches: 7458
Covered Branches: 4882
Branch Coverage: 65.46%
Branches in Coverage %: Yes
Coverage Strength: 3.18 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR that fixes a bug issue CLI IDEasy command-line-interface (parsing args, etc.) core FileAccess, ProcessUtil, IdeContext, etc. windows specific for Microsoft Windows OS

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

native image has globbing active

2 participants