netatalk icon indicating copy to clipboard operation
netatalk copied to clipboard

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

Open rdmark opened this issue 1 year ago • 7 comments

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

rdmark avatar Aug 14 '24 11:08 rdmark

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

rdmark avatar Aug 14 '24 11:08 rdmark

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

VorpalBlade avatar Aug 14 '24 17:08 VorpalBlade

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.

VorpalBlade avatar Aug 16 '24 19:08 VorpalBlade

@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: https://github.com/Netatalk/netatalk/blob/048471636f083900aea0cfffc20a22fdadbc2f14/include/atalk/paths.h#L16

rdmark avatar Aug 16 '24 19:08 rdmark

@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:

https://github.com/Netatalk/netatalk/blob/048471636f083900aea0cfffc20a22fdadbc2f14/include/atalk/paths.h#L16

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.

VorpalBlade avatar Aug 16 '24 20:08 VorpalBlade

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?

rdmark avatar Aug 16 '24 20:08 rdmark

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

VorpalBlade avatar Aug 18 '24 07:08 VorpalBlade

Enjoy your hike!

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

rdmark avatar Aug 18 '24 13:08 rdmark