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

[2.4] meson: Introduce a with-lockfile-path option #1404

Merged
merged 2 commits into from
Aug 18, 2024

Conversation

rdmark
Copy link
Member

@rdmark rdmark commented Aug 14, 2024

Use with-lockfile-path to set a lockfile path that is not defined in paths.h

This leverages the special -D_PATH_LOCKDIR compiler flag that is only in 2.x (refactored away in 3.x and later)

@rdmark
Copy link
Member Author

rdmark commented Aug 14, 2024

@VorpalBlade Would you be able to test if this works to set the lockfile path in your environment?

@VorpalBlade
Copy link

I should be able to take a look on Friday evening (Europe time)

@rdmark rdmark force-pushed the 1401-24-meson-with-lockfile-path-options branch from 7a947a8 to 28cad06 Compare August 16, 2024 06:02
@VorpalBlade
Copy link

It almost works:

-Dwith-lockfile-path=/run/lock/netatalk results in files like /run/lock/netatalkatalkd rather than /run/lock/netatalk/atalkd. Given that the doc is "Set path to the Netatalk daemon lockfile directory" (emphasis mine), I didn't expect that.

@rdmark
Copy link
Member Author

rdmark commented Aug 16, 2024

@VorpalBlade You just need to append one slash and it should work, i.e. -Dwith-lockfile-path=/run/lock/netatalk/

You can observe the mechanism in:

# define _PATH_LOCKDIR "/var/run/"

@VorpalBlade
Copy link

@VorpalBlade You just need to append one slash and it should work, i.e. -Dwith-lockfile-path=/run/lock/netatalk/

You can observe the mechanism in:

# define _PATH_LOCKDIR "/var/run/"

Of course, but it is inconsistent with how other path variables (such as pkgconfdir-path and pam-config-path) are handled. Those don't seem to need a trailing slash.

I do sympathise though: doing this correctly (e.g. not just string concatenation) in C is a bit annoying.

@rdmark
Copy link
Member Author

rdmark commented Aug 16, 2024

Fair point. This is the only spot where path string concatenation is done directly in C, rather than through the build system, IINM. It's using this macro ATALKPATHCAT which concatenates exactly two strings, so in order to avoid broader refactoring, I pushed a commit now that simply moves the final slash over to the beginning of the file name string. Does this behave correctly for you now?

Copy link

sonarcloud bot commented Aug 16, 2024

@VorpalBlade
Copy link

This should work, I haven't had time to test it (and I will be out hiking today).

@rdmark rdmark merged commit a5276fd into branch-netatalk-2-4 Aug 18, 2024
15 checks passed
@rdmark rdmark deleted the 1401-24-meson-with-lockfile-path-options branch August 18, 2024 13:29
@rdmark
Copy link
Member Author

rdmark commented Aug 18, 2024

Enjoy your hike!

I'll go ahead and merge then, and we can roll another patch later if needed.

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