Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 57 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ name: Build

on:
workflow_dispatch:
inputs:
installer_type:
description: 'Windows installer type'
type: choice
options:
- velopack
- nsis
default: 'velopack'
pull_request:
push:
branches: ["main", "release/*", "project/*"]
Expand Down Expand Up @@ -53,6 +61,20 @@ jobs:
relnotes: ${{ steps.which-branch.outputs.relnotes }}
imagename: ${{ steps.build.outputs.imagename }}
configuration: ${{ matrix.configuration }}
# Windows Velopack outputs (passed to sign-pkg-windows)
velopack_pack_id: ${{ steps.build.outputs.velopack_pack_id }}
velopack_pack_version: ${{ steps.build.outputs.velopack_pack_version }}
velopack_pack_title: ${{ steps.build.outputs.velopack_pack_title }}
velopack_main_exe: ${{ steps.build.outputs.velopack_main_exe }}
velopack_exclude: ${{ steps.build.outputs.velopack_exclude }}
velopack_icon: ${{ steps.build.outputs.velopack_icon }}
velopack_installer_base: ${{ steps.build.outputs.velopack_installer_base }}
# macOS Velopack outputs (passed to sign-pkg-mac)
velopack_mac_pack_id: ${{ steps.build.outputs.velopack_mac_pack_id }}
velopack_mac_pack_version: ${{ steps.build.outputs.velopack_mac_pack_version }}
velopack_mac_pack_title: ${{ steps.build.outputs.velopack_mac_pack_title }}
velopack_mac_main_exe: ${{ steps.build.outputs.velopack_mac_main_exe }}
velopack_mac_bundle_id: ${{ steps.build.outputs.velopack_mac_bundle_id }}
env:
AUTOBUILD_ADDRSIZE: 64
AUTOBUILD_BUILD_ID: ${{ github.run_id }}
Expand Down Expand Up @@ -84,6 +106,8 @@ jobs:
# Only set variants to the one configuration: don't let build.sh loop
# over variants, let GitHub distribute variants over multiple hosts.
variants: ${{ matrix.configuration }}
# Pass USE_VELOPACK to CMake when using Velopack installer (default) - Windows and macOS
autobuild_configure_parameters: ${{ (contains(matrix.runner, 'windows') || contains(matrix.runner, 'macos')) && (github.event.inputs.installer_type || 'velopack') == 'velopack' && '-- -DUSE_VELOPACK:BOOL=ON' || '' }}
steps:
- name: Checkout code
uses: actions/checkout@v5
Expand Down Expand Up @@ -126,6 +150,17 @@ jobs:
with:
token: ${{ github.token }}

- name: Setup .NET for Velopack
if: (runner.os == 'Windows' || runner.os == 'macOS') && (github.event.inputs.installer_type || 'velopack') == 'velopack'
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Install Velopack CLI
if: (runner.os == 'Windows' || runner.os == 'macOS') && (github.event.inputs.installer_type || 'velopack') == 'velopack'
shell: bash
run: dotnet tool install -g vpk

- name: Build
id: build
shell: bash
Expand Down Expand Up @@ -310,13 +345,21 @@ jobs:
steps:
- name: Sign and package Windows viewer
if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID
uses: secondlife/viewer-build-util/sign-pkg-windows@v2.0.4
uses: secondlife/viewer-build-util/sign-pkg-windows@v2.1.0
with:
vault_uri: "${{ env.AZURE_KEY_VAULT_URI }}"
cert_name: "${{ env.AZURE_CERT_NAME }}"
client_id: "${{ env.AZURE_CLIENT_ID }}"
client_secret: "${{ env.AZURE_CLIENT_SECRET }}"
tenant_id: "${{ env.AZURE_TENANT_ID }}"
installer_type: "${{ github.event.inputs.installer_type || 'velopack' }}"
velopack_pack_id: "${{ needs.build.outputs.velopack_pack_id }}"
velopack_pack_version: "${{ needs.build.outputs.velopack_pack_version }}"
velopack_pack_title: "${{ needs.build.outputs.velopack_pack_title }}"
velopack_main_exe: "${{ needs.build.outputs.velopack_main_exe }}"
velopack_exclude: "${{ needs.build.outputs.velopack_exclude }}"
velopack_icon: "${{ needs.build.outputs.velopack_icon }}"
velopack_installer_base: "${{ needs.build.outputs.velopack_installer_base }}"

sign-and-package-mac:
env:
Expand Down Expand Up @@ -349,7 +392,7 @@ jobs:

- name: Sign and package Mac viewer
if: env.SIGNING_CERT_MACOS && env.SIGNING_CERT_MACOS_IDENTITY && env.SIGNING_CERT_MACOS_PASSWORD && steps.note-creds.outputs.note_user && steps.note-creds.outputs.note_pass && steps.note-creds.outputs.note_team
uses: secondlife/viewer-build-util/sign-pkg-mac@v2
uses: secondlife/viewer-build-util/sign-pkg-mac@v2.1.0
with:
channel: ${{ needs.build.outputs.viewer_channel }}
imagename: ${{ needs.build.outputs.imagename }}
Expand All @@ -359,6 +402,11 @@ jobs:
note_user: ${{ steps.note-creds.outputs.note_user }}
note_pass: ${{ steps.note-creds.outputs.note_pass }}
note_team: ${{ steps.note-creds.outputs.note_team }}
velopack_pack_id: "${{ needs.build.outputs.velopack_mac_pack_id }}"
velopack_pack_version: "${{ needs.build.outputs.velopack_mac_pack_version }}"
velopack_pack_title: "${{ needs.build.outputs.velopack_mac_pack_title }}"
velopack_main_exe: "${{ needs.build.outputs.velopack_mac_main_exe }}"
velopack_bundle_id: "${{ needs.build.outputs.velopack_mac_bundle_id }}"

post-windows-symbols:
env:
Expand Down Expand Up @@ -439,6 +487,10 @@ jobs:
with:
pattern: "*-metadata"

- uses: actions/download-artifact@v4
with:
pattern: "*-releases"

