From d2ba07047fe22801635a1b9def63007dc4b4c81c Mon Sep 17 00:00:00 2001 From: Benjamin Hillis <223556219+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 18:18:33 +0000 Subject: [PATCH 1/2] Switch system distro build to FreeRDP 3.x (3.26.0) Bump FREERDP_VERSION from 2 to 3 in the Dockerfile and adjust the FreeRDP cmake invocation for upstream FreeRDP 3.x defaults. Also fix a small WinPR API drift in WSLGd. Dockerfile: * ARG FREERDP_VERSION=2 -> =3 (also flips debuginfo strip target from FreeRDP2.list to FreeRDP3.list). * New cmake flags (each became REQUIRED-by-default in 3.x and is not desired for WSLg): - -DWITH_FFMPEG=OFF - -DWITH_DSP_FFMPEG=OFF - -DWITH_VIDEO_FFMPEG=OFF - -DWITH_SWSCALE=OFF - -DWITH_KRB5=OFF * The legacy -DWITH_CHANNEL_GFXREDIR=ON / -DWITH_CHANNEL_RDPAPPLIST=ON flags are dropped: WITH_CHANNEL_GFXREDIR is vestigial in upstream FreeRDP 3.x (the cmakedefine exists in config.h.in but is not set by any cmake logic), and rdpapplist is not a FreeRDP channel at all (the rdpapplist plugin is built standalone from wslg/rdpapplist/). Replaced with -DCHANNEL_GFXREDIR=ON which is the correct upstream knob for enabling the gfxredir dynamic channel (default OFF). WSLGd: * IniFile_GetSectionKeyNames(..., size_t* count) signature change in WinPR 3.x (was int*). Guarded with #if WINPR_VERSION_MAJOR >= 3 so the file still compiles against WinPR 2.x. Added explicit #include in precomp.h. This commit by itself is a no-op against the existing microsoft/FreeRDP-mirror (FreeRDP 2.4.0-era) used by CI. It activates once the corresponding wslg-build PR points the FreeRDP repo resource at FreeRDP/FreeRDP@3.26.0. Coordinated with: * microsoft/weston-mirror#163 -- ports the weston rdp-backend to FreeRDP 3.x server API * microsoft/wslg-build PR (to be opened) -- switches the FreeRDP repo resource from microsoft/FreeRDP-mirror to FreeRDP/FreeRDP Validation: end-to-end Docker build succeeds against FreeRDP 3.26.0; libfreerdp-server3.so.3.26.0 ships, exports gfxredir_server_context_ {new,free}, and rdp-backend.so links correctly against the 3.x libs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Dockerfile | 10 +++++++--- WSLGd/main.cpp | 6 +++++- WSLGd/precomp.h | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 829c9ef9..a508c8ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -137,7 +137,7 @@ ARG MESA_VERSION="" ARG PULSEAUDIO_COMMIT="" ARG WESTON_COMMIT="" ARG SYSTEMDISTRO_DEBUG_BUILD -ARG FREERDP_VERSION=2 +ARG FREERDP_VERSION=3 # Fail fast if any required --build-arg is missing or still holds a # placeholder value. We have to validate up-front because the values @@ -265,9 +265,13 @@ RUN cmake -G Ninja \ -DCMAKE_BUILD_TYPE=${BUILDTYPE_FREERDP} \ -DWITH_DEBUG_ALL=${WITH_DEBUG_FREERDP} \ -DWITH_ICU=ON \ + -DWITH_FFMPEG=OFF \ + -DWITH_DSP_FFMPEG=OFF \ + -DWITH_VIDEO_FFMPEG=OFF \ + -DWITH_SWSCALE=OFF \ + -DWITH_KRB5=OFF \ -DWITH_SERVER=ON \ - -DWITH_CHANNEL_GFXREDIR=ON \ - -DWITH_CHANNEL_RDPAPPLIST=ON \ + -DCHANNEL_GFXREDIR=ON \ -DWITH_CLIENT=OFF \ -DWITH_CLIENT_COMMON=OFF \ -DWITH_CLIENT_CHANNELS=OFF \ diff --git a/WSLGd/main.cpp b/WSLGd/main.cpp index accd8313..813162e7 100644 --- a/WSLGd/main.cpp +++ b/WSLGd/main.cpp @@ -165,9 +165,13 @@ void SetupOptionalEnv() wIniFile* wslgConfigIniFile = IniFile_New(); if (wslgConfigIniFile) { if (IniFile_ReadFile(wslgConfigIniFile, configFilePath.c_str()) > 0) { +#if WINPR_VERSION_MAJOR >= 3 + size_t numKeys = 0; +#else int numKeys = 0; +#endif char **keyNames = IniFile_GetSectionKeyNames(wslgConfigIniFile, c_systemDistroEnvSection, &numKeys); - for (int n = 0; keyNames && n < numKeys; n++) { + for (decltype(numKeys) n = 0; keyNames && n < numKeys; n++) { const char *value = IniFile_GetKeyValueString(wslgConfigIniFile, c_systemDistroEnvSection, keyNames[n]); if (value) { setenv(keyNames[n], value, true); diff --git a/WSLGd/precomp.h b/WSLGd/precomp.h index f18fc37b..442df012 100644 --- a/WSLGd/precomp.h +++ b/WSLGd/precomp.h @@ -35,5 +35,6 @@ #include "config.h" #include "lxwil.h" #if HAVE_WINPR +#include "winpr/version.h" #include "winpr/ini.h" #endif // HAVE_WINPR From 0dfa0ac23c803f97d2acb87802d2bb80394f0911 Mon Sep 17 00:00:00 2001 From: Ben Hillis Date: Tue, 19 May 2026 23:10:20 +0000 Subject: [PATCH 2/2] cgmanifest: bump FreeRDP commit to 3.26.0 (3f6d7cb1) The Dockerfile now builds against FreeRDP 3.26.0 (FREERDP_VERSION=3 + upstream FreeRDP source via wslg-build), but cgmanifest.json still listed the old 2.x commit 39f56443. This caused Component Governance scanning to report the wrong dependency version and would have raised false vulnerability alerts against retired FreeRDP 2.x. Update CommitHash to match the actual FreeRDP 3.26.0 release tag shipped in this image. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cgmanifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgmanifest.json b/cgmanifest.json index 04d5b651..031a9e9d 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -25,7 +25,7 @@ "Type": "git", "Git": { "RepositoryUrl": "https://github.com/FreeRDP/FreeRDP", - "CommitHash": "39f56443f2dc50e0dcfa52d4f8f15008d5b8ed8e" + "CommitHash": "3f6d7cb1f8973cc84c66b258a9a61c4e2b2f30a6" } }, "DevelopmentDependency": false