Skip to content

core: Add source location fallback#4318

Merged
louwers merged 3 commits into
maplibre:mainfrom
sargunv:split/source-location
Jun 1, 2026
Merged

core: Add source location fallback#4318
louwers merged 3 commits into
maplibre:mainfrom
sargunv:split/source-location

Conversation

@sargunv

@sargunv sargunv commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

To support #4315, I added a fallback source location helper.

OpenHarmony's build environment lacks the <source_location> header. We previously had "A temporary shim for partial C++20 support" that patched the struct into the std namespace (which is undefined behavior), but even that wasn't sufficient as the header itself was included unconditionally.

Here I replace that shim with a custom mbgl::SourceLocation, which aliases to std::source_location when available and falls back to file/function/line otherwise.

Coded with Codex CLI / GPT-5.5 as part of #4315; see that PR for AI usage details.

@github-actions github-actions Bot added build Related to build, configuration or CI/CD core Changes that affect the C++ core of MapLibre Native labels Jun 1, 2026
@sargunv
sargunv marked this pull request as ready for review June 1, 2026 01:53
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.0% -2.18Ki  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4318-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +51% +59.1Mi  +467% +27.9Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4318-compared-to-legacy.txt

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results ⚡

Benchmark                                                     Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------
OVERALL_GEOMEAN                                            -0.0065         -0.0061             0             0             0             0

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-4318-compared-to-main.txt

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-4318-compared-to-main.txt

Comment thread src/mbgl/util/source_location.hpp Outdated
Comment thread src/mbgl/util/source_location.hpp Outdated
@louwers

louwers commented Jun 1, 2026

Copy link
Copy Markdown
Member

Maybe we can get rid of it completely, let me ask.

@louwers
louwers merged commit f6d70e9 into maplibre:main Jun 1, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Related to build, configuration or CI/CD core Changes that affect the C++ core of MapLibre Native

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants