From 57ae2b1b77c5b2c25e044cc6f05b5e25bc52351e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 07:01:24 +0000 Subject: [PATCH 1/5] Fix Windows VC toolchain discovery in CI Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenDJ/sessions/59c77f8b-b1e8-451d-ae99-b5c438805581 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com> --- .github/workflows/build.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59c380de29..ad454642a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,10 +60,19 @@ jobs: 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 + 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 "VSINSTALLDIR=%%i" + if not defined VSINSTALLDIR ( + echo Unable to locate a Visual Studio installation with C++ build tools. + exit /b 1 + ) + call "%VSINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x86 + if errorlevel 1 exit /b %errorlevel% + pushd opendj-server-legacy\src\build-tools\windows nmake all + if errorlevel 1 exit /b %errorlevel% xcopy /Y *.exe ..\..\..\lib\ + if errorlevel 1 exit /b %errorlevel% + popd git status - name: Set Integration Test Environment id: failsafe From 21c658e4f1d7385f379ec7b971401677c0c376b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 07:02:01 +0000 Subject: [PATCH 2/5] Harden Windows native build workflow checks Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenDJ/sessions/59c77f8b-b1e8-451d-ae99-b5c438805581 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com> --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad454642a9..3c58d75ef4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,6 +60,10 @@ jobs: if: runner.os == 'Windows' shell: cmd run: | + if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( + echo Unable to locate vswhere.exe in the Visual Studio installer directory. + exit /b 1 + ) 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 "VSINSTALLDIR=%%i" if not defined VSINSTALLDIR ( echo Unable to locate a Visual Studio installation with C++ build tools. @@ -70,6 +74,10 @@ jobs: pushd opendj-server-legacy\src\build-tools\windows nmake all if errorlevel 1 exit /b %errorlevel% + if not exist *.exe ( + echo No Windows native executables were generated. + exit /b 1 + ) xcopy /Y *.exe ..\..\..\lib\ if errorlevel 1 exit /b %errorlevel% popd From 241ef88b4caf8773e7f75177223c62bbba765edf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 07:02:54 +0000 Subject: [PATCH 3/5] Tighten Windows native executable checks Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenDJ/sessions/59c77f8b-b1e8-451d-ae99-b5c438805581 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com> --- .github/workflows/build.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c58d75ef4..a7723c0454 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,10 +72,19 @@ jobs: call "%VSINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x86 if errorlevel 1 exit /b %errorlevel% pushd opendj-server-legacy\src\build-tools\windows + if errorlevel 1 exit /b %errorlevel% nmake all if errorlevel 1 exit /b %errorlevel% - if not exist *.exe ( - echo No Windows native executables were generated. + if not exist opendj_service.exe ( + echo Missing generated executable: opendj_service.exe + exit /b 1 + ) + if not exist winlauncher.exe ( + echo Missing generated executable: winlauncher.exe + exit /b 1 + ) + if not exist launcher_administrator.exe ( + echo Missing generated executable: launcher_administrator.exe exit /b 1 ) xcopy /Y *.exe ..\..\..\lib\ From 265d392ece420d86c26cb27d38b81e197e77492f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 07:16:49 +0000 Subject: [PATCH 4/5] Switch Windows native build from x86 to x64 Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenDJ/sessions/b9617c34-8ae7-4c63-bd59-85cc0ed53cf1 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- opendj-server-legacy/src/build-tools/windows/Makefile | 2 +- .../src/build-tools/windows/launcher_administrator.exe.manifest | 2 +- .../src/build-tools/windows/opendj_service.exe.manifest | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7723c0454..a6db0f7951 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,7 +69,7 @@ jobs: echo Unable to locate a Visual Studio installation with C++ build tools. exit /b 1 ) - call "%VSINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x86 + call "%VSINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" x64 if errorlevel 1 exit /b %errorlevel% pushd opendj-server-legacy\src\build-tools\windows if errorlevel 1 exit /b %errorlevel% diff --git a/opendj-server-legacy/src/build-tools/windows/Makefile b/opendj-server-legacy/src/build-tools/windows/Makefile index c1da51e953..38b5fc38b5 100644 --- a/opendj-server-legacy/src/build-tools/windows/Makefile +++ b/opendj-server-legacy/src/build-tools/windows/Makefile @@ -36,7 +36,7 @@ CC=cl SERVICE_PROGNAME=opendj_service.exe LAUNCHER_ADMINISTRATOR_PROGNAME=launcher_administrator.exe WINLAUNCHER_PROGNAME=winlauncher.exe -LINKER=link -nologo /machine:x86 +LINKER=link -nologo /machine:x64 LIBS=advapi32.lib CFLAGS= -D_WINDOWS -nologo -W3 -O2 diff --git a/opendj-server-legacy/src/build-tools/windows/launcher_administrator.exe.manifest b/opendj-server-legacy/src/build-tools/windows/launcher_administrator.exe.manifest index f0c7d11cfb..febba1d284 100644 --- a/opendj-server-legacy/src/build-tools/windows/launcher_administrator.exe.manifest +++ b/opendj-server-legacy/src/build-tools/windows/launcher_administrator.exe.manifest @@ -1,7 +1,7 @@ + processorArchitecture="amd64" name="launcher_administrator" type="win32"/> Executable used to run code that requires administrator privileges diff --git a/opendj-server-legacy/src/build-tools/windows/opendj_service.exe.manifest b/opendj-server-legacy/src/build-tools/windows/opendj_service.exe.manifest index 55d0c5fe84..1826a8eb97 100644 --- a/opendj-server-legacy/src/build-tools/windows/opendj_service.exe.manifest +++ b/opendj-server-legacy/src/build-tools/windows/opendj_service.exe.manifest @@ -1,7 +1,7 @@ + processorArchitecture="amd64" name="opendj_service" type="win32"/> Executable used to run OpenDJ as a Windows Service From fdbe14e2d11d881d6ef2cdd58ad73e6d235457d8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 07:38:52 +0000 Subject: [PATCH 5/5] Replace nmake with direct cl/link/mt/mc/rc invocations in Windows build step Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenDJ/sessions/5f514e2b-ec99-4877-afd0-cc15384d44e9 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com> --- .github/workflows/build.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6db0f7951..4903e3c0bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,7 +73,25 @@ jobs: if errorlevel 1 exit /b %errorlevel% pushd opendj-server-legacy\src\build-tools\windows if errorlevel 1 exit /b %errorlevel% - nmake all + mc EventLogMsg.mc + if errorlevel 1 exit /b %errorlevel% + rc /fo EventLogMsg.res EventLogMsg.rc + if errorlevel 1 exit /b %errorlevel% + cl -D_WINDOWS -nologo -W3 -O2 -c common.c -Focommon.obj + if errorlevel 1 exit /b %errorlevel% + cl -D_WINDOWS -nologo -W3 -O2 -c service.c -Foservice.obj + if errorlevel 1 exit /b %errorlevel% + cl -D_WINDOWS -nologo -W3 -O2 -c winlauncher.c -Fowinlauncher.obj + if errorlevel 1 exit /b %errorlevel% + link -nologo /machine:x64 /OUT:opendj_service.exe EventLogMsg.res common.obj service.obj advapi32.lib + if errorlevel 1 exit /b %errorlevel% + mt -manifest opendj_service.exe.manifest -outputresource:opendj_service.exe;#1 + if errorlevel 1 exit /b %errorlevel% + link -nologo /machine:x64 common.obj winlauncher.obj /OUT:winlauncher.exe + if errorlevel 1 exit /b %errorlevel% + link -nologo /machine:x64 common.obj winlauncher.obj /OUT:launcher_administrator.exe + if errorlevel 1 exit /b %errorlevel% + mt -manifest launcher_administrator.exe.manifest -outputresource:launcher_administrator.exe;#1 if errorlevel 1 exit /b %errorlevel% if not exist opendj_service.exe ( echo Missing generated executable: opendj_service.exe