Hi,

CC: some protagonists of the story. :-)

On Mon, 09 Mar 2026 at 16:48, Tomas Volf <[email protected]> wrote:

>>> $ guix shell -CD guix -- ./bootstrap
>>> $ guix shell -CD guix -- ./configure
>>> $ guix shell -CD guix -- make
>>> [..]
>>> make[2]: *** No rule to make target '.git/hooks/pre-push', needed by 
>>> 'all-am'.  Stop.
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> If the hooks directory is required, I think the build process should
>>> ensure it actually exists.
>>
>> This is weird, because:
>>
>> GIT_HOOKS_DIR := $(shell git rev-parse --git-path hooks 2>/dev/null)
>> $(GIT_HOOKS_DIR):
>>      if [ -n "$(GIT_HOOKS_DIR)" ]; then mkdir -p "$@"; fi
>>
>> Hum?
>
> I think it is because of the trailing / here:
>
> --8<---------------cut here---------------start------------->8---
> $(GIT_HOOKS_DIR)/%: etc/git/% | $(GIT_HOOKS_DIR)/
>       if [ -n "$(GIT_HOOKS_DIR)" ]; then cp "$<" "$@"; fi
> --8<---------------cut here---------------end--------------->8---
>
> $(GIT_HOOKS_DIR)/ and $(GIT_HOOKS_DIR) are probably not the same target?
> Removing the / from the order-only rule seems to fix the build, though I
> have no idea what else it will break, I presume the original author had
> some reason to put it there.

Indeed, because of the trailing slash, the rule about $(GIT_HOOKS_DIR)
and the pre-requisite using ’$(GIT_HOOKS_DIR)/’ might lead to a mismatch.

The trailing ’/’ is introduced by
c6b4fe16f467cca745bcbb0acd75a5eb35d22a50:

--8<---------------cut here---------------start------------->8---
+.git/hooks/:
+       $(AM_V_at)if test -d .git; then \
+       mkdir "$@"; \
+       fi
+
+.git/hooks/%: etc/git/% | .git/hooks/
--8<---------------cut here---------------end--------------->8---

Then reworked by 427b8f960ec5a3f4c9de4de6917514074bdb371f.

I think that with slash:

    $(GIT_HOOKS_DIR)/%: etc/git/% | $(GIT_HOOKS_DIR)/

seems a bug and it should be without:

    $(GIT_HOOKS_DIR)/%: etc/git/% | $(GIT_HOOKS_DIR)

CC friends, do I miss something? :-)

Cheers,
simon



Reply via email to