Commit Graph

99 Commits (2ba4a164e25e66bc217ddab8267def92617bdcb0)

Author SHA1 Message Date
Bennett Goble f729cfc33f SL-15742: Convert build scripts to Python 3
This changeset makes it possible to build the Second Life viewer using
Python 3. It is designed to be used with an equivalent Autobuild branch
so that a developer can compile without needing Python 2 on their
machine.

Breaking change: Python 2 support ending

Rather than supporting two versions of Python, including one that was
discontinued at the beginning of the year, this branch focuses on
pouring future effort into Python 3 only. As a result, scripts do not
need to be backwards compatible. This means that build environments,
be they on personal computers and on build agents, need to have a
compatible interpreter.

Notes

- SLVersionChecker will still use Python 2 on macOS
- Fixed the message template url used by template_verifier.py
2021-12-10 14:42:49 -08:00
Nat Goodspeed 4174bb3640 DRTVWR-476: Disable test_httprequest.hpp on Mac Release builds.
For reasons not yet diagnosed, specifically in Mac Release builds, the tests
in test_httprequest.hpp consistently crash with a backtrace suggesting that
the worker thread is calling LLCore::HttpLibcurl::completeRequest() after the
foreground thread calls HttpRequest::destroyService().

Weirdly, even executing a tut::skip() call in every test<n>() function up to
the point of the crash does not eliminate the crash.
2020-03-25 18:44:04 -04:00
Nat Goodspeed 2902f23a41 DRTVWR-476: Remove special llcorehttp test memory manager.
NickyD discovered that the substitute default allocator used for llcorehttp
tests was returning badly-aligned storage, which caused access violations on
alignment-sensitive data such as std::atomic. Thanks Nicky!!

Moreover, the llcorehttp test assertions regarding memory usage, well-
intentioned though they are, have been causing us trouble for years. Many have
already been disabled.

The problem is that use of test_allocator.h affected *everything* defined with
that header file's declarations visible. That inevitably included specific
functions in other subsystems. Those functions then (unintentionally) consumed
the special allocator, throwing off the memory tracking and making certain
memory-related assertions consistently fail.

This is a particular, observable bad effect of One Definition Rule violations.
Within a given program, C++ allows multiple definitions for the same entity,
but requires that all such definitions be the same. Partial visibility of the
global operator new() and operator delete() overrides meant that some
definitions of certain entities used the default global allocator, some used
llcorehttp's. There may have been other, more subtle bad effects of these ODR
violations.

If one wanted to reimplement verification of the memory consumption of
llcorehttp classes:

* Each llcorehttp class (for which memory tracking was desired) should declare
  class-specific operator new() and operator delete() methods. Naturally,
  these would all consume a central llcorehttp-specific allocator, but that
  allocator should *not* be named global operator new().
* Presumably that would require runtime indirection to allow using the default
  allocator in production while substituting the special allocator for tests.
* Recording and verifying the memory consumption in each test should be
  performed in the test-object constructor and destructor, rather than being
  sprinkled throughout the test<n>() methods.
* With that mechanism in place, the test object should provide methods to
  adjust (or entirely disable) memory verification for a particular test.
* The test object should also provide a "yes, we're still consuming llcorehttp
  memory" method to be used for spot checks in the middle of tests -- instead
  of sprinkling in explicit comparisons as before.
* In fact, the llcorehttp test object in each test_*.hpp file should be
  derived from a central llcorehttp test-object base class providing those
  methods.
2020-03-25 18:44:04 -04:00
Nat Goodspeed 663b9ff6af DRTVWR-476: pthread_self() also needs CRYPTO_THREADID_set_pointer() 2020-03-25 16:12:46 -04:00
Nat Goodspeed 25a658440d DRTVWR-476: Remove throw(T) from operator new(), operator delete().
llcorehttp's test_allocator.{h,cpp} overrides global operator new(), operator
new[](), operator delete() and operator delete[](). The two operator new()
functions used to be declared with throw(std::bad_alloc). Worse, for VS 2013
and previous, we needed _THROW0() and _THROW1(std::bad_alloc) instead,
requiring #if logic.

But with dynamic throw declarations deprecated, we must actually remove those.
That obviates the THROW_BAD_ALLOC() / THROW_NOTHING() workarounds in
test_allocator.cpp.
2020-03-25 16:12:46 -04:00
Nat Goodspeed 3753dbd5ed DRTVWR-476: Use OpenSSL API suitable for 64-bit pointers.
In three different places we use the same pattern: an ssl_thread_id_callback()
function (a static member of LLCrashLogger, in that case) that used to be
passed to CRYPTO_set_id_callback() and therefore returned an unsigned long
representing the ID of the current thread.

But GetCurrentThread() is a HANDLE, an alias for a pointer, and you can't
uniquely cram a 64-bit pointer into an unsigned long.

Fortunately OpenSSL has a more modern API for retrieving thread ID. Pass
each ssl_thread_id_callback() function to CRYPTO_THREADID_set_callback()
instead, converting it to accept CRYPTO_THREADID* and call
CRYPTO_THREADID_set_pointer() or CRYPTO_THREADID_set_numeric() as appropriate().
2020-03-25 16:12:46 -04:00
andreykproductengine 344a3a040f Teamcity W64 build freeze. 2019-02-15 22:05:44 +02:00
andreykproductengine eb1c3c5cbb Fix for teamcity W64 build freeze. 2019-02-08 22:22:06 +02:00
Oz Linden f561b11fb8 disable RefCounted tests in llcorehttp because they hang the win64 build in TeamCity 2018-08-30 14:56:52 -04:00
Nat Goodspeed 1e49cd9b00 DRTVWR-418: Disable more needlessly fragile memory consumption tests. 2017-09-20 17:11:06 -04:00
Nat Goodspeed 2368c44a8e DRTVWR-418: Disable another fragile llcorehttp memory-usage check. 2017-08-15 16:31:17 -04:00
Nat Goodspeed a0c1842595 DRTVWR-418: Fix syntax for previous test skip. 2017-02-13 16:53:18 -05:00
Nat Goodspeed a971909a34 DRTVWR-418: Reluctantly skip llcorehttp 503-with-retry test on W64. 2017-02-13 16:07:38 -05:00
Nat Goodspeed 434f0e161a Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2017-02-03 09:54:52 -05:00
Nat Goodspeed 40fb9d3e58 DRTVWR-418: Use U32 for int (and hex) of HttpStatus in 64-bit too.
Turns out that Monty didn't intend for the int-flavored representation of
HttpStatus to expand to 64 bits even when unsigned long is that wide. So
change the implicit conversion operator, and its uses, to U32 instead. That
produces a consistent toHex() result for both 32-bit and 64-bit builds.
2016-12-19 16:30:19 -05:00
Nat Goodspeed a4b0159d57 DRTVWR-418: Adjust HttpStatus::toHex() test for 64-bit result. 2016-12-16 19:05:59 -05:00
Nat Goodspeed 50a3f19f1a DRTVWR-418: Overriding shutdown_request() wasn't the issue. Remove. 2016-12-07 22:49:32 -05:00
Nat Goodspeed 6dd0a500ea Automated merge with ssh://bitbucket.org/lindenlab/viewer-skip-llcorehttp-test 2016-12-07 16:06:32 -05:00
Nat Goodspeed 5bb456d80c DRTVWR-418: Apparently (some) Windows hosts still need freeport().
This is the function in indra/llmessage/tests/testrunner.py that iterates
through ports in a specified range, looking for an available one. Other
platforms understand a specification of port 0 to mean: "You pick one. I'll
just use whichever one you picked."
2016-12-07 14:10:32 -05:00
Oz Linden 232c359854 merge nats even newer fix for the llcorehttp test 2016-12-07 10:09:58 -05:00
Nat Goodspeed 0532e298a0 DRTVWR-418: Reinstate test that we THOUGHT was killing test run.
But since the real problem is quite different, try with that suspected test
restored.
2016-12-07 10:05:24 -05:00
Nat Goodspeed e1482838fe DRTVWR-418: Fix a couple variable references in debugging output. 2016-12-07 09:44:55 -05:00
Nat Goodspeed a4ba22fecc DRTVWR-418: Revamp testrunner to shutdown server Thread at end.
Instead of having testrunner.run()'s caller pass a Thread object on which to
run the caller's server instance's serve_forever() method, just pass the
server instance. testrunner.run() now constructs the Thread. This API change
allows run() to also call shutdown() on the server instance when done, and
then join() the Thread.

The hope is that this will avoid the Python runtime forcing the process
termination code to 1 due to forcibly killing the daemon thread still running
serve_forever().

