Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/secondlife/viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ansariel committed May 22, 2024
2 parents 924edc0 + e1623bb commit c1cf268
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 18 deletions.
64 changes: 53 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,52 @@ name: Build

on:
workflow_dispatch:
inputs:
release_run:
type: boolean
description: Do a release of this build
default: false
pull_request:
push:
branches: ["main", "release/*", "project/*"]
tags: ["Second_Life*"]

jobs:
# The whole point of the setvar job is that we want to set a variable once
# that will be consumed by multiple subsequent jobs. We tried setting it in
# the global env, but a job.env can't directly reference the global env
# context.
setvar:
runs-on: ubuntu-latest
outputs:
release_run: ${{ steps.setvar.outputs.release_run }}
env:
# Build with a tag like "Second_Life#abcdef0" to generate a release page
# (used for builds we are planning to deploy).
# When you want to use a string variable as a workflow YAML boolean, it's
# important to ensure it's the empty string when false. If you omit || '',
# its value when false is "false", which is interpreted as true.
RELEASE_RUN: ${{ (github.event.inputs.release_run || github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life')) && 'Y' || '' }}
steps:
- name: Set Variable
id: setvar
shell: bash
run: |
echo "release_run=$RELEASE_RUN" >> "$GITHUB_OUTPUT"
build:
needs: setvar
strategy:
matrix:
runner: [windows-large, macos-12-xl]
configuration: [Release]
Linden: [true]
include:
- runner: macos-12-xl
developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer"
- runner: windows-large
configuration: ReleaseOS
Linden: false
runs-on: ${{ matrix.runner }}
outputs:
viewer_channel: ${{ steps.build.outputs.viewer_channel }}
Expand All @@ -37,7 +69,10 @@ jobs:
AUTOBUILD_VSVER: "170"
DEVELOPER_DIR: ${{ matrix.developer_dir }}
# Ensure that Linden viewer builds engage Bugsplat.
BUGSPLAT_DB: ${{ matrix.configuration != 'ReleaseOS' && 'SecondLife_Viewer_2018' || '' }}
BUGSPLAT_DB: ${{ matrix.Linden && 'SecondLife_Viewer_2018' || '' }}
# Run BUILD steps for Release configuration.
# Run BUILD steps for ReleaseOS configuration only for release runs.
BUILD: ${{ (matrix.Linden || needs.setvar.outputs.release_run) && 'Y' || '' }}
build_coverity: false
build_log_dir: ${{ github.workspace }}/.logs
build_viewer: true
Expand All @@ -56,34 +91,40 @@ jobs:
variants: ${{ matrix.configuration }}
steps:
- name: Checkout code
if: env.BUILD
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Setup python
if: env.BUILD
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Checkout build variables
if: env.BUILD
uses: actions/checkout@v4
with:
repository: secondlife/build-variables
ref: master
path: .build-variables

- name: Checkout master-message-template
if: env.BUILD
uses: actions/checkout@v4
with:
repository: secondlife/master-message-template
path: .master-message-template

- name: Install autobuild and python dependencies
if: env.BUILD
run: pip3 install autobuild llsd

- name: Cache autobuild packages
uses: actions/cache@v4
id: cache-installables
if: env.BUILD
uses: actions/cache@v4
with:
path: .autobuild-installables
key: ${{ runner.os }}-64-${{ matrix.configuration }}-${{ hashFiles('autobuild.xml') }}
Expand All @@ -92,17 +133,19 @@ jobs:
${{ runner.os }}-64-
- name: Install windows dependencies
if: runner.os == 'Windows'
if: env.BUILD && runner.os == 'Windows'
run: choco install nsis-unicode

- name: Determine source branch
id: which-branch
if: env.BUILD
uses: secondlife/viewer-build-util/which-branch@v2
with:
token: ${{ github.token }}

- name: Build
id: build
if: env.BUILD
shell: bash
env:
AUTOBUILD_VCS_BRANCH: ${{ steps.which-branch.outputs.branch }}
Expand Down Expand Up @@ -179,7 +222,7 @@ jobs:
# determine the viewer channel from the branch name
branch=$AUTOBUILD_VCS_BRANCH
IFS='/' read -ra ba <<< $branch
IFS='/' read -ra ba <<< "$branch"
prefix=${ba[0]}
if [ "$prefix" == "project" ]; then
IFS='_' read -ra prj <<< "${ba[1]}"
Expand Down Expand Up @@ -225,7 +268,7 @@ jobs:
echo "artifact=$RUNNER_OS$cfg_suffix" >> $GITHUB_OUTPUT
- name: Upload executable
if: matrix.configuration != 'ReleaseOS' && steps.build.outputs.viewer_app
if: matrix.Linden && steps.build.outputs.viewer_app
uses: actions/upload-artifact@v4
with:
name: "${{ steps.build.outputs.artifact }}-app"
Expand All @@ -235,15 +278,15 @@ jobs:
# The other upload of nontrivial size is the symbol file. Use a distinct
# artifact for that too.
- name: Upload symbol file
if: matrix.configuration != 'ReleaseOS'
if: matrix.Linden
uses: actions/upload-artifact@v4
with:
name: "${{ steps.build.outputs.artifact }}-symbols"
path: |
${{ steps.build.outputs.symbolfile }}
- name: Upload metadata
if: matrix.configuration != 'ReleaseOS'
if: matrix.Linden
uses: actions/upload-artifact@v4
with:
name: "${{ steps.build.outputs.artifact }}-metadata"
Expand All @@ -254,7 +297,7 @@ jobs:
- name: Upload physics package
uses: actions/upload-artifact@v4
# should only be set for viewer-private
if: matrix.configuration != 'ReleaseOS' && steps.build.outputs.physicstpv
if: matrix.Linden && steps.build.outputs.physicstpv
with:
name: "${{ steps.build.outputs.artifact }}-physics"
# emitted by build.sh, zero or one lines
Expand Down Expand Up @@ -358,10 +401,9 @@ jobs:
version: ${{ needs.build.outputs.viewer_version }}

release:
needs: [build, sign-and-package-windows, sign-and-package-mac]
needs: [setvar, build, sign-and-package-windows, sign-and-package-mac]
runs-on: ubuntu-latest
# Build with a tag like "Second_Life#abcdef0" to generate a release page (used for builds we are planning to deploy).
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life')
if: needs.setvar.outputs.release_run
steps:
- uses: actions/download-artifact@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion indra/llimage/tests/llimageworker_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ U8* LLImageRaw::allocateData(S32 size) { return NULL; }
U8* LLImageRaw::reallocateData(S32 size) { return NULL; }
const U8* LLImageBase::getData() const { return NULL; }
U8* LLImageBase::getData() { return NULL; }
const std::string& LLImage::getLastThreadError() { static std::string msg; return msg; }

// End Stubbing
// -------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -98,7 +99,7 @@ namespace tut
done = res;
*done = false;
}
virtual void completed(bool success, LLImageRaw* raw, LLImageRaw* aux, U32)
virtual void completed(bool success, const std::string& error_message, LLImageRaw* raw, LLImageRaw* aux, U32 request_id)
{
*done = true;
}
Expand Down
6 changes: 0 additions & 6 deletions indra/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@
#if 0

#ifndef LL_WINDOWS

typedef struct {
void *re_pcre;
size_t re_nsub;
size_t re_erroffset;
} regex_t;
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#endif
Expand Down

0 comments on commit c1cf268

Please sign in to comment.