Commit 962906a0 authored by Eric Timmons's avatar Eric Timmons
Browse files

Don't use a custom Windows image

clfoundation/sbcl now builds --with-sb-linkable-runtime. Plus it's fairly easy
to install the remainder of the deps.
parent 3a40c203
......@@ -107,24 +107,6 @@ debian-image:arm:
git checkout -B $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME $CI_COMMIT_BRANCH $CI_COMMIT_SHA
fi
.git-repo-needed:windows:
variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: none
GIT_CHECKOUT: "false"
before_script:
# This looks a little funky, but only one of
# $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME and $CI_COMMIT_BRANCH will ever be
# defined at once.
- |
if ($CI_COMMIT_TAG) {
git checkout $CI_COMMIT_TAG
} else {
git checkout -B $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME $CI_COMMIT_BRANCH $CI_COMMIT_SHA
}
- git submodule init
- git submodule update
##############################################################################
# Build static releases
##############################################################################
......@@ -203,12 +185,59 @@ dynamic-release:macos:amd64:
dynamic-release:windows:amd64:
stage: build
image: $CI_REGISTRY_IMAGE/ci:$SBCL_VERSION-windowsservercore
extends: .git-repo-needed:windows
image: clfoundation/sbcl:$SBCL_VERSION-windowsservercore
variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: none
GIT_CHECKOUT: "false"
ProgressPreference: 'SilentlyContinue'
script:
# Install choco
- '[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12'
- Set-ExecutionPolicy Bypass -Scope Process -Force
- "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
- Import-Module 'C:\ProgramData\chocolatey\helpers\chocolateyProfile.psm1'
# Make refreshenv available.
- $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
# Install git
- choco install -y git --params "/NoAutoCrlf"
- refreshenv
# Install msys2
- Invoke-WebRequest -Uri "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe" -OutFile C:\msys2.exe
- C:\msys2.exe -y -oC:\
- Remove-Item C:\msys2.exe
- $BASH = "C:\msys64\usr\bin\bash"
- $env:BASH = "C:\msys64\usr\bin\bash"
- "& $BASH -lc ' '"
- Stop-Process -ErrorAction Ignore -Force -Name gpg-agent
- Stop-Process -ErrorAction Ignore -Force -Name dirmngr
# Configure msys2
- $env:CHERE_INVOKING = 'yes'
- $env:MSYSTEM = 'MINGW64'
- $env:MSYS = 'noglob'
- $env:MSYS2_PATH_TYPE = 'inherit'
# Install WiX
- Invoke-WebRequest -Uri 'https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip' -OutFile C:\wix311-binaries.zip
- New-Item -ItemType Directory -Force -Path "C:\wix\bin"
- Expand-Archive -LiteralPath 'C:\wix311-binaries.zip' -DestinationPath C:\wix\bin
- $env:WIX = "C:\wix"
- sbcl --script scripts/build-release.lisp
- sbcl --script scripts/build-msi.lisp
# Install deps!
- "& $BASH -lc 'pacman --noconfirm -S git mingw-w64-x86_64-gcc make tar diffutils'"
# Get the repo
# This looks a little funky, but only one of
# $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME and $CI_COMMIT_BRANCH will ever be
# defined at once.
- |
if ($CI_COMMIT_TAG) {
git checkout $CI_COMMIT_TAG
} else {
git checkout -B $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME $CI_COMMIT_BRANCH $CI_COMMIT_SHA
}
- git submodule init
- git submodule update
- "& $BASH -lc 'sbcl --script scripts/build-release.lisp'"
- "& $BASH -lc 'sbcl --script scripts/build-msi.lisp'"
artifacts:
paths:
- releases/
......
# This Dockerfile builds a Windows image for use on Gitlab CI.
ARG sbcl_version=2.1.2
ARG image_repo=clfoundation/sbcl
FROM $image_repo:$sbcl_version-windowsservercore
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
echo 'Installing choco'; \
Set-ExecutionPolicy Bypass -Scope Process -Force; \
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \
Import-Module 'C:\ProgramData\chocolatey\helpers\chocolateyProfile.psm1'; \
\
echo 'Installing WIX. As of last check, dotnet35 is broken in chocolatey'; \
Invoke-WebRequest -Uri 'https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip' -OutFile wix311-binaries.zip; \
mkdir wix/bin; \
Expand-Archive -LiteralPath 'wix311-binaries.zip' -DestinationPath C:\wix\bin; \
rm wix311-binaries.zip; \
\
echo 'Installing msys2'; \
choco install -y msys2 --params '/NoUpdate' ; \
\
echo 'Adding mingw64 to machine PATH'; \
$machineKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\ControlSet001\Control\Session Manager\Environment\'); \
$machinePath = $machineKey.GetValue('PATH', [string]::Empty, 'DoNotExpandEnvironmentNames').ToString(); \
$machineKey.Close(); \
$machinePath = ('C:\tools\msys64\usr\bin;c:\tools\msys64\mingw64\bin;{0}' -f $machinePath); \
$machineKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\ControlSet001\Control\Session Manager\Environment\', $true); \
$machineKey.SetValue('PATH', $machinePath, 'ExpandString'); \
$machineKey.Close(); \
$env:PATH = ('C:\tools\msys64\usr\bin;c:\tools\msys64\mingw64\bin;{0}' -f $env:PATH); \
\
echo 'Installing build tools'; \
pacman -S --noconfirm --needed mingw-w64-x86_64-gcc make diffutils tar; \
\
echo 'Downloading SBCL source'; \
$sbclurl = ('https://downloads.sourceforge.net/project/sbcl/sbcl/{0}/sbcl-{0}-source.tar.bz2' -f $env:SBCL_VERSION); \
Invoke-WebRequest -Uri $sbclurl -OutFile sbcl-source.tar.bz2 -UserAgent "NativeHost"; \
$actualsha256 = (Get-FileHash sbcl-source.tar.bz2 -Algorithm sha256).Hash; \
Write-Host ('Verifying sha256 {0} (expected: {1})' -f $actualsha256, $env:SBCL_SOURCE_SHA256); \
if ($actualsha256 -ne $env:SBCL_SOURCE_SHA256) { \
Write-Host 'SHA256 check FAILED!'; \
exit 1; \
}; \
\
echo 'Unpacking source'; \
sh -c 'tar -x -v -f sbcl-source.tar.bz2'; \
rm sbcl-source.tar.bz2;
RUN echo 'Building SBCL'; \
$env:WIX = '/c/wix'; \
cd sbcl-$env:SBCL_VERSION; \
sh ./make.sh --with-sb-linkable-runtime; \
sh ./make-windows-installer.sh; \
cd ..; \
\
echo 'Installing SBCL --with-linkable-runtime'; \
cp C:\sbcl-$env:SBCL_VERSION\output\sbcl-$env:SBCL_VERSION-x86-64-windows-binary.msi sbcl-installer.msi; \
Start-Process msiexec.exe -Wait -ArgumentList '/I C:\sbcl-installer.msi'; \
echo 'Removing SBCL Installer'; \
Remove-Item -Force -Path C:\sbcl-installer.msi;
RUN echo 'Installing git'; \
choco install -y git --params "/NoAutoCrlf";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment