Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meson: fixes, cleanups, and modernizations #1024

Merged
merged 5 commits into from
Mar 20, 2024

Conversation

dcbaker
Copy link
Contributor

@dcbaker dcbaker commented Mar 19, 2024

This series cleans up and modernizes the Meson code a bit:

  • It adds the license SPDX name to the proper field
  • Sets a minimum version, the version is fairly old, but without setting a version then Meson will never warn about issues, including potentially important ones like "this happens to work in some cases but wasn't intended and doesn't work in all cases"
  • uses more modern Meson features to make things easier for consumers
  • Fixes the tests using the ensure_utf8 helpers by ensuring that they're actually built, and placing them in the correct path.
  • Adds the Meson test to the CI

I picked 0.60 because it's a older, but it's also the version that adds
the `meson.override_dependency()` function, which is the modern
mechanism to declare a dependency to a parent scope.

Without a minimum version set, Meson will not give warnings about
deprecations or feature misuses.
This allows consumers to replace
`subproject('CLI11').get_variable('CLI11_dep')` with the same
`dependency('CLI11')` call that they would be using to discover via
pkg-config.
There are a couple of distinct issues here:
 1. The tests don't actually depend on the helpers, so they wont be
    built automatically
 2. The paths encoding by the pre-processor is relative, but there's no
    guarantee as to where they'll run. As such, encode an absolute path.
    An alternative would be to pass them as arguments.
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e4ee3af) to head (2af1152).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #1024    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           17        17            
  Lines         4546      4557    +11     
  Branches         0       971   +971     
==========================================
+ Hits          4546      4557    +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@henryiii
Copy link
Collaborator

It would be nice to have a bit of documentation on the modern way to use it, but this seems like a nice cleanup!

@henryiii henryiii merged commit fe92f34 into CLIUtils:main Mar 20, 2024
54 checks passed
@dcbaker dcbaker deleted the submit/meson-cleanups branch March 20, 2024 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants