Skip to content

Commit

Permalink
Add Windows 64bit build to Github Actions (Mudlet#4348)
Browse files Browse the repository at this point in the history
* Add mingw-64 build

* Add --trace-expand

* Use correct variable for checking dev/ptb status

* Update dblsqd

* Re-enable updater

* Disable checking APP_BUILD in src/CMakeLists.txt

* Show CMakeOutput if it exists

* Remove trace output

* Re-enable PCRE hack

* Clarify APP_BUILD disablement

* Remove commented out updater disable

* Nicer way of specifying the arguments

* Update build-mudlet.yml

* Set Windows version explicitly
  • Loading branch information
vadi2 authored Nov 13, 2020
1 parent 09fb262 commit c993ae5
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 25 deletions.
58 changes: 53 additions & 5 deletions .github/workflows/build-mudlet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
fail-fast: false
matrix:
include:
# - os: windows-latest
# triplet: x64-windows
- os: ubuntu-latest
buildname: 'ubuntu / gcc'
triplet: x64-linux
Expand All @@ -34,6 +32,11 @@ jobs:
triplet: x64-osx
compiler: clang_64
qt: '5.14.1'
- os: windows-2019
buildname: 'windows'
triplet: x64-mingw-dynamic
# compiler: flag not used in windows pipeline
qt: '5.14.1'

steps:
- name: Restore Qt cache
Expand Down Expand Up @@ -69,7 +72,7 @@ jobs:
vcpkgDirectory: '${{github.workspace}}/3rdparty/vcpkg'
appendedCacheKey: ${{hashFiles(env.vcpkgResponseFile)}}-newkey

- name: (macOS) Install homebrew dependencies
- name: (macOS) Install non-vcpkg dependencies
if: runner.os == 'macOS'
run: |
# these aren't available or don't work well in vcpkg
Expand All @@ -78,7 +81,7 @@ jobs:
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
- name: (Linux) Install apt dependencies
- name: (Linux) Install non-vcpkg dependencies
if: runner.os == 'Linux'
run: |
# Installing packages might fail as the github image becomes outdated
Expand All @@ -88,6 +91,30 @@ jobs:
echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
- name: (Windows) Install non-vcpkg dependencies
if: runner.os == 'Windows'
shell: powershell
run: |
# Use pre-installed Boost
echo "BOOST_ROOT=$env:BOOST_ROOT_1_72_0" >> $env:GITHUB_ENV
# Install dependencies not available on machine
$env:WORKING_BASE_DIR = "${{runner.workspace}}\src"
$env:MINGW_BASE_DIR = "${{runner.workspace}}\mingw73_64"
echo "MINGW_BASE_DIR=$env:MINGW_BASE_DIR" >> $env:GITHUB_ENV
. ${{github.workspace}}\CI\appveyor.functions.ps1
# Libzip install complains when \bin is missing
New-Item -ItemType Directory -Path "$env:MINGW_BASE_DIR\bin"
SetQtBaseDir "$env:WORKING_BASE_DIR\verbose_output.log"
SetMingwBaseDir "$env:WORKING_BASE_DIR\verbose_output.log"
SetLuarocksPath "$env:WORKING_BASE_DIR\verbose_output.log"
$NoShPath = filterPathForSh
CheckAndInstallZlib
CheckAndInstallLibzip
- name: (Linux Clang) change compiler
if: runner.os == 'Linux' && matrix.compiler == 'clang_64'
run: |
Expand Down Expand Up @@ -116,9 +143,30 @@ jobs:
cmakeListsTxtPath: '${{github.workspace}}/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{runner.workspace}}/b/ninja'
cmakeAppendedArgs: '--target test -G Ninja'
cmakeAppendedArgs: >-
--target test
-G Ninja
-DCMAKE_PREFIX_PATH=${{env.MINGW_BASE_DIR}}
-DVCPKG_APPLOCAL_DEPS=OFF
- name: Run C++ tests (macOS)
if: runner.os == 'macOS'
working-directory: '${{runner.workspace}}/b/ninja'
run: ctest --output-on-failure

- name: (windows) Show relevant logs logs
if: failure() && runner.os == 'Windows'
run: |
$env:WORKING_BASE_DIR = "${{runner.workspace}}\src"
if (Test-Path -Path "$env:WORKING_BASE_DIR\stderr.log") {
echo "Standard error log from non-vcpkg dependencies: "
cat $env:WORKING_BASE_DIR\stderr.log
}
if (Test-Path -Path "$env:WORKING_BASE_DIR\stdout.log") {
echo "Standard output log from non-vcpkg dependencies: "
cat $env:WORKING_BASE_DIR\stdout.log
}
if (Test-Path -Path "${{runner.workspace}}/b/ninja/CMakeFiles/CMakeOutput.log") {
echo "CMakeOutput.log: "
cat "${{runner.workspace}}/b/ninja/CMakeFiles/CMakeOutput.log"
}
2 changes: 1 addition & 1 deletion 3rdparty/dblsqd
Submodule dblsqd updated 1 files
+10 −21 CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--triplet
x64-mingw-dynamic
yajl
hunspell
pugixml
pcre
--overlay-ports=../our-vcpkg-dependencies/lua
lua[core]

24 changes: 15 additions & 9 deletions CI/appveyor.functions.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Some global variables / settings
$workingBaseDir = "C:\src\"
if (Test-Path env:WORKING_BASE_DIR) {
$workingBaseDir = $env:WORKING_BASE_DIR
}

echo "workingBaseDir is $workingBaseDir"

$logFile = "$workingBaseDir\verbose_output.log"
$ciScriptDir = (Get-Item -Path ".\" -Verbose).FullName

Expand Down Expand Up @@ -114,8 +120,8 @@ function DownloadFile([string] $url, [string] $outputFile, [bool] $bigDownload =
function ExtractTar([string] $tarFile, [string] $outputPath) {
Step "Extracting source distribution"
$file = Get-ChildItem $tarFile
exec "7z" @("x", "$($file.FullName)", "-y")
exec "7z" @("-o$outputPath", "x", "$($file.Directory)\$($file.BaseName)", "-y")
exec "7z" @("-o$outputPath", "x", "$($file.FullName)", "-y")
exec "7z" @("-o$outputPath", "x", "$($outputPath)\$($file.BaseName)", "-y")
}

function ExtractZip([string] $zipFile, [string] $outputPath) {
Expand Down Expand Up @@ -203,15 +209,15 @@ function InstallMsys() {
exec "mingw-get" @("install", "mingw32-autotools")
}

function InstallBoost() {
function InstallBoost([string] $outputLocation = "C:\Libraries\") {
DownloadFile "https://sourceforge.net/projects/boost/files/boost/1.71.0.beta1/boost_1_71_0_b1.tar.gz/download" "boost.tar.gz" $true
if (!(Test-Path -Path "C:\Libraries\" -PathType Container)) {
Step "Creating Boost path"
New-Item -Path "C:\Libraries\" -ItemType "directory" >> "$logFile" 2>&1
}
ExtractTar "boost.tar.gz" "."
ExtractTar "$workingBaseDir\boost.tar.gz" "$workingBaseDir"
Step "Copying folder"
Move-Item "boost_1_71_0" "C:\Libraries\" >> "$logFile" 2>&1
Move-Item "$workingBaseDir\boost_1_71_0" "$outputLocation" >> "$logFile" 2>&1
}

function InstallQt() {
Expand Down Expand Up @@ -305,8 +311,8 @@ function InstallSqlite() {

function InstallZlib() {
DownloadFile "http://zlib.net/zlib-1.2.11.tar.gz" "zlib-1.2.11.tar.gz"
ExtractTar "zlib-1.2.11.tar.gz" "zlib"
Set-Location zlib\zlib-1.2.11
ExtractTar "$workingBaseDir\zlib-1.2.11.tar.gz" "$workingBaseDir\zlib"
Set-Location "$workingBaseDir\zlib\zlib-1.2.11"
RunMake "win32/Makefile.gcc"
$Env:INCLUDE_PATH = "$Env:MINGW_BASE_DIR\include"
$Env:LIBRARY_PATH = "$Env:MINGW_BASE_DIR\lib"
Expand All @@ -319,8 +325,8 @@ function InstallZlib() {
function InstallLibzip() {
$Env:Path = $NoShPath
DownloadFile "https://libzip.org/download/libzip-1.5.2.tar.gz" "libzip.tar.gz"
ExtractTar "libzip.tar.gz" "libzip"
Set-Location libzip\libzip-1.5.2
ExtractTar "$workingBaseDir\libzip.tar.gz" "$workingBaseDir\libzip"
Set-Location "$workingBaseDir\libzip\libzip-1.5.2"
if (!(Test-Path -Path "build" -PathType Container)) {
Step "Creating libzip build path"
New-Item build -ItemType Directory >> "$logFile" 2>&1
Expand Down
15 changes: 11 additions & 4 deletions cmake/FindPCRE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,17 @@ find_library(
/opt/csw
/opt)

if(PCRE_LIBRARY_DEBUG AND PCRE_LIBRARY_RELEASE)
set(PCRE_LIBRARY optimized ${PCRE_LIBRARY_RELEASE} debug
${PCRE_LIBRARY_DEBUG})
elseif(PCRE_LIBRARY_RELEASE)
# if(PCRE_LIBRARY_DEBUG AND PCRE_LIBRARY_RELEASE)
#
# This confuses 'get_filename_component(PCRE_FILENAME ${PCRE_LIBRARY} NAME)' later on
# get_filename_component(PCRE_FILENAME optimized;D:/a/Mudlet/Mudlet/3rdparty/vcpkg/installed/x64-mingw-dynamic/lib/libpcre.dll.a;debug;D:/a/Mudlet/Mudlet/3rdparty/vcpkg/installed/x64-mingw-dynamic/debug/lib/libpcred.dll.a NAME )
# CMake Error at cmake/FindPCRE.cmake:84 (get_filename_component):
# ##[error] get_filename_component unknown component
#
# set(PCRE_LIBRARY optimized ${PCRE_LIBRARY_RELEASE} debug
# ${PCRE_LIBRARY_DEBUG})
# elseif
if(PCRE_LIBRARY_RELEASE)
set(PCRE_LIBRARY ${PCRE_LIBRARY_RELEASE})
elseif(PCRE_LIBRARY_DEBUG)
set(PCRE_LIBRARY ${PCRE_LIBRARY_DEBUG})
Expand Down
14 changes: 8 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ if(USE_FONTS)
endif()

if(WIN32)
if(BUILD matches "-ptb.+")
list(APPEND mudlet_RCCS icons/mudlet_ptb.ico)
elseif((BUILD matches "-dev.+") or (BUILD matches "-test.+"))
list(APPEND mudlet_RCCS icons/mudlet_dev.ico)
else()
# Neither BUILD nor APP_BUILD does not seem to be available?

# if(APP_BUILD matches "-ptb.+")
# list(APPEND mudlet_RCCS icons/mudlet_ptb.ico)
# elseif((APP_BUILD matches "-dev.+") or (APP_BUILD matches "-test.+"))
# list(APPEND mudlet_RCCS icons/mudlet_dev.ico)
# else()
list(APPEND mudlet_RCCS icons/mudlet.ico)
endif()
# endif()
endif()

set(mudlet_SRCS
Expand Down

0 comments on commit c993ae5

Please sign in to comment.