From 97bd45070b3625daf2a481be0bbdeda0e18056e4 Mon Sep 17 00:00:00 2001 From: Mikhail Goncharov Date: Thu, 5 Oct 2023 13:37:06 +0000 Subject: [PATCH] windows builder for buildbot --- containers/buildbot-windows/Dockerfile | 15 +++++++-------- containers/buildbot-windows/entrypoint.sh | 12 ++++++++++++ containers/buildbot-windows/start.sh | 14 ++------------ 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/containers/buildbot-windows/Dockerfile b/containers/buildbot-windows/Dockerfile index 5e6c919..993b981 100644 --- a/containers/buildbot-windows/Dockerfile +++ b/containers/buildbot-windows/Dockerfile @@ -3,7 +3,7 @@ # This experimental Windows container is meant to be used in Terraform deployment. # Agent image for LLVM org cluster. -# maybe mcr.microsoft.com/windows/servercore:ltsc2022? +# .net 4.8 is required by chocolately package manager. FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 # Restore the default Windows shell for correct batch processing. @@ -12,6 +12,8 @@ SHELL ["cmd", "/S", "/C"] # Download the Build Tools bootstrapper. ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe +RUN powershell -Command Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + # Download channel for fixed install. ARG CHANNEL_URL=https://aka.ms/vs/16/release/channel ADD ${CHANNEL_URL} C:\TEMP\VisualStudio.chman @@ -35,14 +37,10 @@ RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache ` # Register DIA dll (Debug Interface Access) so it can be used to symbolize # the stack traces. Register dll for 32 and 64 bit. # see https://developercommunity.visualstudio.com/content/problem/290674/msdia140dll-is-not-registered-on-vs2017-hosts.html + RUN regsvr32 /S "C:\BuildTools\DIA SDK\bin\amd64\msdia140.dll" & ` regsvr32 /S "C:\BuildTools\DIA SDK\bin\msdia140.dll" -# install chocolately as package manager -RUN powershell -NoProfile -InputFormat None -Command ` - iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) ; ` - choco feature disable --name showDownloadProgress - # install tools as described in https://llvm.org/docs/GettingStartedVS.html # and a few more that were not documented... RUN choco install -y ninja git @@ -112,9 +110,10 @@ RUN git config --system core.longpaths true & ` # handle for debugging of files beeing locked by some processes. RUN choco install -y handle -RUN pip3 install buildbot-worker==2.8.4 +RUN pip3 install pywin32 buildbot-worker==2.8.4 # COPY start_agent.ps1 c:\scripts\ COPY start.sh c:\scripts\ -ENTRYPOINT ["bash", "entrypoint.sh"] +COPY entrypoint.sh c:\scripts\ +ENTRYPOINT ["bash", "c:\\scripts\\entrypoint.sh"] CMD ["bash", "C:\\scripts\\start.sh"] \ No newline at end of file diff --git a/containers/buildbot-windows/entrypoint.sh b/containers/buildbot-windows/entrypoint.sh index 7f3a402..65cb3d5 100644 --- a/containers/buildbot-windows/entrypoint.sh +++ b/containers/buildbot-windows/entrypoint.sh @@ -1,5 +1,17 @@ echo "buildbot windows entrypoint" +: ${WORKDIR:=/c/ws} +echo "WORKDIR $WORKDIR" +mkdir -p "$WORKDIR" +echo "starting sccache" +export SCCACHE_DIR="$WORKDIR/sccache" +export SCCACHE_IDLE_TIMEOUT="0" +export SCCACHE_CACHE_SIZE=20G +sccache --start-server +sccache --show-stats + +echo "configure buildbot" mkdir -p /c/ws/buildbbot +buildbot-worker create-worker /c/ws/buildbot $BUILDBOT_ADDRESS $BUILDBOT_NAME $BUILDBOT_PASSWORD $@ \ No newline at end of file diff --git a/containers/buildbot-windows/start.sh b/containers/buildbot-windows/start.sh index 9b9fa2b..8a4d3e3 100644 --- a/containers/buildbot-windows/start.sh +++ b/containers/buildbot-windows/start.sh @@ -1,15 +1,5 @@ # Checkout path is set to a fixed short value (e.g. c:\ws\src) to keep paths # short as many tools break on Windows with paths longer than 250. -: ${WORKDIR:=/c/ws} -echo "WORKDIR $WORKDIR" -mkdir -p "$WORKDIR" - -SCCACHE_DIR="$WORKDIR/sccache" -SCCACHE_IDLE_TIMEOUT="0" -SCCACHE_CACHE_SIZE=20G -sccache --start-server - -whoami -env -tail -f \ No newline at end of file +echo "start buildbot" +CC=cl CXX=cl LD=link buildbot-worker start /c/ws/buildbot \ No newline at end of file