Skip to content

Commit 4c791e0

Browse files
committed
Merge remote-tracking branch 'origin/main' into DRTVWR-596
2 parents c74dbc6 + a592292 commit 4c791e0

File tree

110 files changed

+4323
-8232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+4323
-8232
lines changed

.github/workflows/build.yaml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ jobs:
254254
runs-on: windows
255255
steps:
256256
- name: Sign and package Windows viewer
257-
uses: secondlife/viewer-build-util/sign-pkg-windows@main
257+
uses: secondlife/viewer-build-util/sign-pkg-windows@v1
258258
with:
259259
vault_uri: "${{ secrets.AZURE_KEY_VAULT_URI }}"
260260
cert_name: "${{ secrets.AZURE_CERT_NAME }}"
@@ -286,7 +286,7 @@ jobs:
286286
[[ -n "$USERNAME" && -n "$PASSWORD" && -n "$TEAM_ID" ]]
287287
288288
- name: Sign and package Mac viewer
289-
uses: secondlife/viewer-build-util/sign-pkg-mac@main
289+
uses: secondlife/viewer-build-util/sign-pkg-mac@v1
290290
with:
291291
channel: ${{ needs.build.outputs.viewer_channel }}
292292
imagename: ${{ needs.build.outputs.imagename }}
@@ -302,7 +302,7 @@ jobs:
302302
runs-on: ubuntu-latest
303303
steps:
304304
- name: Post Windows symbols
305-
uses: secondlife/viewer-build-util/post-bugsplat-windows@main
305+
uses: secondlife/viewer-build-util/post-bugsplat-windows@v1
306306
with:
307307
username: ${{ secrets.BUGSPLAT_USER }}
308308
password: ${{ secrets.BUGSPLAT_PASS }}
@@ -315,7 +315,7 @@ jobs:
315315
runs-on: ubuntu-latest
316316
steps:
317317
- name: Post Mac symbols
318-
uses: secondlife/viewer-build-util/post-bugsplat-mac@main
318+
uses: secondlife/viewer-build-util/post-bugsplat-mac@v1
319319
with:
320320
username: ${{ secrets.BUGSPLAT_USER }}
321321
password: ${{ secrets.BUGSPLAT_PASS }}
@@ -330,29 +330,29 @@ jobs:
330330
steps:
331331
- uses: actions/download-artifact@v3
332332
with:
333-
path: artifacts
333+
name: Windows-installer
334334

335-
- name: Reshuffle artifact files
336-
uses: secondlife/viewer-build-util/release-artifacts@main
335+
- uses: actions/download-artifact@v3
336+
with:
337+
name: macOS-installer
338+
339+
- uses: actions/download-artifact@v3
337340
with:
338-
input-path: artifacts
339-
output-path: assets
340-
# The *-app artifacts are for use only by the signing and
341-
# packaging steps. Once we've generated signed installers, we no
342-
# longer need them, and we CERTAINLY don't want to publish
343-
# thousands of individual files as separate URLs.
344-
exclude: |-
345-
Windows-app
346-
macOS-app
347-
# Use just "Windows" or "macOS" prefix because these are the only
348-
# artifacts in which we expect files from both platforms with
349-
# colliding names (e.g. autobuild-package.xml). release-artifacts
350-
# normally resolves collisions by prepending the artifact name, so
351-
# when we anticipate collisions, it's good to keep the prefix
352-
# short and sweet.
353-
prefix: |-
354-
Windows-metadata=Windows
355-
macOS-metadata=macOS
341+
name: Windows-metadata
342+
343+
- name: Rename windows metadata
344+
run: |
345+
mv autobuild-package.xml Windows-autobuild-package.xml
346+
mv newview/viewer_version.txt Windows-viewer_version.txt
347+
348+
- uses: actions/download-artifact@v3
349+
with:
350+
name: macOS-metadata
351+
352+
- name: Rename macOS metadata
353+
run: |
354+
mv autobuild-package.xml macOS-autobuild-package.xml
355+
mv newview/viewer_version.txt macOS-viewer_version.txt
356356
357357
# forked from softprops/action-gh-release
358358
- uses: secondlife-3p/action-gh-release@v1
@@ -364,4 +364,8 @@ jobs:
364364
generate_release_notes: true
365365
# the only reason we generate a GH release is to post build products
366366
fail_on_unmatched_files: true
367-
files: "assets/*"
367+
files: |
368+
*.dmg
369+
*.exe
370+
*-autobuild-package.xml
371+
*-viewer_version.txt

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,4 @@ web/locale.*
8989
web/secondlife.com.*
9090

