Skip to content

fix: fail early when the output target is Windows - #79

Merged
avelino merged 1 commit into
mainfrom
avelino/fix/windows-target-error
Oct 16, 2026
Merged

avelino merged 1 commit into
mainfrom
avelino/fix/windows-target-error

Conversation

@avelino

@avelino avelino commented Oct 12, 2026

Copy link
Copy Markdown
Owner

What

jbundle runs fine on Windows as a build host, but the binary it produces starts with #!/bin/sh, so a windows-x64 output never runs. Worse, on a Windows host windows-x64 is the default target, so a plain jbundle build quietly downloaded a Windows JDK and wrote a file that can't start. I think that's what bit people in #74.

Now --target windows-x64 (or no --target on a Windows host, or target = "windows-x64" in jbundle.toml) fails right away with the targets that do work and a link to #74. The platforms doc no longer lists windows-x64 as the Windows default.

Native Windows output needs its own launcher (a small .exe that finds its payload and extracts it), which is a bigger piece of work. I wrote up the plan on #74.

How it was tested

  • cargo test: 190 unit + 2 e2e passed, including the new windows_is_not_a_supported_output and unix_targets_are_supported_outputs.
  • cargo clippy --all-targets -- -D warnings and cargo fmt --check clean.
  • By hand: jbundle build --input a.jar --output out --target windows-x64 exits 1 with the new message before downloading anything.

Not tested by hand on a Windows machine. The windows-latest CI job runs the unit tests.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 16:14
@avelino avelino mentioned this pull request Oct 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The validation, tests, and documentation consistently implement the stated Windows output restriction.

0 open findings

What changed in this PR

Rejects unsupported Windows output targets before build processing while retaining Windows as a build host.

Changes:

  • Adds early target validation with actionable guidance.
  • Tests supported and unsupported output targets.
  • Clarifies Windows behavior in platform documentation.
File Description
src/​main.rs Validates the resolved target before building.
src/​config.rs Defines validation and unit tests.
docs/​reference/​platforms.md Documents the Windows target limitation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The launcher is a POSIX shell stub, so a windows-x64 binary never runs.
On a Windows host that was also the default target, so a plain
jbundle build quietly produced a file that can't start. Error out with
the targets that work and a pointer to #74.

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
@avelino
avelino force-pushed the avelino/fix/windows-target-error branch from 589aba4 to 0dcaa94 Compare October 16, 2026 11:03
@avelino
avelino merged commit c74d776 into main Oct 16, 2026
16 of 19 checks passed
@avelino
avelino deleted the avelino/fix/windows-target-error branch October 16, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants