Simon Tournier <[email protected]> writes:

> On Sat, 07 Mar 2026 at 18:36, Tomas Volf <[email protected]> wrote:
>
>> if there is no .git/hooks directory, compilation of Guix fails:
>>
>> --8<---------------cut here---------------start------------->8---
>> $ git clone https://codeberg.org/guix/guix.git guix-proper
>> $ cd guix-proper
>> $ rm -r .git/hooks
>
> To me knowledge, the directory .git/hooks is created by ’git init’ or
> ’git clone’.

Yes, they are.  I deleted the directory as an attempt to remedy #80564.
As far as I can tell nothing in git actually requires this directory to
exist, so simply deleting it completely to fix the damage caused by the
Guix's build process seemed reasonable.

>> $ 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.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.



Reply via email to