9191
.env
92+
.vscode

autobuild.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,11 +2563,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
25632563
<key>archive</key>
25642564
<map>
25652565
<key>hash</key>
2566-
<string>d8bc8720846cfa31e23e7e1008e32ba6ad4a8322</string>
2566+
<string>eb1316584188dafb591f80b46b357c737f90d1a7</string>
25672567
<key>hash_algorithm</key>
25682568
<string>sha1</string>
25692569
<key>url</key>
2570-
<string>https://github.com/secondlife/viewer-manager/releases/download/v3.0.cc7ea1e/viewer_manager-3.0.cc7ea1e-darwin64-cc7ea1e.tar.zst</string>
2570+
<string>https://github.com/secondlife/viewer-manager/releases/download/v3.0-08bf5ee/viewer_manager-3.0-08bf5ee-darwin64-08bf5ee.tar.zst</string>
25712571
</map>
25722572
<key>name</key>
25732573
<string>darwin64</string>
@@ -2577,11 +2577,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
25772577
<key>archive</key>
25782578
<map>
25792579
<key>hash</key>
2580-
<string>228fae4ee0ce12b9d1d1b0a8ebb0bdf58ee521eb</string>
2580+
<string>f4677b0ebd9880f29c118af51ada50883dd0a1e4</string>
25812581
<key>hash_algorithm</key>
25822582
<string>sha1</string>
25832583
<key>url</key>
2584-
<string>https://github.com/secondlife/viewer-manager/releases/download/v3.0.cc7ea1e/viewer_manager-3.0.cc7ea1e-linux64-cc7ea1e.tar.zst</string>
2584+
<string>https://github.com/secondlife/viewer-manager/releases/download/v3.0-08bf5ee/viewer_manager-3.0-08bf5ee-linux64-08bf5ee.tar.zst</string>
25852585
</map>
25862586
<key>name</key>
25872587
<string>linux64</string>
@@ -2591,11 +2591,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
25912591
<key>archive</key>
25922592
<map>
25932593
<key>hash</key>
2594-
<string>ca6999b64d96d45952fe872b381db9b2abc0248c</string>
2594+
<string>7426c5a1d7eb231b476625637a1f2daba0a6bc55</string>
25952595
<key>hash_algorithm</key>
25962596
<string>sha1</string>
25972597
<key>url</key>
2598-
<string>https://github.com/secondlife/viewer-manager/releases/download/v3.0.cc7ea1e/viewer_manager-3.0.cc7ea1e-windows64-cc7ea1e.tar.zst</string>
2598+
<string>https://github.com/secondlife/viewer-manager/releases/download/v3.0-08bf5ee/viewer_manager-3.0-08bf5ee-windows64-08bf5ee.tar.zst</string>
25992599
</map>
26002600
<key>name</key>
26012601
<string>windows64</string>
@@ -2608,7 +2608,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
26082608
<key>copyright</key>
26092609
<string>Copyright (c) 2000-2012, Linden Research, Inc.</string>
26102610
<key>version</key>
2611-
<string>3.0.cc7ea1e</string>
2611+
<string>3.0-08bf5ee</string>
26122612
<key>name</key>
26132613
<string>viewer-manager</string>
26142614
<key>description</key>

doc/contributions.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ Ansariel Hiller
240240
SL-18432
241241
SL-19140
242242
SL-4126
243+
SL-20224
243244
Aralara Rajal
244245
Arare Chantilly
245246
CHUIBUG-191
@@ -929,6 +930,8 @@ LSL Scientist
929930
Lamorna Proctor
930931
Lares Carter
931932
Larry Pixel
933+
Lars Næsbye Christensen
934+
SL-20054
932935
Laurent Bechir
933936
Leal Choche
934937
Lenae Munz

indra/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ else()
2929
set( USE_AUTOBUILD_3P ON )
3030
endif()
3131

32-
# The viewer code base can now be successfully compiled with -std=c++14. But
33-
# turning that on in the generic viewer-build-variables/variables file would
34-
# potentially require tweaking each of our ~50 third-party library builds.
35-
# Until we decide to set -std=c++14 in viewer-build-variables/variables, set
36-
# it locally here: we want to at least prevent inadvertently reintroducing
37-
# viewer code that would fail with C++14.
38-
set(CMAKE_CXX_STANDARD 17)
39-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
40-
4132
include(Variables)
4233
include(BuildVersion)
4334

indra/cmake/Copy3rdPartyLibs.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ if(WINDOWS)
8686
endif (USE_BUGSPLAT)
8787

8888
if (TARGET ll::fmodstudio)
89-
set(debug_files ${debug_files} fmodL.dll)
89+
# fmodL is included for logging, only one should be picked by manifest
90+
set(release_files ${release_files} fmodL.dll)
9091
set(release_files ${release_files} fmod.dll)
9192
endif ()
9293

indra/cmake/Python.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ elseif (WINDOWS)
1313
foreach(hive HKEY_CURRENT_USER HKEY_LOCAL_MACHINE)
1414
# prefer more recent Python versions to older ones, if multiple versions
1515
# are installed
16-
foreach(pyver 3.11 3.10 3.9 3.8 3.7)
16+
foreach(pyver 3.12 3.11 3.10 3.9 3.8 3.7)
1717
list(APPEND regpaths "[${hive}\\SOFTWARE\\Python\\PythonCore\\${pyver}\\InstallPath]")
1818
endforeach()
1919
endforeach()
@@ -40,7 +40,7 @@ elseif (WINDOWS)
4040
${regpaths}
4141
${pymaybe}
4242
)
43-
include(FindPythonInterp)
43+
find_package(Python3 COMPONENTS Interpreter)
4444
else()
4545
find_program(python python3)
4646

indra/llcommon/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ include(Tracy)
1616

1717

1818
set(llcommon_SOURCE_FILES
19+
apply.cpp
1920
commoncontrol.cpp
2021
indra_constants.cpp
22+
lazyeventapi.cpp
2123
llallocator.cpp
2224
llallocator_heap_profile.cpp
2325
llapp.cpp
@@ -115,12 +117,16 @@ set(llcommon_SOURCE_FILES
115117
set(llcommon_HEADER_FILES
116118
CMakeLists.txt
117119

120+
always_return.h
121+
apply.h
118122
chrono.h
119123
classic_callback.h
120124
commoncontrol.h
121125
ctype_workaround.h
122126
fix_macros.h
127+
function_types.h
123128
indra_constants.h
129+
lazyeventapi.h
124130
linden_common.h
125131
llalignedarray.h
126132
llallocator.h
@@ -292,9 +298,11 @@ if (LL_TESTS)
292298

293299
#set(TEST_DEBUG on)
294300
set(test_libs llcommon)
301+
LL_ADD_INTEGRATION_TEST(apply "" "${test_libs}")
295302
LL_ADD_INTEGRATION_TEST(bitpack "" "${test_libs}")
296303
LL_ADD_INTEGRATION_TEST(classic_callback "" "${test_libs}")
297304
LL_ADD_INTEGRATION_TEST(commonmisc "" "${test_libs}")
305+
LL_ADD_INTEGRATION_TEST(lazyeventapi "" "${test_libs}")
298306
LL_ADD_INTEGRATION_TEST(llbase64 "" "${test_libs}")
299307
LL_ADD_INTEGRATION_TEST(llcond "" "${test_libs}")
300308
LL_ADD_INTEGRATION_TEST(lldate "" "${test_libs}")

indra/llcommon/always_return.h

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/**
2+
* @file always_return.h
3+
* @author Nat Goodspeed
4+
* @date 2023-01-20
5+
* @brief Call specified callable with arbitrary arguments, but always return
6+
* specified type.
7+
*
8+
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
9+
* Copyright (c) 2023, Linden Research, Inc.
10+
* $/LicenseInfo$
11+
*/
12+
13+
#if ! defined(LL_ALWAYS_RETURN_H)
14+
#define LL_ALWAYS_RETURN_H
15+
16+
#include <type_traits> // std::enable_if, std::is_convertible
17+
18+
namespace LL
19+
{
20+
21+
#if __cpp_lib_is_invocable >= 201703L // C++17
22+
template <typename CALLABLE, typename... ARGS>
23+
using invoke_result = std::invoke_result<CALLABLE, ARGS...>;
24+
#else // C++14
25+
template <typename CALLABLE, typename... ARGS>
26+
using invoke_result = std::result_of<CALLABLE(ARGS...)>;
27+
#endif // C++14
28+
29+
/**
30+
* AlwaysReturn<T>()(some_function, some_args...) calls
31+
* some_function(some_args...). It is guaranteed to return a value of type
32+
* T, regardless of the return type of some_function(). If some_function()
33+
* returns a type convertible to T, it will convert and return that value.
34+
* Otherwise (notably if some_function() is void), AlwaysReturn returns
35+
* T().
36+
*
37+
* When some_function() returns a type not convertible to T, if
38+
* you want AlwaysReturn to return some T value other than
39+
* default-constructed T(), pass that value to AlwaysReturn's constructor.
40+
*/
41+
template <typename DESIRED>
42+
class AlwaysReturn
43+
{
44+
public:
45+
/// pass explicit default value if other than default-constructed type
46+
AlwaysReturn(const DESIRED& dft=DESIRED()): mDefault(dft) {}
47+
48+
// callable returns a type not convertible to DESIRED, return default
49+
template <typename CALLABLE, typename... ARGS,
50+
typename std::enable_if<
51+
! std::is_convertible<
52+
typename invoke_result<CALLABLE, ARGS...>::type,
53+
DESIRED
54+
>::value,
55+
bool
56+
>::type=true>
57+
DESIRED operator()(CALLABLE&& callable, ARGS&&... args)
58+
{
59+
// discard whatever callable(args) returns
60+
std::forward<CALLABLE>(callable)(std::forward<ARGS>(args)...);
61+
return mDefault;
62+
}
63+
64+
// callable returns a type convertible to DESIRED
65+
template <typename CALLABLE, typename... ARGS,
66+
typename std::enable_if<
67+
std::is_convertible<
68+
typename invoke_result<CALLABLE, ARGS...>::type,
69+
DESIRED
70+
>::value,
71+
bool
72+
>::type=true>
73+
DESIRED operator()(CALLABLE&& callable, ARGS&&... args)
74+
{
75+
return { std::forward<CALLABLE>(callable)(std::forward<ARGS>(args)...) };
76+
}
77+
78+
private:
79+
DESIRED mDefault;
80+
};
81+
82+
/**
83+
* always_return<T>(some_function, some_args...) calls
84+
* some_function(some_args...). It is guaranteed to return a value of type
85+
* T, regardless of the return type of some_function(). If some_function()
86+
* returns a type convertible to T, it will convert and return that value.
87+
* Otherwise (notably if some_function() is void), always_return() returns
88+
* T().
89+
*/
90+
template <typename DESIRED, typename CALLABLE, typename... ARGS>
91+
DESIRED always_return(CALLABLE&& callable, ARGS&&... args)
92+
{
93+
return AlwaysReturn<DESIRED>()(std::forward<CALLABLE>(callable),
94+
std::forward<ARGS>(args)...);
95+
}
96+
97+
/**
98+
* make_always_return<T>(some_function) returns a callable which, when
99+
* called with appropriate some_function() arguments, always returns a
100+
* value of type T, regardless of the return type of some_function(). If
101+
* some_function() returns a type convertible to T, the returned callable
102+
* will convert and return that value. Otherwise (notably if
103+
* some_function() is void), the returned callable returns T().
104+
*
105+
* When some_function() returns a type not convertible to T, if
106+
* you want the returned callable to return some T value other than
107+
* default-constructed T(), pass that value to make_always_return() as its
108+
* optional second argument.
109+
*/
110+
template <typename DESIRED, typename CALLABLE>
111+
auto make_always_return(CALLABLE&& callable, const DESIRED& dft=DESIRED())
112+
{
113+
return
114+
[dft, callable = std::forward<CALLABLE>(callable)]
115+
(auto&&... args)
116+
{
117+
return AlwaysReturn<DESIRED>(dft)(callable,
118+
std::forward<decltype(args)>(args)...);
119+
};
120+
}
121+
122+
} // namespace LL
123+
124+
#endif /* ! defined(LL_ALWAYS_RETURN_H) */

0 commit comments

Comments
 (0)