While at it, eliminate calls to testrunner.freeport() -- just make the runtime
pick a suitable port instead.
2016-12-07 09:30:49 -05:00
Nat Goodspeed e1b0317c04 DRTVWR-418: Remove duplicate testrunner.py 2016-12-06 19:44:57 -05:00
Oz Linden 86bd3ffa47 pick up latest fixes from nat 2016-12-06 17:33:23 -05:00
Nat Goodspeed 40b1913af3 DRTVWR-418: Fix minor error in forwarding shutdown_request() call. 2016-12-06 16:20:43 -05:00
Nat Goodspeed 43c9a7d706 Fix minor error in forwarding shutdown_request() call. 2016-12-06 16:19:32 -05:00
Nat Goodspeed e47b178fb9 Try even harder to ignore errors in llcorehttp's dummy server. 2016-12-06 16:09:26 -05:00
Nat Goodspeed 4aae3e8eb4 DRTVWR-418: Try harder to ignore errors in llcorehttp's dummy server. 2016-12-06 16:07:05 -05:00
Nat Goodspeed 4c89e6dea0 DRTVWR-418: Skip the whole of the failing llcorehttp test function. 2016-12-06 15:38:31 -05:00
Oz Linden adf74f8ced merge skip of llcorehttp failing test 2016-12-06 14:58:06 -05:00
Nat Goodspeed 8948c4f001 DRTVWR-418: Skip the llcorehttp test that breaks test machinery.
Loath though I am to skip testing, this consistent failure is not a failure in
the software being tested (llcorehttp) but rather in the dummy server with
which we're testing it.
2016-12-06 14:22:42 -05:00
Nat Goodspeed 780120dc46 DRTVWR-418: Remove ThreadingMixin from our HTTPServer subclass.
It's possible that raising an exception in a worker thread -- even though
we're TRYING to suppress it -- is what's causing the process to terminate with
nonzero rc.
2016-12-06 12:19:01 -05:00
Nat Goodspeed e9a9e3d4ba DRTVWR-418: Try for more llcorehttp tests error diagnostics. 2016-12-06 09:32:36 -05:00
Nat Goodspeed 73a7b14013 DRTVWR-418: Fold redundant testrunner.py modules together again.
llcorehttp/tests had a clone of llmessage/tests/testrunner.py that was almost
identical save for recognizing an extra optional parameter. Migrate those few
lines into llmessage/tests/testrunner.py; eliminate the copy in llcorehttp;
help test_llcorehttp_peer.py find the testrunner.py in llmessage/tests.
2016-11-17 17:46:50 -05:00
Nat Goodspeed b6dc755786 Automated merge with ssh://bitbucket.org/lindenlab/viewer-skip-llcorehttp-test 2016-12-08 14:27:40 -05:00
AndreyL ProductEngine 7fceb3a63f Merged in lindenlab/viewer-cleanup 2016-11-14 22:04:37 +02:00
Nat Goodspeed f4ecfd9cb9 MAINT-5232: Disable unrealistic failing checks on GetMemTotal(). 2016-09-27 10:41:24 -04:00
Nat Goodspeed acbee7ffab MAINT-5232: Give up on running mem test twice: doesn't work 2016-09-27 10:36:14 -04:00
Nat Goodspeed 1a34afb1cc MAINT-5232: Try workaround for dubious llcorehttp mem usage test. 2016-09-23 06:16:46 -07:00
Nat Goodspeed c92eb7e591 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2016-08-30 11:36:06 -04:00
Glenn Glazer 5ab6b73d57 MAINT-6585: redirect elementtree to llbase version 2016-07-21 14:03:19 -07:00
Glenn Glazer 3ea324c1c4 MAINT=6585: migrate from local python libraries to canonical llbase 2016-07-20 11:47:08 -07:00
Oz Linden 9be58e915a merge with 4.0.3-release 2016-04-04 15:53:09 -04:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Rider Linden 8d334ca1bf MAINT-5271: Converted internal pointers to internal operation to managed shared pointers. Removed direct cast and dereference of handles. 2015-10-16 11:40:48 -07:00
Rider Linden 6ff0bff8f0 Another fix for unit tests. Missed on Windows. 2015-10-15 11:42:43 -07:00
Rider Linden b30e408a42 MAINT-5732: Update unit tests 2015-10-15 11:03:13 -07:00
Rider Linden 7ff38e34ea Update the unit tests to use the new pointer type. 2015-07-08 12:44:57 -07:00
Nat Goodspeed 107b9bcb70 MAINT-5232: Introduce SUBSYSTEM_CLEANUP() macro
and use it for existing LLSomeClass::cleanupClass() calls.
This logs the fact of making the call, as well as making it.
2015-05-20 10:56:09 -04:00