From d7879f29e9372699d5799ca9f319d8dec0e6eb39 Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Mon, 21 Sep 2026 00:21:12 +0200 Subject: [PATCH] THRIFT-6315: Correct the Windows Docker documentation Client: build The MSVC container directory was renamed from build/docker/msvc2017 to build/docker/msvc, and the paths naming it were not updated. doc/ReleaseManagement.md had a broken relative link, and the README in that directory told the reader to run commands against paths that do not exist, six times. Three other things in that README had also gone stale. It said to pull thrift/thrift-build:msvc2017 from Docker Hub. That repository carries the Linux images only - its tags are ubuntu-*, debian-* and centos - so the pull could not have worked. The MSVC workflow builds the image itself and caches it in GHCR under a tag derived from the hash of the Dockerfile and the scripts it copies, which is now what the README describes. The build context is build\, not the Dockerfile's own directory, which was not said anywhere and is easy to get wrong. It said the compiler is statically linked and depends only on KERNEL32.DLL. That stopped being true when the project moved away from a statically linked compiler; THRIFT-6320 corrected the same claim in ReleaseManagement.md. The README now says what is actually expected - the Visual C++ redistributable, and nothing else beyond Windows system DLLs - and points at check-compiler-imports.ps1 and the compiler-windows job, which check it on every push. It said the image is "just under 30GB" and that things should improve "once Microsoft supports build tools in nano". THRIFT-5952 and THRIFT-6237 have both worked on the size since, so the number is not one to quote; it says the image is large and leaves it there. Co-Authored-By: Claude Opus 5 (1M context) --- build/docker/msvc/README.md | 45 ++++++++++++++++++++----------------- doc/ReleaseManagement.md | 2 +- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/build/docker/msvc/README.md b/build/docker/msvc/README.md index 0c882d74758..ce9f80f3cd0 100644 --- a/build/docker/msvc/README.md +++ b/build/docker/msvc/README.md @@ -1,17 +1,19 @@ # Building Thrift using Docker for Windows -The build image is very large (just under 30GB) so plan accordingly. -Once Microsoft supports build tools in nano, it should get better. +The build image is large, so plan accordingly. -Install Docker for Windows and switch to Windows container mode. +Install Docker for Windows and switch to Windows container mode, then build the +image from this directory's Dockerfile. Note that the build context is `build\`, +not the directory the Dockerfile is in, because the image also copies scripts +from `build\appveyor\`: -Pull from docker hub: + PS C:\Thrift> docker build -t thrift-build:msvc -f build\docker\msvc\Dockerfile build\ - PS C:\> docker pull thrift/thrift-build:msvc2017 - -or build in a docker for windows environment: - - PS C:\Thrift> docker build -t thrift/thrift-build:msvc2017 -f build\docker\msvc2017\Dockerfile build\ +There is no image to pull: the `thrift/thrift-build` repository on Docker Hub +carries the Linux images only. The `MSVC Build` GitHub Actions workflow builds +this image itself and caches it in GHCR under a tag derived from the hash of the +Dockerfile and the scripts it copies, so a run only rebuilds it when one of +those changes. See [`.github/workflows/msvc.yml`](../../../.github/workflows/msvc.yml). The following directories are used inside the container: @@ -23,22 +25,25 @@ You can override these as docker volumes if desired. ### Compiler -To build a portable windows thrift compiler (with a statically linked -runtime) and get it placed into C:\install: +To build the windows thrift compiler and get it placed into C:\install: docker run -v C:\thrift:C:\thrift^ -v C:\install:C:\install^ - --rm -t thrift/thrift-build:msvc2017^ - C:\thrift\build\docker\msvc2017\build-compiler.bat + --rm -t thrift-build:msvc^ + C:\thrift\build\docker\msvc\build-compiler.bat -The end result is a portable windows thrift compiler located at +The end result is at C:\Install\bin\thrift.exe -If you run it through the [Dependency Walker](http://www.dependencywalker.com/) -you will see it only depends on KERNEL32.DLL which means the runtime is statically -linked, so the executable is portable and self-contained. This is how the -windows thrift compiler is built for each Apache Thrift release. +It is a single self-contained executable, but it is not statically linked: it +needs the Visual C++ redistributable, which the ASF does not ship. Beyond that +it must depend on nothing but Windows system DLLs - no Boost, OpenSSL, zlib or +libevent. `build\windows\check-compiler-imports.ps1` checks exactly that, and +the `compiler-windows` job in +[`.github/workflows/cmake.yml`](../../../.github/workflows/cmake.yml) runs it on +every push. See [`doc/ReleaseManagement.md`](../../../doc/ReleaseManagement.md) +for how the compiler is built for a release. ### Libraries @@ -46,5 +51,5 @@ To build, test everything and get the C++ SDK placed into C:\install: docker run -v C:\thrift:C:\thrift^ -v C:\install:C:\install^ - -m 4096 --rm -t thrift/thrift-build:msvc2017^ - C:\thrift\build\docker\msvc2017\build.bat \ No newline at end of file + -m 4096 --rm -t thrift-build:msvc^ + C:\thrift\build\docker\msvc\build.bat diff --git a/doc/ReleaseManagement.md b/doc/ReleaseManagement.md index c30e7f6113b..ad814fdb549 100644 --- a/doc/ReleaseManagement.md +++ b/doc/ReleaseManagement.md @@ -193,7 +193,7 @@ All Apache Thrift releases go through a 72-hour final release candidate voting p C:\build> cmake --build . --config Release ``` - - Using [Docker for Windows](../build/docker/msvc2017/README.md), follow the instructions for building the compiler. + - Using [Docker for Windows](../build/docker/msvc/README.md), follow the instructions for building the compiler. - In both cases: 1. Verify that the executable depends only on Windows system DLLs and on the Visual C++ runtime, and on nothing else - no Boost, OpenSSL, zlib or libevent: