-
Notifications
You must be signed in to change notification settings - Fork 5.1k
CAMEL-23703: tooling/camel-exe - native camel.exe bootstrap for Windows #24665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
davsclaus
merged 30 commits into
apache:main
from
ammachado:CAMEL-23703-native-camel-exe
Jul 15, 2026
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
3dd73b0
CAMEL-23703: camel-launcher - native x64 camel.exe bootstrap source
ammachado 290e488
CAMEL-23703: camel-launcher - document native camel.exe build
ammachado 27ac26d
CAMEL-23703: camel-launcher - Maven profiles to build and gate native…
ammachado cf4bb4a
CAMEL-23703: camel-launcher - include native camel.exe in bin archives
ammachado 6d4aaf2
CAMEL-23703: camel-launcher - Windows behavioral test for native came…
ammachado 0dd0340
CAMEL-23703: ci - build and test native camel.exe on Windows x64
ammachado 9606fb6
CAMEL-23703: docs - native camel.exe note in 4.22 upgrade guide
ammachado 177b0ee
CAMEL-23703: camel-launcher - apply formatter and impsort
ammachado cc65d96
CAMEL-23703: camel-launcher - build native camel.exe CI on JDK 21
ammachado 01f5f57
CAMEL-23703: tooling/camel-exe - split native bootstrap from camel-la…
ammachado ed887a2
CAMEL-23703: tooling/camel-exe - add module README
ammachado 3329b9f
CAMEL-23703: ci - replace paths-filter with git diff path detection
ammachado f3a184c
CAMEL-23703: fix Windows CI for camel-exe build and Unicode test
ammachado fdf8688
CAMEL-23703: apply formatter to camel-exe bootstrap test
ammachado 162f924
CAMEL-23703: fix Unicode test, remove duplicate fileSet, minor improv…
ammachado 3eadffa
CAMEL-23703: deduplicate camel-exe READMEs
ammachado e8e75db
CAMEL-23703: gate launcher camel.exe via release IT, drop CI job
ammachado 2a2e4d1
CAMEL-23703: harden camel.exe and CI from review feedback
ammachado b5449af
CAMEL-23703: apply formatter to launcher Windows exe IT
ammachado f81cda0
CAMEL-23703: add camel-launcher Windows CI job
ammachado 6fc500c
CAMEL-23703: exclude non-jar artifacts from camel-launcher self-execu…
ammachado a6c1d7a
CAMEL-23703: add temporary Defender diagnostics to camel-launcher-win…
ammachado c9effd8
CAMEL-23703: expand CI diagnostics for the missing bin/camel.exe
ammachado 915ba2c
CAMEL-23703: build camel-launcher-windows with mvnd for parallel reactor
ammachado a42301a
CAMEL-23703: fix cmd quoting for vcvars64 capture in mvnd step
ammachado 95c38a9
CAMEL-23703: revert camel-launcher-windows to plain mvn build
ammachado 3182ecd
CAMEL-23703: fix bin/camel.exe archive assertion to match assembly ba…
ammachado f76de4f
CAMEL-23703: fix exact-path zip lookup in CamelLauncherWindowsExeIT
ammachado 8134495
CAMEL-23703: address review feedback on PR #24665
ammachado b7ab7be
Update docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_2…
davsclaus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You 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 | ||
| # | ||
| # http://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. | ||
| # | ||
|
|
||
| name: Camel launcher Windows build | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| detect-changes: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| camel-exe: ${{ steps.changes.outputs.camel-exe }} | ||
| camel-launcher: ${{ steps.changes.outputs.camel-launcher }} | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| # 50 commits covers any reasonable push batch; PRs fetch the base ref below. | ||
| fetch-depth: 50 | ||
| - id: changes | ||
| run: | | ||
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||
| echo "camel-exe=true" >> "$GITHUB_OUTPUT" | ||
| echo "camel-launcher=true" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
|
|
||
| if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
| git fetch origin "${{ github.base_ref }}" --depth=1 | ||
| CHANGED="$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD)" | ||
| else | ||
| CHANGED="$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}")" | ||
| fi | ||
|
|
||
| echo "Changed files:" | ||
| echo "$CHANGED" | ||
|
|
||
| camel_exe=false | ||
| camel_launcher=false | ||
|
|
||
| if echo "$CHANGED" | grep -qE '^(tooling/camel-exe/|\.github/workflows/camel-launcher-windows\.yml)'; then | ||
| camel_exe=true | ||
| fi | ||
|
|
||
| if echo "$CHANGED" | grep -qE '^(dsl/camel-jbang/camel-launcher/|tooling/camel-exe/|\.github/workflows/camel-launcher-windows\.yml)'; then | ||
| camel_launcher=true | ||
| fi | ||
|
|
||
| echo "camel-exe=$camel_exe" >> "$GITHUB_OUTPUT" | ||
| echo "camel-launcher=$camel_launcher" >> "$GITHUB_OUTPUT" | ||
|
|
||
| camel-exe: | ||
| needs: detect-changes | ||
| if: github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.camel-exe == 'true' | ||
| runs-on: windows-2022 | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '21' | ||
| cache: 'maven' | ||
| - name: Build and test native camel.exe | ||
| shell: cmd | ||
| run: | | ||
| for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSINSTALL=%%i" | ||
| call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" | ||
| mvn -B -ntp -pl buildingtools install -DskipTests | ||
| mvn -B -ntp -pl tooling/camel-exe verify -Dcamel.exe.requireWindowsExe=true | ||
|
|
||
| camel-launcher-windows: | ||
| needs: detect-changes | ||
| if: github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.camel-launcher == 'true' | ||
| runs-on: windows-2022 | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '21' | ||
| cache: 'maven' | ||
| - name: Build launcher with native camel.exe | ||
| shell: cmd | ||
| run: | | ||
| for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSINSTALL=%%i" | ||
| call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" | ||
| mvn -B -ntp -pl buildingtools,tooling/camel-exe,dsl/camel-jbang/camel-launcher -am install -DskipTests -Dcamel.launcher.requireWindowsExe=true | ||
| - name: Assert archive carries bin/camel.exe | ||
| shell: pwsh | ||
| run: | | ||
| $zip = Get-ChildItem dsl/camel-jbang/camel-launcher/target/camel-launcher-*-bin.zip | Select-Object -First 1 | ||
| Add-Type -AssemblyName System.IO.Compression.FileSystem | ||
| $archive = [System.IO.Compression.ZipFile]::OpenRead($zip.FullName) | ||
| try { | ||
| $names = $archive.Entries.FullName | ||
| if (-not ($names -like '*/bin/camel.exe')) { throw 'camel.exe missing from launcher archive' } | ||
| } finally { | ||
| $archive.Dispose() | ||
| } |
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
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
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
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
77 changes: 77 additions & 0 deletions
77
...launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelLauncherWindowsExeIT.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You 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 | ||
| * | ||
| * http://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. | ||
| */ | ||
| package org.apache.camel.dsl.jbang.launcher; | ||
|
|
||
| import java.io.IOException; | ||
| import java.nio.file.Files; | ||
| import java.nio.file.Path; | ||
| import java.nio.file.Paths; | ||
| import java.util.stream.Stream; | ||
| import java.util.zip.ZipEntry; | ||
| import java.util.zip.ZipFile; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
| import org.junit.jupiter.api.condition.EnabledIfSystemProperty; | ||
| import org.junit.jupiter.api.condition.EnabledOnOs; | ||
| import org.junit.jupiter.api.condition.OS; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
| import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
|
||
| /** | ||
| * Release gate for the native {@code camel.exe} packaged into the launcher distribution. Runs during {@code verify} | ||
| * when {@code -Dcamel.launcher.requireWindowsExe=true} is set on a Windows x64 host. | ||
| */ | ||
| @EnabledOnOs(OS.WINDOWS) | ||
| @EnabledIfSystemProperty(named = "camel.launcher.requireWindowsExe", matches = "true") | ||
| class CamelLauncherWindowsExeIT { | ||
|
|
||
| private static final Path TARGET = Paths.get("target"); | ||
| private static final Path STAGED_EXE = TARGET.resolve("camel.exe"); | ||
|
|
||
| @Test | ||
| void stagedCamelExeExists() { | ||
| assertTrue(Files.isRegularFile(STAGED_EXE), | ||
| "target/camel.exe must be present before packaging the launcher distribution"); | ||
| } | ||
|
|
||
| @Test | ||
| void binArchiveIncludesCamelExe() throws IOException { | ||
| Path zip = findBinZip(); | ||
| assertNotNull(zip, "camel-launcher-*-bin.zip must be produced by the assembly plugin"); | ||
|
|
||
| try (ZipFile archive = new ZipFile(zip.toFile())) { | ||
| // maven-assembly-plugin defaults includeBaseDirectory to true, so entries are | ||
| // nested under camel-launcher-<version>/, not at the archive root. | ||
| ZipEntry entry = archive.stream() | ||
| .filter(e -> e.getName().endsWith("/bin/camel.exe")) | ||
| .findFirst() | ||
| .orElse(null); | ||
| assertNotNull(entry, "bin/camel.exe must be included in " + zip.getFileName()); | ||
| assertTrue(entry.getSize() > 0, "bin/camel.exe must not be empty"); | ||
| } | ||
| } | ||
|
|
||
| private static Path findBinZip() throws IOException { | ||
| try (Stream<Path> paths = Files.list(TARGET)) { | ||
| return paths | ||
| .filter(p -> p.getFileName().toString().matches("camel-launcher-.*-bin\\.zip")) | ||
| .findFirst() | ||
| .orElse(null); | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[LOW]
archive.getEntry("bin/camel.exe")uses an exact path, but the assembly descriptor (bin.xml) does not set<includeBaseDirectory>false</includeBaseDirectory>— Maven Assembly Plugin defaults totrue, which prefixes entries withcamel-launcher-VERSION-bin/. This meansgetEntry("bin/camel.exe")would return null.The CI PowerShell assertion handles this correctly with wildcard matching (
*/bin/camel.exe). Consider iterating entries with a suffix match here as well, or settingincludeBaseDirectorytofalsein the assembly descriptor if that's the intended layout.This test is double-gated (
@EnabledOnOs(OS.WINDOWS)+@EnabledIfSystemProperty) so it doesn't affect CI, but would fail for a developer runningmvn verify -Dcamel.launcher.requireWindowsExe=trueon Windows.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, same root cause as the CI assertion bug, fixed in f76de4f (suffix match instead of exact
bin/camel.exelookup, sinceincludeBaseDirectorydefaults totruein the assembly descriptor).While digging into this I found a bigger gap worth flagging: the official release pipeline (
Jenkinsfile.deploy) runs onubuntu, andbuild-windows-exe/include-camel-exeonly activate via<os><family>windows</family>. Neithercamel.exe.requireWindowsExenorcamel.launcher.requireWindowsExeis set anywhere in that pipeline, so on an actual release the native compile is skipped, thecamel.exefileSet inbin.xmlmatches nothing, and the releasedcamel-launcher-*-bin.zipships withoutcamel.exe, no error, just silently missing. That would break the Winget packaging from the other PR.@davsclaus since you know the release process better than I do: is there already a place a Windows-hosted build step could hook into (e.g. a separate agent on the release Jenkins job), or should this be a post-release GitHub Actions job that builds the Windows artifact and uploads it alongside the rest of the release? Happy to put a PR together once there's a direction.
Claude Code on behalf of @ammachado
AI-generated review, so it may get things wrong. Please check any suggestion before you act on it.