Skip to content
Snippets Groups Projects
Unverified Commit 15a9a0e8 authored by Signal Linden's avatar Signal Linden Committed by GitHub
Browse files

Merge pull request #144 from secondlife/signal/act

SL-18839: Add basic windows build
parents bb79718c 6926368f
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
name: Build
on:
workflow_dispatch:
pull_request:
push:
branches: [main, contribute]
tags: ["*"]
jobs:
build:
strategy:
matrix:
runner: [windows-large]
configuration: [ReleaseOS]
addrsize: [64]
include:
- runner: windows-large
configuration: ReleaseOS
addrsize: 32
runs-on: ${{ matrix.runner }}
env:
AUTOBUILD_CONFIGURATION: ${{ matrix.configuration }}
AUTOBUILD_ADDRSIZE: ${{ matrix.addrsize }}
AUTOBUILD_INSTALLABLE_CACHE: ${{ github.workspace }}/.autobuild-installables
AUTOBUILD_VARIABLES_FILE: ${{ github.workspace }}/.build-variables/variables
AUTOBUILD_VSVER: "170" # vs2k22
LOGFAIL: debug # Show details when tests fail
GIT_REF: ${{ github.head_ref || github.ref }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Checkout build variables
uses: actions/checkout@v3
with:
repository: secondlife/build-variables
ref: viewer
path: .build-variables
- name: Install autobuild and python dependencies
run: pip3 install autobuild llbase
- name: Cache autobuild packages
uses: actions/cache@v3
id: cache-installables
with:
path: .autobuild-installables
key: ${{ runner.os }}-${{ matrix.addrsize }}-${{ matrix.configuration }}-${{ hashFiles('autobuild.xml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.addrsize }}-${{ matrix.configuration }}-
${{ runner.os }}-${{ matrix.addrsize }}-
- name: Install windows dependencies
if: runner.os == 'Windows'
run: choco install nsis-unicode
- name: Build
id: build
shell: bash
env:
RUNNER_OS: ${{ runner.os }}
run: |
# On windows we need to point the build to the correct python
# as neither CMake's FindPython nor our custom Python.cmake module
# will resolve the correct interpreter location.
if [[ "$RUNNER_OS" == "Windows" ]]; then
export PYTHON="$(cygpath -m "$(which python)")"
echo "Python location: $PYTHON"
fi
autobuild configure -- -DVIEWER_CHANNEL="Second Life Test ${GIT_REF##*/}"
autobuild build --no-configure
# Find artifacts
if [[ "$RUNNER_OS" == "Windows" ]]; then
installer_path=$(find ./build-*/newview/ | grep '_Setup\.exe')
installer_name="$(basename $installer_path)"
elif [[ "$RUNNER_OS" == "macOS" ]]; then
installer_path=$(find ./build-*/newview/ | grep '\.dmg')
installer_name="$(basename $installer_path)"
fi
echo "installer_path=$installer_path" >> $GITHUB_OUTPUT
echo "installer_name=$installer_name" >> $GITHUB_OUTPUT
- name: Upload installer
uses: actions/upload-artifact@v3
with:
name: ${{ steps.build.outputs.installer_name }}
path: ${{ steps.build.outputs.installer_path }}
......@@ -3403,7 +3403,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<string>/t:Build</string>
<string>/p:useenv=true</string>
<string>/verbosity:minimal</string>
<string>/toolsversion:4.0</string>
<string>/p:VCBuildAdditionalOptions= /incremental</string>
</array>
</map>
......@@ -3477,7 +3476,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<string>/t:Build</string>
<string>/p:useenv=true</string>
<string>/verbosity:minimal</string>
<string>/toolsversion:4.0</string>
<string>/p:VCBuildAdditionalOptions= /incremental</string>
</array>
</map>
......
......@@ -61,7 +61,7 @@ if (WINDOWS)
# CP changed to only append the flag for 32bit builds - on 64bit builds,
# locally at least, the build output is spammed with 1000s of 'D9002'
# warnings about this switch being ignored.
if( ADDRESS_SIZE EQUAL 32 )
if(ADDRESS_SIZE EQUAL 32 AND DEFINED ENV{"TEAMCITY_PROJECT_NAME"})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /p:PreferredToolArchitecture=x64")
endif()
# zlib has assembly-language object files incompatible with SAFESEH
......
......@@ -2,7 +2,11 @@
set(PYTHONINTERP_FOUND)
if (WINDOWS)
if (DEFINED ENV{PYTHON})
# Allow python executable to be explicitly set
set(python "$ENV{PYTHON}")
set(PYTHONINTERP_FOUND ON)
elseif (WINDOWS)
# On Windows, explicitly avoid Cygwin Python.
# if the user has their own version of Python installed, prefer that
......@@ -43,7 +47,7 @@ else()
if (python)
set(PYTHONINTERP_FOUND ON)
endif (python)
endif (WINDOWS)
endif (DEFINED ENV{PYTHON})
if (NOT python)
message(FATAL_ERROR "No Python interpreter found")
......
......@@ -524,6 +524,7 @@ FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Make sure the user can uninstall
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/* Unused
Function un.CheckIfAdministrator
DetailPrint $(CheckAdministratorUnInstDP)
UserInfo::GetAccountType
......@@ -535,6 +536,7 @@ lbl_is_admin:
Return
FunctionEnd
*/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Function CheckWillUninstallV2
......
......@@ -790,27 +790,15 @@ def package_finish(self):
# Check two paths, one for Program Files, and one for Program Files (x86).
# Yay 64bit windows.
for ProgramFiles in 'ProgramFiles', 'ProgramFiles(x86)':
NSIS_path = os.path.expandvars(r'${%s}\NSIS\makensis.exe' % ProgramFiles)
if os.path.exists(NSIS_path):
break
installer_created=False
nsis_attempts=3
nsis_retry_wait=15
for attempt in range(nsis_attempts):
try:
self.run_command([NSIS_path, '/V2', self.dst_path_of(tempfile)])
except ManifestError as err:
if attempt+1 < nsis_attempts:
print("nsis failed, waiting %d seconds before retrying" % nsis_retry_wait, file=sys.stderr)
time.sleep(nsis_retry_wait)
nsis_retry_wait*=2
else:
# NSIS worked! Done!
break
else:
print("Maximum nsis attempts exceeded; giving up", file=sys.stderr)
raise
nsis_path = "makensis.exe"
for program_files in '${programfiles}', '${programfiles(x86)}':
for nesis_path in 'NSIS', 'NSIS\\Unicode':
possible_path = os.path.expandvars(f"{program_files}\\{nesis_path}\\makensis.exe")
if os.path.exists(possible_path):
nsis_path = possible_path
break
self.run_command([possible_path, '/V2', self.dst_path_of(tempfile)])
self.sign(installer_file)
self.created_path(self.dst_path_of(installer_file))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment