Skip to content

Commit 4319629

Browse files
author
Rye
authored
Merge pull request #2855 from secondlife/rye/buildtests
Reduce build time on all three platforms and introduce linux tests
2 parents d0e0a93 + 3a052bd commit 4319629

24 files changed

+126
-192
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ jobs:
138138
libxcursor-dev libxfixes-dev libgstreamer1.0-dev \
139139
libgstreamer-plugins-base1.0-dev ninja-build libxft-dev \
140140
llvm mold libpipewire-0.3-dev libdbus-1-dev
141+
sudo locale-gen en_US.UTF-8
142+
sudo locale-gen en_GB.UTF-8
143+
sudo locale-gen fr_FR.UTF-8
141144
142145
- name: Install windows dependencies
143146
if: runner.os == 'Windows'
@@ -264,13 +267,6 @@ jobs:
264267
fi
265268
export PYTHON_COMMAND_NATIVE="$(native_path "$PYTHON_COMMAND")"
266269
267-
# Compile with clang, link with mold on linux.
268-
if [[ "$RUNNER_OS" == "Linux" ]]; then
269-
export CC=clang
270-
export CXX=clang++
271-
export CMAKE_OPTIONS='-DLINK_WITH_MOLD=ON'
272-
fi
273-
274270
./build.sh
275271
276272
# Each artifact is downloaded as a distinct .zip file. Multiple jobs

autobuild.xml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3147,14 +3147,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
31473147
<key>build</key>
31483148
<map>
31493149
<key>command</key>
3150-
<string>xcodebuild</string>
3150+
<string>cmake</string>
31513151
<key>options</key>
31523152
<array>
3153-
<string>-configuration</string>
3153+
<string>--build</string>
3154+
<string>.</string>
3155+
<string>--config</string>
31543156
<string>RelWithDebInfo</string>
3155-
<string>-project</string>
3156-
<string>SecondLife.xcodeproj</string>
3157-
<string>-parallelizeTargets</string>
3157+
<string>--parallel</string>
3158+
<string>$AUTOBUILD_CPU_COUNT</string>
31583159
</array>
31593160
</map>
31603161
<key>default</key>
@@ -3175,14 +3176,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
31753176
<key>build</key>
31763177
<map>
31773178
<key>command</key>
3178-
<string>xcodebuild</string>
3179+
<string>cmake</string>
31793180
<key>options</key>
31803181
<array>
3181-
<string>-configuration</string>
3182+
<string>--build</string>
3183+
<string>.</string>
3184+
<string>--config</string>
31823185
<string>RelWithDebInfo</string>
3183-
<string>-project</string>
3184-
<string>SecondLife.xcodeproj</string>
3185-
<string>-parallelizeTargets</string>
3186+
<string>--parallel</string>
3187+
<string>$AUTOBUILD_CPU_COUNT</string>
31863188
</array>
31873189
</map>
31883190
<key>name</key>
@@ -3205,14 +3207,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
32053207
<key>build</key>
32063208
<map>
32073209
<key>command</key>
3208-
<string>xcodebuild</string>
3210+
<string>cmake</string>
32093211
<key>options</key>
32103212
<array>
3211-
<string>-configuration</string>
3213+
<string>--build</string>
3214+
<string>.</string>
3215+
<string>--config</string>
32123216
<string>Release</string>
3213-
<string>-project</string>
3214-
<string>SecondLife.xcodeproj</string>
3215-
<string>-parallelizeTargets</string>
3217+
<string>--parallel</string>
3218+
<string>$AUTOBUILD_CPU_COUNT</string>
32163219
</array>
32173220
</map>
32183221
<key>name</key>
@@ -3231,14 +3234,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
32313234
<key>build</key>
32323235
<map>
32333236
<key>command</key>
3234-
<string>xcodebuild</string>
3237+
<string>cmake</string>
32353238
<key>options</key>
32363239
<array>
3237-
<string>-configuration</string>
3240+
<string>--build</string>
3241+
<string>.</string>
3242+
<string>--config</string>
32383243
<string>Release</string>
3239-
<string>-project</string>
3240-
<string>SecondLife.xcodeproj</string>
3241-
<string>-parallelizeTargets</string>
3244+
<string>--parallel</string>
3245+
<string>$AUTOBUILD_CPU_COUNT</string>
32423246
</array>
32433247
</map>
32443248
<key>name</key>

build.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,9 @@ pre_build()
201201
# honor autobuild_configure_parameters same as sling-buildscripts
202202
eval_autobuild_configure_parameters=$(eval $(echo echo $autobuild_configure_parameters))
203203

204-
# We build the viewer on Linux, but we haven't committed to support the
205-
# Linux viewer. As of 2024-05-30, Linux build-time test infrastructure is
206-
# not in place, so don't even bother running tests on Linux.
207-
if [[ "$RUNNER_OS" == "Linux" ]]
208-
then LL_TESTS=OFF
209-
else LL_TESTS=ON
210-
fi
211-
212204
"$autobuild" configure --quiet -c $variant \
213205
${eval_autobuild_configure_parameters:---} \
214-
-DLL_TESTS:BOOL=$LL_TESTS \
206+
-DLL_TESTS:BOOL=ON \
215207
-DPACKAGE:BOOL=ON \
216208
-DHAVOK:BOOL="$HAVOK" \
217209
-DRELEASE_CRASH_REPORTING:BOOL="$RELEASE_CRASH_REPORTING" \

indra/cmake/00-Common.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS)
3535

3636
# Force enable SSE2 instructions in GLM per the manual
3737
# https://github.com/g-truc/glm/blob/master/manual.md#section2_10
38-
add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1)
38+
add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1 GLM_ENABLE_EXPERIMENTAL=1)
3939

4040
# Configure crash reporting
4141
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
@@ -49,6 +49,11 @@ if(NON_RELEASE_CRASH_REPORTING)
4949
add_compile_definitions( LL_SEND_CRASH_REPORTS=1)
5050
endif()
5151

52+
set(USE_LTO OFF CACHE BOOL "Enable Link Time Optimization")
53+
if(USE_LTO)
54+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
55+
endif()
56+
5257
# Don't bother with a MinSizeRel or Debug builds.
5358
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release" CACHE STRING "Supported build types." FORCE)
5459

@@ -102,7 +107,7 @@ if (WINDOWS)
102107

103108
#ND: When using something like buildcache (https://github.com/mbitsnbites/buildcache)
104109
# to make those wrappers work /Zi must be changed to /Z7, as /Zi due to it's nature is not compatible with caching
105-
if( ${CMAKE_CXX_COMPILER_LAUNCHER} MATCHES ".*cache.*")
110+
if(${CMAKE_CXX_COMPILER_LAUNCHER} MATCHES ".*cache.*")
106111
add_compile_options( /Z7 )
107112
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
108113
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")

indra/cmake/Copy3rdPartyLibs.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ elseif(LINUX)
200200
libortp.so
201201
libvivoxoal.so.1
202202
libvivoxsdk.so
203-
libSDL2.so
204203
)
205204
set(slvoice_files SLVoice)
206205

@@ -214,7 +213,8 @@ elseif(LINUX)
214213
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
215214
# *FIX - figure out what to do with duplicate libalut.so here -brad
216215
set(release_files
217-
)
216+
libSDL2-2.0.so.0
217+
)
218218

219219
if( USE_AUTOBUILD_3P )
220220
list( APPEND release_files

indra/llcorehttp/examples/http_texture_load.cpp

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252

5353
void init_curl();
5454
void term_curl();
55-
void ssl_thread_id_callback(CRYPTO_THREADID*);
56-
void ssl_locking_callback(int mode, int type, const char * file, int line);
5755
void usage(std::ostream & out);
5856

5957
// Default command line settings
@@ -606,63 +604,15 @@ void WorkingSet::loadAssetUuids(FILE * in)
606604
}
607605

608606

609-
int ssl_mutex_count(0);
610-
LLCoreInt::HttpMutex ** ssl_mutex_list = NULL;
611-
612607
void init_curl()
613608
{
614609
curl_global_init(CURL_GLOBAL_ALL);
615-
616-
ssl_mutex_count = CRYPTO_num_locks();
617-
if (ssl_mutex_count > 0)
618-
{
619-
ssl_mutex_list = new LLCoreInt::HttpMutex * [ssl_mutex_count];
620-
621-
for (int i(0); i < ssl_mutex_count; ++i)
622-
{
623-
ssl_mutex_list[i] = new LLCoreInt::HttpMutex;
624-
}
625-
626-
CRYPTO_set_locking_callback(ssl_locking_callback);
627-
CRYPTO_THREADID_set_callback(ssl_thread_id_callback);
628-
}
629610
}
630611

631612

632613
void term_curl()
633614
{
634-
CRYPTO_set_locking_callback(NULL);
635-
for (int i(0); i < ssl_mutex_count; ++i)
636-
{
637-
delete ssl_mutex_list[i];
638-
}
639-
delete [] ssl_mutex_list;
640-
}
641-
642-
643-
void ssl_thread_id_callback(CRYPTO_THREADID* pthreadid)
644-
{
645-
#if defined(WIN32)
646-
CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread());
647-
#else
648-
CRYPTO_THREADID_set_pointer(pthreadid, pthread_self());
649-
#endif
650-
}
651-
652-
653-
void ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */)
654-
{
655-
if (type >= 0 && type < ssl_mutex_count)
656-
{
657-
if (mode & CRYPTO_LOCK)
658-
{
659-
ssl_mutex_list[type]->lock();
660-
}
661-
else
662-
{
663-
ssl_mutex_list[type]->unlock();
664-
}
665-
}
615+
curl_global_cleanup();
666616
}
667617

668618

indra/llcorehttp/tests/llcorehttp_test.cpp

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@
4141
#include "test_httpstatus.hpp"
4242
#include "test_refcounted.hpp"
4343
#include "test_httpoperation.hpp"
44-
// As of 2019-06-28, test_httprequest.hpp consistently crashes on Mac Release
45-
// builds for reasons not yet diagnosed.
46-
// On Linux too, this is likely to badly handling (p)thread creation and not waiting
47-
// for threads to properly shutdown
48-
#if LL_WINDOWS
4944
#include "test_httprequest.hpp"
50-
#endif
5145

5246
#include "test_httpheaders.hpp"
5347
#include "test_httprequestqueue.hpp"
@@ -56,9 +50,6 @@
5650
#include "llproxy.h"
5751
#include "llcleanup.h"
5852

59-
void ssl_thread_id_callback(CRYPTO_THREADID*);
60-
void ssl_locking_callback(int mode, int type, const char * file, int line);
61-
6253
#if 0 // lltut provides main and runner
6354

6455
namespace tut
@@ -83,67 +74,17 @@ int main()
8374

8475
#endif // 0
8576

86-
int ssl_mutex_count(0);
87-
LLCoreInt::HttpMutex ** ssl_mutex_list = NULL;
88-
8977
void init_curl()
9078
{
9179
curl_global_init(CURL_GLOBAL_ALL);
9280

93-
ssl_mutex_count = CRYPTO_num_locks();
94-
if (ssl_mutex_count > 0)
95-
{
96-
ssl_mutex_list = new LLCoreInt::HttpMutex * [ssl_mutex_count];
97-
98-
for (int i(0); i < ssl_mutex_count; ++i)
99-
{
100-
ssl_mutex_list[i] = new LLCoreInt::HttpMutex;
101-
}
102-
103-
CRYPTO_set_locking_callback(ssl_locking_callback);
104-
CRYPTO_THREADID_set_callback(ssl_thread_id_callback);
105-
}
106-
10781
LLProxy::getInstance();
10882
}
10983

11084

11185
void term_curl()
11286
{
11387
SUBSYSTEM_CLEANUP(LLProxy);
114-
115-
CRYPTO_set_locking_callback(NULL);
116-
for (int i(0); i < ssl_mutex_count; ++i)
117-
{
118-
delete ssl_mutex_list[i];
119-
}
120-
delete [] ssl_mutex_list;
121-
}
122-
123-
124-
void ssl_thread_id_callback(CRYPTO_THREADID* pthreadid)
125-
{
126-
#if defined(WIN32)
127-
CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread());
128-
#else
129-
CRYPTO_THREADID_set_pointer(pthreadid, pthread_self());
130-
#endif
131-
}
132-
133-
134-
void ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */)
135-
{
136-
if (type >= 0 && type < ssl_mutex_count)
137-
{
138-
if (mode & CRYPTO_LOCK)
139-
{
140-
ssl_mutex_list[type]->lock();
141-
}
142-
else
143-
{
144-
ssl_mutex_list[type]->unlock();
145-
}
146-
}
14788
}
14889

14990

0 commit comments

Comments
 (0)