pistache icon indicating copy to clipboard operation
pistache copied to clipboard

build should not silently override git hooks configuration

Open jacmet opened this issue 1 year ago • 1 comments

meson.build has the following logic:

if not meson.is_subproject()
	git = find_program('git', required: false)
	if git.found()
		run_command(git, 'config', '--local', 'core.hooksPath', meson.source_root()/'.hooks', check: false)
	endif
endif

Which isn't great when building pistache not from a git clone but inside another git checkout as it will silently override the git hooks configuration of the parent checkout. An example of this is source based distribution build systems like Buildroot (http://buildroot.org) which has a pistache package.

Maybe check for a .git directory or explicitly pass --git-dir=.git to ensure that only the local git checkout is modified?

jacmet avatar Mar 22 '23 23:03 jacmet

Hi @jacmet, thanks for the report. Yeah checking for a .git directory could be doable. Patches welcome!

Tachi107 avatar Mar 23 '23 07:03 Tachi107

I'm willing to make a PR for this to fix Buildroot's case, but I may want to bump the minimum meson to 0.53.2 to leverage https://mesonbuild.com/Release-notes-for-0-53-0.html#a-new-module-for-filesystem-operations

While this could maybe be done via run_command, the fs semantics are cleaner and built specifically for use cases like this.

I see https://github.com/pistacheio/pistache/pull/870 specifically requests 0.50.0 so before I start i want to check what a reasonable minimal meson version is.

vfazio avatar Jul 16 '24 17:07 vfazio

Hey @vfazio. I think bumping the minimum should be fine. Both Ubuntu and Debian have had at least 0.53.2 available since focal and bullseye respectively. Just remember to also bump the minimum in debian/control.

kiplingw avatar Jul 16 '24 18:07 kiplingw

Hey @vfazio. I think bumping the minimum should be fine. Both Ubuntu and Debian have had at least 0.53.2 available since focal and bullseye respectively. Just remember to also bump the minimum in debian/control.

@kiplingw so, it looks like a separate MR to the debian branch to bump that? per https://github.com/pistacheio/pistache/pull/974

vfazio avatar Jul 16 '24 18:07 vfazio

Correct. You'll need to submit two concurrently.

kiplingw avatar Jul 16 '24 18:07 kiplingw