Build:
  1. 1
  2. 0
2024-06-10 17:41.05: New job: Build using windows-x86_64 in
                                [https://github.com/ocaml-opam/opam-repository-mingw#sunset (69dbd0eda2e75b7085cff45755111c73a7a42d1a)]
2024-06-10 17:41.05: Will push staging image to ocurrent/opam-staging:windows-server-msvc-ltsc2022-opam-amd64

Dockerfile:

# escape=`

# Autogenerated by OCaml-Dockerfile scripts
FROM mcr.microsoft.com/windows/server:10.0.20348.2461 as winget-builder
USER ContainerAdministrator
ADD [ "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle", "C:\\TEMP\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.zip" ]
RUN powershell -Command "Expand-Archive -LiteralPath C:\TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.zip -DestinationPath C:\TEMP\winget-cli -Force"
RUN ren C:\TEMP\winget-cli\AppInstaller_x64.msix AppInstaller_x64.zip
RUN powershell -Command "Expand-Archive -LiteralPath C:\TEMP\winget-cli\AppInstaller_x64.zip -DestinationPath C:\TEMP\winget-cli\ -Force"
RUN mkdir "C:\Program Files\winget-cli" && `
  move "C:\TEMP\winget-cli\\winget.exe" "C:\Program Files\winget-cli\" && `
  move "C:\TEMP\winget-cli\\WindowsPackageManager.dll" "C:\Program Files\winget-cli\" && `
  move "C:\TEMP\winget-cli\\resources.pri" "C:\Program Files\winget-cli\"

FROM mcr.microsoft.com/windows/server:10.0.20348.2461 as cygwin-msvc
USER ContainerAdministrator
RUN for /f "tokens=1,2,*" %a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V Path ^| findstr /r "\\$"') do `
          for /f "delims=" %l in ('cmd /v:on /c "set v=%c&& echo !v:~0,-1!"') do `
            reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V Path /t REG_EXPAND_SZ /f /d "%l"
ADD [ "https://raw.githubusercontent.com/ocurrent/ocaml-dockerfile/master/src-opam/Install.cmd", "C:\\TEMP\\" ]
ADD [ "https://aka.ms/vscollect.exe", "C:\\TEMP\\collect.exe" ]
ADD [ "https://aka.ms/vs/17/release/channel", "C:\\TEMP\\VisualStudio.chman" ]
RUN curl -SL --output C:\TEMP\vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe `
    && (call C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache install `
        --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" `
        --channelUri C:\TEMP\VisualStudio.chman `
        --installChannelUri C:\TEMP\VisualStudio.chman `
        --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
        --add Microsoft.VisualStudio.Component.Windows10SDK.18362 `
        --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
        --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
        --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
        --remove Microsoft.VisualStudio.Component.Windows81SDK) `
    && del /q C:\TEMP\vs_buildtools.exe
ENV CYGWIN="nodosfilewarning winsymlinks:native"
RUN for /f "tokens=1,2,*" %a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V Path ^| findstr /r "^[^H]"') do `
        reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V Path /t REG_EXPAND_SZ /f /d "C:\cygwin64\bin;%c"
ADD [ "https://www.cygwin.com/setup-x86_64.exe", "C:\\cygwin64\\setup-x86_64.exe" ]
RUN mkdir C:\cygwin64\lib\cygsympathy && mkdir C:\cygwin64\etc\postinstall
ADD [ "https://raw.githubusercontent.com/metastack/cygsympathy/master/cygsympathy.cmd", "C:\\cygwin64\\lib\\cygsympathy\\" ]
ADD [ "https://raw.githubusercontent.com/metastack/cygsympathy/master/cygsympathy.sh", "C:\\cygwin64\\lib\\cygsympathy\\cygsympathy" ]
RUN mklink C:\cygwin64\etc\postinstall\zp_zcygsympathy.sh C:\cygwin64\lib\cygsympathy\cygsympathy
RUN C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --no-startmenu --no-desktop --only-site --local-package-dir C:\TEMP\cache --root C:\cygwin64 --site https://mirrors.kernel.org/sourceware/cygwin/ --symlink-type=native --packages diffutils,git,make,patch && `
  powershell -Command "Remove-Item 'C:\TEMP' -Recurse"
ADD [ "https://github.com/metastack/msvs-tools/archive/refs/heads/master.tar.gz", "C:\\TEMP\\msvs-tools.tar.gz" ]
RUN C:\cygwin64\bin\bash.exe --login -c "cd /tmp && tar -xf /cygdrive/c/TEMP/msvs-tools.tar.gz && cp msvs-tools-master/msvs-detect msvs-tools-master/msvs-promote-path /bin && rm -rf /cygdrive/c/TEMP/msvs-tools/*"
RUN awk -i inplace "/(^#)|(^$)/{print;next}{$4=""noacl,""$4; print}" C:\cygwin64\etc\fstab

FROM cygwin-msvc as opam-builder
ENV HOME="C:\cygwin64\home\opam"
RUN C:\cygwin64\bin\bash.exe --login -c "git config --global user.email 'docker@example.com' && git config --global user.name 'Docker' && git config --system core.longpaths true && git config --global --add safe.directory /tmp/opam-sources"
RUN C:\cygwin64\bin\bash.exe --login -c "git clone https://github.com/ocaml/opam /tmp/opam && cd /tmp/opam && cp -P -R -p . ../opam-sources && git checkout cdd59ee5d4b07b2173d2bbdc57a0ddecd153dd4e"
RUN C:\cygwin64\bin\bash.exe --login -c "cd /tmp/opam-sources && cp -P -R -p . ../opam-build-master && cd ../opam-build-master && git checkout cdd59ee5d4b07b2173d2bbdc57a0ddecd153dd4e && git config --global --add safe.directory /tmp/opam-build-master"
RUN C:\cygwin64\bin\bash.exe --login -c "cd /tmp/opam-build-master && eval $(msvs-detect --arch=x64) && export PATH="$MSVS_PATH:$PATH" && export LIB="$MSVS_LIB" && export INCLUDE="$MSVS_INC" && make compiler OCAML_PORT=msvc64 && make lib-pkg"
RUN C:\cygwin64\bin\bash.exe --login -c "cd /tmp/opam-build-master && eval $(msvs-detect --arch=x64) && export PATH="$MSVS_PATH:$PATH" && export LIB="$MSVS_LIB" && export INCLUDE="$MSVS_INC" && ./configure --enable-cold-check  --with-0install-solver && make && make install"
RUN C:\cygwin64\bin\bash.exe --login -c "cd /usr/local/bin && tar -cf /cygdrive/c/opam.tar ."

FROM cygwin-msvc
LABEL distro_style="windows"
USER ContainerAdministrator
RUN C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --no-startmenu --no-desktop --only-site --local-package-dir C:\TEMP\cache --root C:\cygwin64 --site https://mirrors.kernel.org/sourceware/cygwin/ --symlink-type=native --packages curl,diffutils,git,m4,make,patch,perl,rsync,unzip && `
  powershell -Command "Remove-Item 'C:\TEMP' -Recurse"
ADD [ "https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.2/opam64.tar.xz", "C:\\TEMP\\" ]
RUN C:\cygwin64\bin\bash.exe --login -c "cd /tmp && tar -xf /cygdrive/c/TEMP/opam64.tar.xz && ./opam64/install.sh --prefix=/usr && rm -rf opam64 opam64.tar.xz"
ADD [ "https://aka.ms/vs/17/release/vc_redist.x64.exe", "C:\\TEMP\\" ]
RUN C:\TEMP\vc_redist.x64.exe /install /passive /norestart /log C:\TEMP\vc_redist.log && `
  powershell -Command "Remove-Item 'C:\TEMP' -Recurse"
COPY --from=winget-builder [ "C:\\Program Files\\winget-cli", "C:\\Program Files\\winget-cli" ]
RUN for /f "tokens=1,2,*" %a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V Path ^| findstr /r "^[^H]"') do `
        reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V Path /t REG_EXPAND_SZ /f /d "C:\Program Files\winget-cli;%c"
RUN powershell -Command "$path=(Join-Path $env:LOCALAPPDATA 'Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState'); New-Item $path -ItemType Directory -Force; '{ """"$schema"""": """"https://aka.ms/winget-settings.schema.json"""", """"telemetry"""": { """"disable"""": """"true"""" } }' | Out-File -encoding ASCII (Join-Path $path 'settings.json')"
RUN winget install --exact --accept-source-agreements --accept-package-agreements Git.Git
COPY --from=opam-builder [ "C:\\opam.tar", "C:\\TEMP\\" ]
RUN C:\cygwin64\bin\tar.exe -xf /cygdrive/c/TEMP/opam.tar -C /usr/local/bin && del C:\TEMP\opam.tar && `
  mklink C:\cygwin64\bin\opam-dev.exe C:\cygwin64\usr\local\bin\opam.exe && `
  mklink C:\cygwin64\bin\opam-2.2.exe C:\cygwin64\bin\opam-dev.exe
WORKDIR C:\cygwin64\home\opam
ENV HOME="C:\cygwin64\home\opam"
RUN C:\cygwin64\bin\bash.exe --login -c "git config --global user.email 'docker@example.com' && git config --global user.name 'Docker' && git config --system core.longpaths true && git config --global --add safe.directory /home/opam/opam-repository"
COPY [ ".", "C:\\cygwin64\\home\\opam\\opam-repository" ]
ENV OPAMROOT="C:\opam\.opam"
RUN opam init -k local -a "C:\cygwin64\home\opam\opam-repository" --bare --disable-sandboxing
RUN opam repo add ocurrent-overlay git+https://github.com/ocurrent/opam-repository-mingw#514541c9957ded860594146061738a060d3138e9 --set-default
RUN C:\cygwin64\bin\bash.exe --login -c "rm -rf /cygdrive/c/opam/.opam/repo/default/.git"
COPY [ "Dockerfile", "/Dockerfile.opam" ]


2024-06-10 17:41.05: Using cache hint "opam-windows-server-msvc-ltsc2022"
2024-06-10 17:41.05: Waiting for resource in pool OCluster
2024-06-10 17:41.05: Waiting for worker…
2024-06-11 01:30.31: Got resource from pool OCluster
Building on ltsc2022-2
All commits already cached
2024-06-11 01:30.32: Job failed: Disconnected: Switch turned off