1
0
Fork 0

windows builder for buildbot

This commit is contained in:
Mikhail Goncharov 2023-10-05 13:37:06 +00:00
parent 9ee22a88c9
commit 97bd45070b
3 changed files with 21 additions and 20 deletions

View file

@ -3,7 +3,7 @@
# This experimental Windows container is meant to be used in Terraform deployment. # This experimental Windows container is meant to be used in Terraform deployment.
# Agent image for LLVM org cluster. # 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 FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
# Restore the default Windows shell for correct batch processing. # Restore the default Windows shell for correct batch processing.
@ -12,6 +12,8 @@ SHELL ["cmd", "/S", "/C"]
# Download the Build Tools bootstrapper. # Download the Build Tools bootstrapper.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe 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. # Download channel for fixed install.
ARG CHANNEL_URL=https://aka.ms/vs/16/release/channel ARG CHANNEL_URL=https://aka.ms/vs/16/release/channel
ADD ${CHANNEL_URL} C:\TEMP\VisualStudio.chman 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 # Register DIA dll (Debug Interface Access) so it can be used to symbolize
# the stack traces. Register dll for 32 and 64 bit. # 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 # 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" & ` RUN regsvr32 /S "C:\BuildTools\DIA SDK\bin\amd64\msdia140.dll" & `
regsvr32 /S "C:\BuildTools\DIA SDK\bin\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 # install tools as described in https://llvm.org/docs/GettingStartedVS.html
# and a few more that were not documented... # and a few more that were not documented...
RUN choco install -y ninja git 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. # handle for debugging of files beeing locked by some processes.
RUN choco install -y handle 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_agent.ps1 c:\scripts\
COPY start.sh 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"] CMD ["bash", "C:\\scripts\\start.sh"]

View file

@ -1,5 +1,17 @@
echo "buildbot windows entrypoint" 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 mkdir -p /c/ws/buildbbot
buildbot-worker create-worker /c/ws/buildbot $BUILDBOT_ADDRESS $BUILDBOT_NAME $BUILDBOT_PASSWORD
$@ $@

View file

@ -1,15 +1,5 @@
# Checkout path is set to a fixed short value (e.g. c:\ws\src) to keep paths # 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. # short as many tools break on Windows with paths longer than 250.
: ${WORKDIR:=/c/ws} echo "start buildbot"
echo "WORKDIR $WORKDIR" CC=cl CXX=cl LD=link buildbot-worker start /c/ws/buildbot
mkdir -p "$WORKDIR"
SCCACHE_DIR="$WORKDIR/sccache"
SCCACHE_IDLE_TIMEOUT="0"
SCCACHE_CACHE_SIZE=20G
sccache --start-server
whoami
env
tail -f