Skip to content

CI: Build and upload Windows native executables (winlauncher, opendj_service, launcher_administrator)#611

Merged
vharseko merged 11 commits intomasterfrom
copilot/add-windows-native-executables
Apr 1, 2026
Merged

CI: Build and upload Windows native executables (winlauncher, opendj_service, launcher_administrator)#611
vharseko merged 11 commits intomasterfrom
copilot/add-windows-native-executables

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

  • Move "Build Windows native executables" step to before "Set Integration Test Environment"
  • Merge branch copilot/fix-30845478-106611094-d429e1a9-dbd5-4b36-b891-14c7551bd9c5 (Windows service start/stop CI test) — conflict resolved by combining both sides
Original prompt

Problem

The C source files in opendj-server-legacy/src/build-tools/windows/ (winlauncher.c, service.c, common.c, etc.) produce three Windows executables (winlauncher.exe, opendj_service.exe, launcher_administrator.exe) via a Makefile that uses MSVC (cl, link, rc, mc, mt). Currently the GitHub Actions workflow .github/workflows/build.yml does not compile these native Windows executables during CI.

Required Changes

Modify .github/workflows/build.yml to add two new steps to the build-maven job, both conditional on runner.os == 'Windows':

Step 1: "Build Windows native executables"

This step should:

  • Run only when runner.os == 'Windows'
  • Set up the MSVC environment using vcvarsall.bat (available on windows-latest runners at the path provided by the VCINSTALLDIR env var, or by using "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86)
  • Change directory to opendj-server-legacy/src/build-tools/windows/
  • Run nmake all to build all three executables: winlauncher.exe, opendj_service.exe, launcher_administrator.exe
  • Use shell: cmd since MSVC vcvarsall.bat requires cmd environment

The step should look something like:

    - name: Build Windows native executables
      if: runner.os == 'Windows'
      shell: cmd
      run: |
        call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
        cd opendj-server-legacy\src\build-tools\windows
        nmake all

Step 2: "Upload Windows exe artifacts"

This step should:

  • Run only when runner.os == 'Windows'
  • Use actions/upload-artifact@v4
  • Have a distinct artifact name like windows-exe-${{ matrix.java }} (to avoid name conflicts with the existing upload step)
  • Set retention-days: 5 (consistent with the existing upload step)
  • Upload all *.exe files from opendj-server-legacy/src/build-tools/windows/ directory
    - name: Upload Windows exe artifacts
      if: runner.os == 'Windows'
      uses: actions/upload-artifact@v4
      with:
        name: windows-exe-${{ matrix.java }}
        retention-days: 5
        path: opendj-server-legacy/src/build-tools/windows/*.exe

Placement

Both new steps should be placed after the "Test on Windows" step (line 218-236) and before the existing "Upload artifacts OpenDJ Server" step (line 237-252). This ensures the native build happens after the Maven build has completed (which produces the package) and the upload is separate from the main artifact upload.

Summary of expected executables

The Makefile (opendj-server-legacy/src/build-tools/windows/Makefile) produces:

  • winlauncher.exe — launcher for command-line tools
  • opendj_service.exe — Windows service executable
  • launcher_administrator.exe — launcher requiring admin privileges (Vista UAC)

All three should appear in the uploaded artifact.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: добавь сборку под Windows opendj-server-legacy/src/build-tools
/windows, а полученные артефакты *.exe присоединить actions/upload-artifact@v4

Assistant:

Let me first examine the current build workflow and the Windows build tools directory to understand what needs to be added.

Assistant: Now let me also check the full Makefile to understand how the build works:

Assistant: Теперь у меня есть полная картина. Давайте разберёмся:

В директории opendj-server-legacy/src/build-tools/windows/ находятся исходники на C, которые через Makefile (с использованием nmake и Visual C++ / MSVC) собираются в 3 исполняемых файла:

  • winlauncher.exe
  • opendj_service.exe
  • launcher_administrator.exe

Текущий Makefile использует cl (MSVC compiler) и link, rc, mc, mt утилиты.

Вы хотите, чтобы я создал PR, который:

  1. Добавит шаг сборки этих .exe файлов из opendj-server-legacy/src/build-tools/windows/ в workflow build.yml (на windows-latest runners)
  2. Добавит полученные *.exe артефакты в actions/upload-artifact@v4

Хотите ли вы, чтобы я создал pull request с этими изменениями в OpenIdentityPlatform/OpenDJ?

Также уточню несколько моментов:

  • Текущий Makefile использует nmake с MSVC (cl). На windows-latest runners в GitHub Actions доступен MSVC через vcvarsall.bat. Сборку нужно делать через nmake all с предварительной настройкой MSVC environment. Это верно?
  • Шаг сборки .exe должен выполняться только на windows-latest (if: runner.os == 'Windows')?
  • Артефакты *.exe нужно добавить в уже существующий шаг Upload artifacts OpenDJ Server или создать отдельный upload шаг?

User: 1 да 2 да 3 отдельный только для Windows

Assistant: I've submitted a request to the Copilot coding agent to create a pull request in OpenIdentityPlatform/OpenDJ. The PR will add two new steps to .github/workflows/build.yml (both conditional on runner.os == 'Windows'):

  1. **"Build Windows n...

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Add steps to build Windows native executables in CI CI: Build and upload Windows native executables (winlauncher, opendj_service, launcher_administrator) Mar 31, 2026
Copilot AI requested a review from vharseko March 31, 2026 19:22
…429e1a9-dbd5-4b36-b891-14c7551bd9c5' into copilot/add-windows-native-executables

# Conflicts:
#	.github/workflows/build.yml

Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
@vharseko vharseko marked this pull request as ready for review April 1, 2026 07:39
Added git status command to the build process.
@vharseko vharseko requested a review from maximthomas April 1, 2026 08:07
@vharseko vharseko merged commit c3dab3b into master Apr 1, 2026
20 of 30 checks passed
@vharseko vharseko deleted the copilot/add-windows-native-executables branch April 1, 2026 08:53
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.

3 participants