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

Fix 3619. Bump dependency catch2 #3635

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,12 @@ endif

catch2 = dependency(
'catch2',
version: '>=3.7.1',
default_options: [ 'tests=false' ],
fallback: ['catch2', 'catch2_dep'],
required: get_option('tests'),
)
if catch2.found()
if catch2.found() and get_option('tests').enabled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't correct, please see https://mesonbuild.com/Reference-manual_functions.html#dependency_required. -Dtests=disabled already skips the dependency lookup and sets catch2 to an empty dependency object.

Dependency catch2 skipped: feature tests disabled

Also, no reason to enforce the version requirement. Last time I checked the test code did not use anything specific to catch2 version 3.7.1 and worked with version 2.x.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @alebastr , very interesting case:

  1. Actually by default meson configuration for waybar provides two or even more features with the same name tests. One of belongs to the project itself and others one to their dependencies. In my case tests feature is provided by the gtk-layer-shell-0 and catch2 . So when catch2 dependency is not met in the system, meson trough dependency fallback provides tests=false
  2. When catch2 dependency is presented in the system then tests project feature is used. In my system by default tests=auto which leads to test subproject compilation. In this case for some reason linker failes with the undefined references

Need to digging deeper to check why linker fails

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like catch2 issue. I create pure small project with catch2 dependency only and not able to compile it. Will create issue to catch2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appropriate issue is created catchorg/Catch2#2912

subdir('test')
endif

Expand Down
12 changes: 6 additions & 6 deletions subprojects/catch2.wrap
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[wrap-file]
directory = Catch2-3.7.0
source_url = https://github.com/catchorg/Catch2/archive/v3.7.0.tar.gz
source_filename = Catch2-3.7.0.tar.gz
source_hash = 5b10cd536fa3818112a82820ce0787bd9f2a906c618429e7c4dea639983c8e88
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/catch2_3.7.0-1/Catch2-3.7.0.tar.gz
wrapdb_version = 3.7.0-1
directory = Catch2-3.7.1
source_url = https://github.com/catchorg/Catch2/archive/v3.7.1.tar.gz
source_filename = Catch2-3.7.1.tar.gz
source_hash = c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/catch2_3.7.1-1/Catch2-3.7.1.tar.gz
wrapdb_version = 3.7.1-1

[provide]
catch2 = catch2_dep
Expand Down
Loading