Skip to content

Conversation

bynect
Copy link
Contributor

@bynect bynect commented May 5, 2025

fix #1462

@codecov-commenter
Copy link

codecov-commenter commented May 5, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.83%. Comparing base (d0f8976) to head (36d2d82).
Report is 2 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1475   +/-   ##
=======================================
  Coverage   64.83%   64.83%           
=======================================
  Files          51       51           
  Lines        9010     9010           
  Branches     1055     1055           
=======================================
  Hits         5842     5842           
  Misses       3168     3168           
Flag Coverage Δ
unittests 64.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bynect bynect changed the title Fix version meson Fix meson configuration files May 5, 2025
docs/meson.build Outdated
pod2man,
'--name=dunst',
'--center=Dunst Reference',
'--center="Dunst Reference"',

Choose a reason for hiding this comment

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

Since meson uses arrays and safely quotes them, this will result in invoking pod2man with:

pod2man --name="dunst" --center="\"Dunst Reference\"" --section="1" ....

which may or may not be what you want...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops didn't know that the arguments were actually parsed. thanks for the tip

Copy link
Contributor Author

Choose a reason for hiding this comment

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

eli do you know perhaps of a way to include the cflags used by meson in the executable itself?
dunst -version did display the compilation flags when make is used but I can't find a way to replicate that

Choose a reason for hiding this comment

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

Sounds similar to https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonbuild_options

If the cflags are passed via

meson setup builddir/ -Dc_args="$CFLAGS"

Then those should be getting recorded in meson.build_options().

You could also directly use:

cflags_str = ' '.join(get_option('c_args'))

With zero guarantees about their quotedness.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds similar to https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonbuild_options

If the cflags are passed via

meson setup builddir/ -Dc_args="$CFLAGS"

Then those should be getting recorded in meson.build_options().

You could also directly use:

cflags_str = ' '.join(get_option('c_args'))

With zero guarantees about their quotedness.

it seems like this could work only for args passed directly by the user. is there no way to get all the arguments used by the compiler actually? like all defines and includes and whatnots included in the project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the makefile we do it here:

dunst/Makefile

Line 82 in 669c586

-D_CCDATE="${BUILD_DATE}" -D_CFLAGS="$(filter-out $(filter -I%,${INCS}) -fdebug-prefix-map% -fmacro-prefix-map% -ffile-prefix-map%,${CFLAGS})" -D_LDFLAGS="$(filter-out -fdebug-prefix-map% -fmacro-prefix-map% -ffile-prefix-map%,${LDFLAGS})"

Copy link

@eli-schwartz eli-schwartz May 5, 2025

Choose a reason for hiding this comment

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

-D_CFLAGS="-g -std=gnu11 -pedantic -Wall -Wno-overlength-strings -Os -pthread -MMD -MP"
-D_LDFLAGS="-lm -lrt -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgio-2.0 -lharfbuzz -lgobject-2.0 -lglib-2.0 -lwayland-cursor -lwayland-client -lXinerama -lXrandr -lXss -lXext -lX11"

Do you really care about -MMD -MP? :o

LDFLAGS of the form -l* are readable via readelf -d, I think this is the first time I've seen someone want to see them in --help.

like all defines and includes and whatnots included in the project?

You do explicitly filter out all includes, as well as any whatnots of the form -f*-prefix-map.

Anyway I'm not averse to adding a way to do this in meson but currently it doesn't exist. In particular, any flags that are details of how meson lays out the build -- such as passing -I../src -- currently cannot be determined, even though external user settings such as CFLAGS can be with some minor work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will admit that this feature was added more for the coolness factor. I wanted it to be like gcc/vim.
But if meson can't do it I'll just remove it at some point as the Makefile is phased out :(

Choose a reason for hiding this comment

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

Vim does show the individual CFLAGS / LDFLAGS, though I'm not exactly sure why I'd care. As a vim user, I've never looked at that information once.

GCC shows the configure options, so, equivalent to meson.build_options(), and that is something I've definitely looked at before and found quite helpful to see which features were enabled at configure time.

@bynect bynect merged commit 669c586 into dunst-project:master May 5, 2025
24 checks passed
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.

Meson based build creates invalid systemd unit file
3 participants