summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornat-goodspeed <nat@lindenlab.com>2024-01-19 08:49:01 -0500
committerGitHub <noreply@github.com>2024-01-19 08:49:01 -0500
commit337a2356a923ab5a3ac99c3adf81101084926179 (patch)
tree235939c44011201d9cc894b47a983e7384cad89e
parent5e19a58a21ce60488d8cba44ee71d22871487b3c (diff)
parent6555fb3409fbdbd412a8062962c133af7aea7614 (diff)
Merge pull request #653 from secondlife/sl-20546
SL-20546: Add metadata to GH build/release page.
-rw-r--r--.github/workflows/build.yaml19
-rwxr-xr-xbuild.sh3
-rw-r--r--indra/llcommon/classic_callback.h10
-rw-r--r--indra/llcommon/llrand.cpp14
-rw-r--r--indra/llcommon/llthread.cpp13
-rw-r--r--indra/llcommon/llthread.h2
-rw-r--r--indra/llcommon/stdtypes.h18
-rw-r--r--indra/llmessage/llxfer.cpp9
8 files changed, 45 insertions, 43 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index d11177965f..19a6a0ef6f 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,6 +24,7 @@ jobs:
outputs:
viewer_channel: ${{ steps.build.outputs.viewer_channel }}
viewer_version: ${{ steps.build.outputs.viewer_version }}
+ viewer_branch: ${{ steps.which-branch.outputs.branch }}
imagename: ${{ steps.build.outputs.imagename }}
env:
AUTOBUILD_ADDRSIZE: 64
@@ -33,6 +34,9 @@ jobs:
AUTOBUILD_GITHUB_TOKEN: ${{ secrets.SHARED_AUTOBUILD_GITHUB_TOKEN }}
AUTOBUILD_INSTALLABLE_CACHE: ${{ github.workspace }}/.autobuild-installables
AUTOBUILD_VARIABLES_FILE: ${{ github.workspace }}/.build-variables/variables
+ # Direct autobuild to store vcs_url, vcs_branch and vcs_revision in
+ # autobuild-package.xml.
+ AUTOBUILD_VCS_INFO: "true"
AUTOBUILD_VSVER: "170"
DEVELOPER_DIR: ${{ matrix.developer_dir }}
# Ensure that Linden viewer builds engage Bugsplat.
@@ -70,7 +74,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: secondlife/build-variables
- ref: viewer
+ ref: master
path: .build-variables
- name: Checkout master-message-template
@@ -96,10 +100,17 @@ jobs:
if: runner.os == 'Windows'
run: choco install nsis-unicode
+ - name: Determine source branch
+ id: which-branch
+ uses: secondlife/viewer-build-util/which-branch@v1
+ with:
+ token: ${{ github.token }}
+
- name: Build
id: build
shell: bash
env:
+ AUTOBUILD_VCS_BRANCH: ${{ steps.which-branch.outputs.branch }}
RUNNER_OS: ${{ runner.os }}
run: |
# set up things the viewer's build.sh script expects
@@ -150,7 +161,7 @@ jobs:
}
repo_branch()
{
- git -C "$1" branch | grep '^* ' | cut -c 3-
+ echo "$AUTOBUILD_VCS_BRANCH"
}
record_dependencies_graph()
{
@@ -324,7 +335,7 @@ jobs:
version: ${{ needs.build.outputs.viewer_version }}
release:
- needs: [sign-and-package-windows, sign-and-package-mac]
+ needs: [build, sign-and-package-windows, sign-and-package-mac]
runs-on: ubuntu-latest
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life_')
steps:
@@ -365,8 +376,10 @@ jobs:
body: |
${{ needs.build.outputs.viewer_channel }}
${{ needs.build.outputs.viewer_version }}
+ ${{ needs.build.outputs.viewer_branch }}
prerelease: true
generate_release_notes: true
+ append_body: true
# the only reason we generate a GH release is to post build products
fail_on_unmatched_files: true
files: |
diff --git a/build.sh b/build.sh
index 22f9e0c78a..32e6fd8ca4 100755
--- a/build.sh
+++ b/build.sh
@@ -112,7 +112,8 @@ installer_CYGWIN()
fi
}
-[[ -n "$GITHUB_OUTPUT" ]] || fatal "Need to export GITHUB_OUTPUT"
+# if someone wants to run build.sh outside the GitHub environment
+[[ -n "$GITHUB_OUTPUT" ]] || export GITHUB_OUTPUT='/dev/null'
# The following is based on the Warning for GitHub multiline output strings:
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
diff --git a/indra/llcommon/classic_callback.h b/indra/llcommon/classic_callback.h
index 1ad6dbc58f..009c25d67c 100644
--- a/indra/llcommon/classic_callback.h
+++ b/indra/llcommon/classic_callback.h
@@ -119,11 +119,11 @@ public:
* ClassicCallback must not itself be copied or moved! Once you've passed
* get_userdata() to some API, this object MUST remain at that address.
*/
- // However, we can't yet count on C++17 Class Template Argument Deduction,
- // which means makeClassicCallback() is still useful, which means we MUST
- // be able to return one to construct into caller's instance (move ctor).
- // Possible defense: bool 'referenced' data member set by get_userdata(),
- // with an llassert_always(! referenced) check in the move constructor.
+ // However, makeClassicCallback() is useful for deducing the CALLABLE
+ // type, which means we MUST be able to return one to construct into
+ // caller's instance (move ctor). Possible defense: bool 'referenced' data
+ // member set by get_userdata(), with an llassert_always(! referenced)
+ // check in the move constructor.
ClassicCallback(ClassicCallback const&) = delete;
ClassicCallback(ClassicCallback&&) = default; // delete;
ClassicCallback& operator=(ClassicCallback const&) = delete;
diff --git a/indra/llcommon/llrand.cpp b/indra/llcommon/llrand.cpp
index 33afc50cf7..e4065e23bf 100644
--- a/indra/llcommon/llrand.cpp
+++ b/indra/llcommon/llrand.cpp
@@ -58,7 +58,9 @@
* to restore uniform distribution.
*/
-static LLRandLagFib2281 gRandomGenerator(LLUUID::getRandomSeed());
+// gRandomGenerator is a stateful static object, which is therefore not
+// inherently thread-safe.
+static thread_local LLRandLagFib2281 gRandomGenerator(LLUUID::getRandomSeed());
// no default implementation, only specific F64 and F32 specializations
template <typename REAL>
@@ -71,7 +73,7 @@ inline F64 ll_internal_random<F64>()
// CPUs (or at least multi-threaded processes) seem to
// occasionally give an obviously incorrect random number -- like
// 5^15 or something. Sooooo, clamp it as described above.
- F64 rv = gRandomGenerator();
+ F64 rv{ gRandomGenerator() };
if(!((rv >= 0.0) && (rv < 1.0))) return fmod(rv, 1.0);
return rv;
}
@@ -79,7 +81,13 @@ inline F64 ll_internal_random<F64>()
template <>
inline F32 ll_internal_random<F32>()
{
- return F32(ll_internal_random<F64>());
+ // *HACK: clamp the result as described above.
+ // Per Monty, it's important to clamp using the correct fmodf() rather
+ // than expanding to F64 for fmod() and then truncating back to F32. Prior
+ // to this change, we were getting sporadic ll_frand() == 1.0 results.
+ F32 rv{ narrow(gRandomGenerator()) };
+ if(!((rv >= 0.0f) && (rv < 1.0f))) return fmodf(rv, 1.0f);
+ return rv;
}
/*------------------------------ F64 aliases -------------------------------*/
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 4eaa05c335..cd4975d9d3 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -113,15 +113,16 @@ LL_COMMON_API bool on_main_thread()
return (LLThread::currentID() == main_thread());
}
-LL_COMMON_API void assert_main_thread()
+LL_COMMON_API bool assert_main_thread()
{
auto curr = LLThread::currentID();
auto main = main_thread();
- if (curr != main)
- {
- LL_WARNS() << "Illegal execution from thread id " << curr
- << " outside main thread " << main << LL_ENDL;
- }
+ if (curr == main)
+ return true;
+
+ LL_WARNS() << "Illegal execution from thread id " << curr
+ << " outside main thread " << main << LL_ENDL;
+ return false;
}
// this function has become moot
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 50202631e7..9f1c589fcd 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -152,7 +152,7 @@ public:
//============================================================================
-extern LL_COMMON_API void assert_main_thread();
+extern LL_COMMON_API bool assert_main_thread();
extern LL_COMMON_API bool on_main_thread();
#endif // LL_LLTHREAD_H
diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h
index 0b43d7ad4b..3aba9dda00 100644
--- a/indra/llcommon/stdtypes.h
+++ b/indra/llcommon/stdtypes.h
@@ -156,18 +156,15 @@ typedef int intptr_t;
* type.
*/
// narrow_holder is a struct that accepts the passed value as its original
-// type and provides templated conversion functions to other types. Once we're
-// building with compilers that support Class Template Argument Deduction, we
-// can rename this class template 'narrow' and eliminate the narrow() factory
-// function below.
+// type and provides templated conversion functions to other types.
template <typename FROM>
-class narrow_holder
+class narrow
{
private:
FROM mValue;
public:
- narrow_holder(FROM value): mValue(value) {}
+ narrow(FROM value): mValue(value) {}
/*---------------------- Narrowing unsigned to signed ----------------------*/
template <typename TO,
@@ -207,13 +204,4 @@ public:
}
};
-/// narrow() factory function returns a narrow_holder<FROM>(), which can be
-/// implicitly converted to the target type.
-template <typename FROM>
-inline
-narrow_holder<FROM> narrow(FROM value)
-{
- return { value };
-}
-
#endif
diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp
index 93d5cfc131..212d0619d1 100644
--- a/indra/llmessage/llxfer.cpp
+++ b/indra/llmessage/llxfer.cpp
@@ -386,12 +386,3 @@ std::ostream& operator<< (std::ostream& os, LLXfer &hh)
os << hh.getFileName() ;
return os;
}
-
-
-
-
-
-
-
-
-