Syntax: Build R-Interface with Rtools45 static toolchain - #6269
Conversation
21eff1c to
485ea00
Compare
| assert(_engineSync != nullptr && _preferences != nullptr); | ||
|
|
||
| static boost::iostreams::stream<boost::iostreams::null_sink> nullstream((boost::iostreams::null_sink())); //https://stackoverflow.com/questions/8243743/is-there-a-null-stdostream-implementation-in-c-or-libraries | ||
| std::ostream & nullstream = nullOutputStream(); |
There was a problem hiding this comment.
This nullOutputStream looks like a the second/ third answer of https://stackoverflow.com/questions/8243743/is-there-a-null-stdostream-implementation-in-c-or-libraries
It's kinda nice because it drops a boost dependency I guess but not really mandatory for this PR.
@JorisGoosen any thoughts on this?
|
also, if this works we should check if we can simplify the build guide because people on Windows won't need to do anything special anymore beyond installing Rtools. |
485ea00 to
d650746
Compare
|
For reference, this came up here: https://github.com/jasp-stats/jaspSyntax/actions/runs/28031244975/job/82972218848?pr=9 We install custom stuff via Rtools on windows, see Those were not statically linked along, and an agent told me that wasn't possible either. We could ship additional Rtools dlls on windows only, but making this unnecessary seemed like a more appropriate solution. |
|
@FBartos For your AI: This step on windows CI still installs those custom Rtools libraries that are exactly the ones that we're trying to avoid. So we're not actually sure whether the current PR fixes this! Please remove that step, check if CI passes, and fix any errors that may appear. |
|
This should now address the Rtools concern. The broad Windows I also updated the Windows build guide to reflect the split:
Checks are green on head |
|
@vandenman I think this should now fully cover your concern about the Windows CI still installing the Rtools/UCRT libraries we were trying to prove unnecessary. What changed:
The current head is |
Why
The Windows R-Interface build was using the MSYS2 UCRT64 dynamic compiler path (
C:/rtools45/ucrt64/bin/gcc.exe). That produced R-Interface DLLs with runtime imports such aslibgcc_s_seh-1.dll,libstdc++-6.dll, andlibwinpthread-1.dll.That is the wrong contract for installed Windows binaries: CRAN documents that Rtools is not required for installing binary packages, and Rtools45 provides the static toolchain under
C:/rtools45/x86_64-w64-mingw32.static.posixfor this use case.The Windows workflow also assumed Visual Studio 2022 paths while running on
windows-latest. On the current GitHub image,windows-latestresolved to a VS 2026 image, so configure failed before tests because the expected VS 2022 CRT merge module path did not exist.What changed
windows-2022, matching the existing VS 2022 path assumptions and Qtwin64_msvc2022_64package.RTOOLS_PATHfor the existing UCRT64 package/library assets.RTOOLS_STATIC_TOOLCHAIN_PATHfor the official Rtools45 static compiler toolchain.RTOOLS_BUILD_TOOLS_PATHfor MSYS build tools such asmake.exe.R-Interfaceproject with:C:/rtools45/x86_64-w64-mingw32.static.posix/bin/gcc.exeC:/rtools45/x86_64-w64-mingw32.static.posix/bin/g++.exeC:/rtools45/usr/bin/make.exeUnix Makefileslibgcc,libstdc++, orlibwinpthread.windeployqtexecutable from the configured Qt prefix instead of whichever Qt install appears first on PATH.cmake --install build --prefix ...deploy into the requested staging folder.Verification
Local Windows verification on Rtools45 and Qt 6.10.2 MSVC:
C:/Qt/6.10.2/msvc2022_64, andC:/rtools45/ucrt64.C:/rtools45/x86_64-w64-mingw32.static.posixas the R-Interface compiler toolchain.C:/rtools45/usr/bin/make.exeas the R-Interface make program.C:/Qt/6.10.2/msvc2022_64/bin/windeployqt.exefor deployment.cmake --build build --target allsucceeds.objdump -pon bothlibR-Interface.dllandlibR-InterfaceNoRInside.dllshows no imports matchinglibgcc,libstdc++, orlibwinpthread.dyn.load()succeeds for both R-Interface DLLs from the bundled R.Qt6WebEngineQuick.dll,Qt6WebEngineCore.dll, andQtWebEngineProcess.exe, resolving the missingQt6WebEngineQuick.dllissue when running the installed copy.CI failures addressed:
Microsoft_VC143_CRT_x64.msm cannot be foundbecausewindows-latesthad moved to a VS 2026 runner while the workflow passed VS 2022 paths. This PR now pins the job towindows-2022.References: