diff --git a/.github/workflows/build_viewer.yml b/.github/workflows/build_viewer.yml index 1aeb6d6b0c..1b65b9e791 100644 --- a/.github/workflows/build_viewer.yml +++ b/.github/workflows/build_viewer.yml @@ -29,7 +29,7 @@ env: fallback_platform: ${platform} FS_RELEASE_CHAN: ${FS_RELEASE_TYPE}x64 FS_GRID: "GRID FLAGS NOT SET" - PYTHON: + PYTHON: Unknown jobs: build_matrix: @@ -38,7 +38,11 @@ jobs: os: [macos-15,ubuntu-24.04,windows-2022] grid: [sl,os] variant: [regular, avx] + include: + - os: ubuntu-24.04 + container_image: ubuntu:22.04 # only Linux uses a container runs-on: ${{ matrix.os }} + container: ${{ matrix.container_image }} outputs: viewer_channel: ${{ steps.channel.outputs.viewer_channel }} viewer_version: ${{ steps.version.outputs.viewer_version }} @@ -58,16 +62,39 @@ jobs: echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - id: py311 + # Use apt-based Python when inside the Ubuntu 22.04 container + - name: Install Python 3.11 (container case) + if: matrix.container_image == 'ubuntu:22.04' + id: py311_apt + run: | + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + python3.11 python3.11-venv python3-pip python-is-python3 + python3.11 -m pip install --upgrade pip setuptools wheel + echo "python-path=$(command -v python3.11)" >> "$GITHUB_OUTPUT" + # Use setup-python for all other jobs + - name: Set up Python (normal case) + if: matrix.container_image != 'ubuntu:22.04' + id: py311_setup + uses: actions/setup-python@v5 with: python-version: '3.11' - + check-latest: true + - name: resolve python path + id: py311 + shell: bash + run: | + if [ -n "${{ steps.py311_apt.outputs.python-path }}" ]; then + PY="${{ steps.py311_apt.outputs.python-path }}" + else + PY="${{ steps.py311_setup.outputs.python-path }}" + fi + echo "python-path=$PY" >> "$GITHUB_OUTPUT" + echo "Resolved Python at: $PY" - name: Set PYTHON environment for CMake run: | echo "PYTHON=${{ steps.py311.outputs.python-path }}" >> $GITHUB_ENV shell: bash - - name: Install python requirements run: | python3 -m pip install -r requirements.txt @@ -101,12 +128,16 @@ jobs: with: swap-storage: false - # - name: Set gcc version on Linux - # if: runner.os == 'Linux' - # run: | - # echo "CC=gcc-10" >> $GITHUB_ENV - # echo "CXX=g++-10" >> $GITHUB_ENV - + - name: Install GCC-14 + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y software-properties-common + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update + sudo apt-get install -y gcc-14 g++-14 + echo "CC=gcc-14" >> $GITHUB_ENV + echo "CXX=g++-14" >> $GITHUB_ENV - name: Setup rclone and download the folder uses: beqjanus/setup-rclone@main diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 1e9e9f695a..c120ad545d 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -17,14 +17,7 @@ include_guard() include(Variables) # We go to some trouble to set LL_BUILD to the set of relevant compiler flags. -# Use the previous version for Windows or the compile command line will be screwed up royally -if (WINDOWS) - set(CMAKE_CXX_FLAGS_RELEASE "$ENV{LL_BUILD_RELEASE}") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "$ENV{LL_BUILD_RELWITHDEBINFO}") - set(CMAKE_CXX_FLAGS_DEBUG "$ENV{LL_BUILD_DEBUG}") -else (WINDOWS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}") -endif (WINDOWS) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}") # Given that, all the flags you see added below are flags NOT present in # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables. # Before adding new ones here, it's important to ask: can this flag really be diff --git a/indra/newview/gltf/asset.cpp b/indra/newview/gltf/asset.cpp index b9a8879fb1..c22ed4d1f5 100644 --- a/indra/newview/gltf/asset.cpp +++ b/indra/newview/gltf/asset.cpp @@ -589,7 +589,7 @@ bool Asset::prep() for (U32 variant = 0; variant < LLGLSLShader::NUM_GLTF_VARIANTS; ++variant) { -#if SHOW_ASSERT +#ifdef SHOW_ASSERT U32 attribute_mask = 0; #endif // for each mesh @@ -606,10 +606,9 @@ bool Asset::prep() vertex_count[variant] += primitive.getVertexCount(); index_count[variant] += primitive.getIndexCount(); - // all primitives of a given variant and material should all have the same attribute mask llassert(attribute_mask == 0 || primitive.mAttributeMask == attribute_mask); -#if SHOW_ASSERT +#ifdef SHOW_ASSERT attribute_mask |= primitive.mAttributeMask; #endif } diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 6a958f2653..23874b4832 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -586,8 +586,9 @@ void LLFloaterWorldMap::reshape( S32 width, S32 height, bool called_from_parent void LLFloaterWorldMap::draw() { // Performance improvement - static LLView* show_destination_btn = getChildView("Show Destination"); - static LLUICtrl* zoom_slider = getChild("zoom slider"); + static LLView* show_destination_btn = getChildView("Show Destination"); + static LLUICtrl* zoom_slider = getChild("zoom slider"); + static LLButton* track_region_btn = getChild("track_region"); // Performance improvement static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white); @@ -663,7 +664,7 @@ void LLFloaterWorldMap::draw() mGoHomeButton->setEnabled((!rlv_handler_t::isEnabled()) || !(gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) && gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC))); // Performance improvement // Alchemy region tracker - getChild("track_region")->setEnabled((bool) tracking_status || LLWorldMap::getInstance()->isTracking()); + track_region_btn->setEnabled((bool) tracking_status || LLWorldMap::getInstance()->isTracking()); setMouseOpaque(true); getDragHandle()->setMouseOpaque(true); @@ -1224,13 +1225,13 @@ void LLFloaterWorldMap::buildAvatarIDList() //} std::multimap buddymap; - for(; it != end; ++it) + for (; it != end; ++it) { - buddymap.insert(std::make_pair((*it).second, (*it).first)); + buddymap.emplace(it->second, it->first); } - for (std::multimap::iterator bit = buddymap.begin(); bit != buddymap.end(); ++bit) + for (const auto& [name, id] : buddymap) { - mFriendCombo->addSimpleElement((*bit).first, ADD_BOTTOM, (*bit).second); + mFriendCombo->addSimpleElement(name, ADD_BOTTOM, id); } // @@ -1285,11 +1286,11 @@ void LLFloaterWorldMap::buildLandmarkIDLists() // Filter duplicate landmarks on world map if (filterLandmarks) { - if (used_landmarks.find(item->getAssetUUID()) != used_landmarks.end()) + if (used_landmarks.contains(item->getAssetUUID())) { continue; } - used_landmarks.insert(item->getAssetUUID()); + used_landmarks.emplace(item->getAssetUUID()); } // @@ -1936,7 +1937,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) if (num_results > 0) { - // Ansariel: Let's sort the list to make it more user-friendly + // Let's sort the list to make it more user-friendly mSearchResults->sortByColumn("sim_name", true); // if match found, highlight it and go diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 09f7ec42a6..13370a4cca 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -318,12 +318,12 @@ void LLNetMap::draw() } // : Synchronize netmap scale throughout instances -// Aurora Sim + // Aurora Sim if (!LLWorld::getInstance()->getAllowMinimap()) { return; } -// Aurora Sim + // Aurora Sim static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white); static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white); @@ -699,7 +699,9 @@ void LLNetMap::draw() // Draw avatars for (U32 i = 0; i < avatar_ids.size(); i++) { - LLUUID uuid = avatar_ids[i]; + // Performance improvement + //LLUUID uuid = avatar_ids[i]; + const LLUUID& uuid = avatar_ids.at(i); // Skip self, we'll draw it later if (uuid == gAgent.getID()) continue; @@ -872,8 +874,8 @@ void LLNetMap::draw() F32 ctr_x = (F32)center_sw_left; F32 ctr_y = (F32)center_sw_bottom; - const F32 steps_per_circle = 40.0f; - const F32 steps_per_radian = steps_per_circle / F_TWO_PI; + constexpr F32 steps_per_circle = 40.0f; + constexpr F32 steps_per_radian = steps_per_circle / F_TWO_PI; const F32 arc_start = -(horiz_fov / 2.0f) + F_PI_BY_TWO; const F32 arc_end = (horiz_fov / 2.0f) + F_PI_BY_TWO; const S32 steps = llmax(1, (S32)((horiz_fov * steps_per_radian) + 0.5f)); @@ -1958,8 +1960,7 @@ void LLNetMap::handleClearMarks() // static bool LLNetMap::getAvatarMarkColor(const LLUUID& avatar_id, LLColor4& color) { - avatar_marks_map_t::iterator found = sAvatarMarksMap.find(avatar_id); - if (found != sAvatarMarksMap.end()) + if (auto found = sAvatarMarksMap.find(avatar_id); found != sAvatarMarksMap.end()) { color = found->second; return true; @@ -2025,8 +2026,7 @@ LLColor4 LLNetMap::getAvatarColor(const LLUUID& avatar_id) cs_instance.hasFriendColorThatShouldShow(avatar_id, ContactSetType::MINIMAP, color); // Mark Avatars with special colors - avatar_marks_map_t::iterator found = sAvatarMarksMap.find(avatar_id); - if (found != sAvatarMarksMap.end()) + if (auto found = sAvatarMarksMap.find(avatar_id); found != sAvatarMarksMap.end()) { color = found->second; }