Closed freddylist closed 2 years ago
but I believe this happens because after the first
make
, the source gets "unpatched" after creating thennn
binary, somake
thinks the sources have been updated and wants to redo the binary on the nextmake install
.
Indeed. A "simple fix" would be to remove all
from the prerequisite of install
- install: all
+ install:
This would always install the current binary without trying to recompile. But that'd break make install
(without running make
or make all
first).
I think the right answer here is to compile and install at the same time:
$ doas make O_GITSTATUS=1 all install
works fine on my end.
For package managers, I think they should patch out all
from install
prerequisite as I've shown above.
Closing as resolved.
Environment details
nnn
masterExact steps to reproduce the issue
cd
into itmake O_GITSTATUS=1
./nnn
nnn
build with git status 😌make install
nnn
would be rebuilding 🤔/usr/local/bin/nnn
and despair as your git status is no more 😱I'm new to makefiles and this is my first time debugging a makefile, but I believe this happens because after the first
make
, the source gets "unpatched" after creating thennn
binary, somake
thinks the sources have been updated and wants to redo the binary on the nextmake install
.https://github.com/jarun/nnn/blob/0907895865f632876dfc478fe0c50811724009a2/Makefile#L211
This is a problem because Void's
xbps-src
GNU Makefile recipe essentially first runsmake ${build_opts}
followed by amake install
. That means if a user compilesnnn
with a user patch usingxbps-src
, they will get a default build ofnnn
. I imagine this could also be a problem for other similar automated build systems that generate flavors of packages.A simple workaround is to simply
touch
the binary after building and before installing, but I imagine that could potentially lead to other subtle bugs.As I said before, I'm a complete noob (it took me several hours to debug this 😅) so I'm not confident enough to touch the makefile...
That said, if you're super busy I can definitely make an attempt if someone points me in the right direction. 😄