- name: Rename metadata
run: |
cp Windows-metadata/autobuild-package.xml Windows-autobuild-package.xml
Expand All @@ -464,12 +516,14 @@ jobs:
generate_release_notes: true
target_commitish: ${{ github.sha }}
append_body: true
fail_on_unmatched_files: true
fail_on_unmatched_files: false
files: |
macOS-installer/*.dmg
Windows-installer/*.exe
*-autobuild-package.xml
*-viewer_version.txt
Windows-releases/*
macOS-releases/*

- name: post release URL
run: |
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/tag-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ on:
project:
description: "Project Name (used for channel name in project builds, and tag name for all builds)"
default: "hippo"
# TODO - add an input for selecting another sha to build other than head of branch
tag_override:
description: "Override the tag name (optional). If the tag already exists, a numeric suffix is appended."
required: false

jobs:
tag-release:
Expand All @@ -34,7 +36,7 @@ jobs:
NIGHTLY_DATE=$(date --rfc-3339=date)
echo NIGHTLY_DATE=${NIGHTLY_DATE} >> ${GITHUB_ENV}
echo TAG_ID="$(echo ${{ github.sha }} | cut -c1-8)-${{ inputs.project || '${NIGHTLY_DATE}' }}" >> ${GITHUB_ENV}
- name: Update Tag
- name: Create Tag
uses: actions/github-script@v8
with:
# use a real access token instead of GITHUB_TOKEN default.
Expand All @@ -44,9 +46,27 @@ jobs:
# this token will need to be renewed anually in January
github-token: ${{ secrets.LL_TAG_RELEASE_TOKEN }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ env.VIEWER_CHANNEL }}#${{ env.TAG_ID }}",
sha: context.sha
})
const override = `${{ inputs.tag_override }}`.trim();
const baseTag = override || `${{ env.VIEWER_CHANNEL }}#${{ env.TAG_ID }}`;

// Try the base tag first, then append -2, -3, etc. if it already exists
let tag = baseTag;
for (let attempt = 1; ; attempt++) {
try {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${tag}`,
sha: context.sha
});
core.info(`Created tag: ${tag}`);
break;
} catch (e) {
if (e.status === 422 && attempt < 10) {
core.info(`Tag '${tag}' already exists, trying next suffix...`);
tag = `${baseTag}-${attempt + 1}`;
} else {
throw e;
}
}
}
50 changes: 50 additions & 0 deletions autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2914,6 +2914,56 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>description</key>
<string>Voxelized Hierarchical Approximate Convex Decomposition</string>
</map>
<key>velopack</key>
<map>
<key>platforms</key>
<map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>creds</key>
<string>github</string>
<key>hash</key>
<string>91abbc360640b5b2e0a4c001a36ad411a9a42602</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://api.github.com/repos/secondlife-3p/3p-velopack/releases/assets/380583560</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>creds</key>
<string>github</string>
<key>hash</key>
<string>05563a79bdeb83d66a72ac1e97587dc2a8f64511</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://api.github.com/repos/secondlife-3p/3p-velopack/releases/assets/380583554</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
</map>
<key>license</key>
<string>MIT</string>
<key>license_file</key>
<string>LICENSES/velopack.txt</string>
<key>copyright</key>
<string>Velopack Ltd.</string>
<key>version</key>
<string>40232ef.23500976684</string>
<key>name</key>
<string>velopack</string>
<key>description</key>
<string>Velopack C/C++ Library</string>
</map>
</map>
<key>package_description</key>
<map>
Expand Down
1 change: 1 addition & 0 deletions indra/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ set(cmake_SOURCE_FILES
UI.cmake
UnixInstall.cmake
Variables.cmake
Velopack.cmake
VHACD.cmake
ViewerMiscLibs.cmake
VisualLeakDetector.cmake
Expand Down
2 changes: 1 addition & 1 deletion indra/cmake/Python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ elseif (WINDOWS)
foreach(hive HKEY_CURRENT_USER HKEY_LOCAL_MACHINE)
# prefer more recent Python versions to older ones, if multiple versions
# are installed
foreach(pyver 3.13 3.12 3.11 3.10 3.9 3.8 3.7)
foreach(pyver 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7)
list(APPEND regpaths "[${hive}\\SOFTWARE\\Python\\PythonCore\\${pyver}\\InstallPath]")
endforeach()
endforeach()
Expand Down
68 changes: 68 additions & 0 deletions indra/cmake/Velopack.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# -*- cmake -*-
# Velopack installer and update framework integration
# https://velopack.io/

include_guard()

# USE_VELOPACK controls whether to use Velopack for installer packaging (instead of NSIS/DMG)
option(USE_VELOPACK "Use Velopack for installer packaging" OFF)

if (WINDOWS)
include(Prebuilt)
use_prebuilt_binary(velopack)

add_library(ll::velopack INTERFACE IMPORTED)

target_include_directories(ll::velopack SYSTEM INTERFACE
${LIBS_PREBUILT_DIR}/include/velopack
)

target_link_libraries(ll::velopack INTERFACE
${ARCH_PREBUILT_DIRS_RELEASE}/velopack_libc.lib
)

# Windows system libraries required by Velopack
target_link_libraries(ll::velopack INTERFACE
winhttp
ole32
shell32
shlwapi
version
userenv
ws2_32
bcrypt
ntdll
)

target_compile_definitions(ll::velopack INTERFACE LL_VELOPACK=1)

elseif (DARWIN)
include(Prebuilt)
use_prebuilt_binary(velopack)

add_library(ll::velopack INTERFACE IMPORTED)

target_include_directories(ll::velopack SYSTEM INTERFACE
${LIBS_PREBUILT_DIR}/include/velopack
)

target_link_libraries(ll::velopack INTERFACE
${ARCH_PREBUILT_DIRS_RELEASE}/libvelopack_libc.a
)

# macOS system frameworks required by Velopack (Rust static library dependencies)
target_link_libraries(ll::velopack INTERFACE
"-framework Foundation"
"-framework Security"
"-framework SystemConfiguration"
"-framework AppKit"
"-framework CoreFoundation"
"-framework CoreServices"
"-framework IOKit"
"-liconv"
"-lresolv"
)

target_compile_definitions(ll::velopack INTERFACE LL_VELOPACK=1)

endif()
3 changes: 2 additions & 1 deletion indra/lib/python/indra/util/llmanifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def get_default_platform(dummy):
for use by a .bat file.""",
default=None),
dict(name='versionfile',
description="""The name of a file containing the full version number."""),
description="""The name of a file containing the full version number.""",
default=None),
]

def usage(arguments, srctree=""):
Expand Down
18 changes: 15 additions & 3 deletions indra/llcommon/workqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown)
{
// Register for "LLApp" events so we can implicitly close() on viewer shutdown
std::string listener_name = "WorkQueue:" + getKey();
LLEventPumps::instance().obtain("LLApp").listen(
LLEventPumps* pump = LLEventPumps::getInstance();
pump->obtain("LLApp").listen(
listener_name,
[this](const LLSD& stat)
{
Expand All @@ -54,14 +55,25 @@ LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown)

// Store the listener name so we can unregister in the destructor
mListenerName = listener_name;
mPumpHandle = pump->getHandle();
}
}

LL::WorkQueueBase::~WorkQueueBase()
{
if (!mListenerName.empty() && !LLEventPumps::wasDeleted())
if (!mListenerName.empty() && !mPumpHandle.isDead())
{
LLEventPumps::instance().obtain("LLApp").stopListening(mListenerName);
// Due to shutdown order issues, use handle, not a singleton
// and ignore fiber issue.
try
{
LLEventPumps* pump = mPumpHandle.get();
pump->obtain("LLApp").stopListening(mListenerName);
}
catch (const boost::fibers::lock_error&)
{
// Likely mutex is down, ignore
}
}
}

Expand Down
Loading
Loading