Skip to content

Commit

Permalink
Merge branch 'master' into stac-fix-relative
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored Oct 25, 2024
2 parents 5d8633b + 42a3bcf commit be86420
Show file tree
Hide file tree
Showing 89 changed files with 2,850 additions and 679 deletions.
49 changes: 49 additions & 0 deletions .github/actions/vcpkg_update_report/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Compare vcpkg install changes
description: Compares vcpkg install outputs between the base and head refs on pull requests and generates a report.

inputs:
vcpkg-manifest-dir:
description: 'Directory containing the vcpkg.json manifest'
required: true
default: '.'
type: string
triplet:
description: 'Triplet to use for vcpkg installation'
required: true
default: 'x64-linux'
type: string

outputs:
report:
description: 'The report of added and removed packages after vcpkg installation comparison'
value: ${{ steps.compare.outputs.report }}

runs:
using: "composite"
steps:
# Run vcpkg install --dry-run on the head ref
- name: Run vcpkg install (HEAD)
shell: bash
run: |
vcpkg install --dry-run --triplet ${{ inputs.triplet }} --x-manifest-root=${{ inputs.vcpkg-manifest-dir }} > /tmp/vcpkg-head-output.txt
# Run vcpkg install --dry-run on the base ref
- name: Run vcpkg install (BASE)
shell: bash
run: |
git worktree add .base-ref ${{ github.event.pull_request.base.sha }}
vcpkg install --dry-run --triplet ${{ inputs.triplet }} --x-manifest-root=.base-ref/${{ inputs.vcpkg-manifest-dir }} > /tmp/vcpkg-base-output.txt
# Compare the outputs and generate a report
- name: Compare vcpkg outputs
shell: bash
id: compare
run: |
python3 ${GITHUB_ACTION_PATH}/vcpkg-diff.py > /tmp/vcpkg-report.txt
cat /tmp/vcpkg-report.txt
{
echo 'report<<EOF'
cat /tmp/vcpkg-report.txt
echo EOF
} >> "$GITHUB_OUTPUT"
101 changes: 101 additions & 0 deletions .github/actions/vcpkg_update_report/vcpkg-diff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import re


def extract_packages(data):
"""
Extract package name, triplet, version, and features information from the file content.
"""
packages = {}
lines = data.strip().split("\n")
for line in lines:
# Regex to match the package format and capture features inside brackets
match = re.match(
r"\s*\*\s+([^\[\]:]+)(?:\[(.*?)\])?:([^\[\]@]+)@([^\s]+)\s+--", line
)
if match:
package_name = match.group(1)
features = match.group(2) if match.group(2) else ""
triplet = match.group(3)
version = match.group(4)
features_list = (
[feature.strip() for feature in features.split(",")] if features else []
)
packages[package_name] = (triplet, version, features_list)
return packages


def compare_features(features1, features2):
"""
Compare two feature lists and return the differences.
"""
added_features = set(features2) - set(features1)
removed_features = set(features1) - set(features2)
return added_features, removed_features


def generate_report(file1_content, file2_content):
# Extract package information from both files
file1_packages = extract_packages(file1_content)
file2_packages = extract_packages(file2_content)

added = []
removed = []
updated = []

# Identify removed and updated packages
for pkg in file1_packages:
if pkg not in file2_packages:
removed.append(pkg)
else:
# Compare version and features
triplet1, version1, features1 = file1_packages[pkg]
triplet2, version2, features2 = file2_packages[pkg]
updated_parts = []
if version1 != version2 or triplet1 != triplet2:
updated_parts.append(f"{version1} -> {version2}")
added_features, removed_features = compare_features(features1, features2)
if added_features:
updated_parts.append("+" + ", ".join(added_features))
if removed_features:
updated_parts.append("-" + ", ".join(removed_features))
if updated_parts:
updated.append(f"{pkg}: " + " ".join(updated_parts))

# Identify added packages
for pkg in file2_packages:
if pkg not in file1_packages:
added.append(pkg)

# Print the report
if added:
print("**Added packages:**")
for pkg in added:
triplet, version, features = file2_packages[pkg]
print(f" 🍓 {pkg}: {version} (Features: {', '.join(features)})")

if removed:
print("\n**Removed packages:**")
for pkg in removed:
triplet, version, features = file1_packages[pkg]
print(f" 🍄 {pkg}: {version} (Features: {', '.join(features)})")

if updated:
print("\n**Updated packages:**")
for pkg in updated:
print(f" 🍇 {pkg}")


def read_file(file_path):
"""
Read the content of a file.
"""
with open(file_path, "r") as file:
return file.read()


# Read files
file1_content = read_file("/tmp/vcpkg-base-output.txt")
file2_content = read_file("/tmp/vcpkg-head-output.txt")

# Generate the report
generate_report(file1_content, file2_content)
1 change: 1 addition & 0 deletions .github/workflows/build_artifact_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
workflows:
- 🪟 MingW64 Windows 64bit Build
- 🪟 Windows Qt6
- 🧮 Vcpkg report
types:
- completed

Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/vcpkg-update-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: 🧮 Vcpkg report
on:
pull_request:
paths:
- 'vcpkg/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
vcpkg-check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 30

- name: Generate diff report
id: vcpkg_diff
uses: ./.github/actions/vcpkg_update_report
with:
vcpkg-manifest-dir: vcpkg
triplet: x64-linux

- name: Schedule report comment
uses: ./.github/actions/post_sticky_comment
if: github.event_name == 'pull_request'
with:
marker: vcpkg-report
body: |
### 🧮 Vcpkg update report
${{ steps.vcpkg_diff.outputs.report }}
pr: ${{ github.event.number }}
2 changes: 0 additions & 2 deletions .github/workflows/windows-qt6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ jobs:
-D FLEX_EXECUTABLE="${SOURCE_DIR}/win_flex.exe" \
-D BISON_EXECUTABLE="${SOURCE_DIR}/win_bison.exe" \
-D SIP_BUILD_EXECUTABLE="${BUILD_DIR}\vcpkg_installed\x64-windows-release\tools\python3\Scripts\sip-build.exe" \
-D PYUIC_PROGRAM="${BUILD_DIR}\vcpkg_installed\x64-windows-release\tools\python3\pyuic5.bat" \
-D PYRCC_PROGRAM="${BUILD_DIR}\vcpkg_installed\x64-windows-release\tools\python3\pyrcc5.bat" \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D WITH_QTWEBKIT=OFF \
Expand Down
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ set (WITH_DESKTOP TRUE CACHE BOOL "Determines whether QGIS desktop should be bui
set (WITH_GUI TRUE CACHE BOOL "Determines whether QGIS GUI library should be built")
set(WITH_VCPKG FALSE CACHE BOOL "Use the vcpkg submodule for dependency management.")

set(WITH_VCPKG TRUE CACHE BOOL "Use the vcpkg submodule for dependency management.")
set(SDK_PATH "" CACHE STRING "Build with VCPKG SDK")

if(NOT SDK_PATH STREQUAL "")
Expand All @@ -45,6 +44,9 @@ endif()

if(WITH_VCPKG)
list(APPEND CMAKE_PROGRAM_PATH "${VCPKG_INSTALL_PREFIX}/${VCPKG_TARGET_TRIPLET}/")
set(PREFER_INTERNAL_LIBS FALSE)
else()
set(PREFER_INTERNAL_LIBS TRUE)
endif()

#############################################################
Expand Down Expand Up @@ -272,7 +274,8 @@ if(WITH_CORE)
endif()

# try to configure and build POLY2TRI support
set (WITH_INTERNAL_POLY2TRI TRUE CACHE BOOL "Determines whether POLY2TRI should be built from internal copy")
set (WITH_INTERNAL_POLY2TRI PREFER_INTERNAL_LIBS CACHE BOOL "Determines whether POLY2TRI should be built from internal copy")
set (WITH_INTERNAL_MESHOPTIMIZER PREFER_INTERNAL_LIBS CACHE BOOL "Determines whether MESHOPTIMIZER should be built from internal copy")

# try to configure and build POSTGRESQL support
set (WITH_POSTGRESQL TRUE CACHE BOOL "Determines whether POSTGRESQL support should be built")
Expand Down Expand Up @@ -385,7 +388,7 @@ if(WITH_CORE)
find_package(EXPAT REQUIRED)
find_package(Spatialindex REQUIRED)
find_package(LibZip REQUIRED)
set (WITH_INTERNAL_NLOHMANN_JSON ON CACHE BOOL "Determines whether the vendored copy of nlohmann-json should be used")
set (WITH_INTERNAL_NLOHMANN_JSON PREFER_INTERNAL_LIBS CACHE BOOL "Determines whether the vendored copy of nlohmann-json should be used")
find_package(nlohmann_json REQUIRED)

# The following bypasses the FindSQLite3 module introduced in CMake 3.14
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ Building QGIS from source - step by step
* [3.11.3. Additional tools for QGIS development](#3113-additional-tools-for-qgis-development)
* [4. Building on Windows](#4-building-on-windows)
* [4.1. Building with Microsoft Visual Studio](#41-building-with-microsoft-visual-studio)
* [4.1.1. Visual Studio 2019 Community Edition](#411-visual-studio-2019-community-edition)
* [4.1.1. Visual Studio 2022 Community Edition](#411-visual-studio-2022-community-edition)
* [4.1.2. Other tools and dependencies](#412-other-tools-and-dependencies)
* [4.1.3. Clone the QGIS Source Code](#413-clone-the-qgis-source-code)
* [4.1.4. OSGeo4W](#414-OSGeo4W)
* [4.1.4. OSGeo4W](#414-osgeo4w)
* [4.2. Building on Linux with mingw64](#42-building-on-linux-with-mingw64)
* [4.2.1. Building with Docker](#421-building-with-docker)
* [4.2.1.1. Initial setup](#4211-initial-setup)
* [4.2.1.2. Building the dependencies](#4212-building-the-dependencies)
* [4.2.1.3. Cross-Building QGIS](#4213-cross-building-qgis)
* [4.2.2. Testing QGIS](#422-testing-qgis)
* [4.3 Building for Qt 6 with VCPKG in Microsoft Visual Studio](#41-building-with-qt6)
* [4.3 Building for Qt 6 with VCPKG in Microsoft Visual Studio](43-building-on-windows-with-vcpkg)
* [5. Building on MacOS X](#5-building-on-macos-x)
* [5.1. Install Developer Tools](#51-install-developer-tools)
* [5.2. Install CMake and other build tools](#52-install-cmake-and-other-build-tools)
Expand Down
5 changes: 5 additions & 0 deletions python/PyQt6/core/auto_additions/qgsrenderchecker.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# The following has been generated automatically from src/core/qgsrenderchecker.h
# monkey patching scoped based enum
QgsRenderChecker.Flag.AvoidExportingRenderedImage.__doc__ = "Avoids exporting rendered images to reports"
QgsRenderChecker.Flag.Silent.__doc__ = "Don't output non-critical messages to console \n.. versionadded:: 3.40"
QgsRenderChecker.Flag.__doc__ = """Render checker flags.
.. versionadded:: 3.28
* ``AvoidExportingRenderedImage``: Avoids exporting rendered images to reports
* ``Silent``: Don't output non-critical messages to console
.. versionadded:: 3.40
"""
# --
Expand Down
11 changes: 11 additions & 0 deletions python/PyQt6/core/auto_generated/geometry/qgslinestring.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,17 @@ If ``useZValues`` is ``True`` then z values will also be considered when testing



QVector<QgsLineString *> splitToDisjointXYParts() const /Factory/;
%Docstring
Divides the linestring into parts that don't share any points or lines.

This method throws away Z and M coordinates.

The ownership of returned pointers is transferred to the caller.

.. versionadded:: 3.40
%End

double length3D() const /HoldGIL/;
%Docstring
Returns the length in 3D world of the line string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ Emitted when point cloud generation state is changed

protected:


};

/************************************************************************
Expand Down
1 change: 1 addition & 0 deletions python/PyQt6/core/auto_generated/qgsrenderchecker.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Sets the largest allowable difference in size between the rendered and the expec
enum class Flag /BaseType=IntFlag/
{
AvoidExportingRenderedImage,
Silent,
};

typedef QFlags<QgsRenderChecker::Flag> Flags;
Expand Down
Loading

0 comments on commit be86420

Please sign in to comment.