{"thread":{"id":"4510","subject":"[PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","startedAt":"2006-06-14T19:26:00Z","lastAt":"2006-06-18T14:44:47Z","messageCount":17,"participants":["Yakov Lerner","Junio C Hamano","Matthias Lederhofer","Santi","Alexander Litvinov","Karl Hasselström","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"21795","messageId":"0J0V00LDT7B9BU00@mxout2.netvision.net.il","threadId":"4510","inReplyTo":null,"subject":"[PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2006-06-14T19:26:00Z","receivedAt":"2006-06-14T19:26:00Z","isPatch":true,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"Many times, I mistakenly used 'make prefix=... install' where prefix value\nwas different from prefix value during build. This resulted in broken\ninstall. This patch adds auto-detection of $prefix change to the Makefile.\nThis results in correct install whenever prefix is changed.\n\nSigned-off-by: Yakov Lerner <iler.ml@gmail.com>\n---\n Makefile |   29 ++++++++++++++++++++++-------\n 1 files changed, 22 insertions(+), 7 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2a1e639..015c9b2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -464,6 +464,7 @@ DESTDIR_SQ = $(subst ','\\'',$(DESTDIR))\n bindir_SQ = $(subst ','\\'',$(bindir))\n gitexecdir_SQ = $(subst ','\\'',$(gitexecdir))\n template_dir_SQ = $(subst ','\\'',$(template_dir))\n+prefix_SQ = $(subst ','\\'',$(prefix))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n@@ -484,7 +485,7 @@ all:\n strip: $(PROGRAMS) git$X\n \t$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X\n \n-git$X: git.c common-cmds.h $(BUILTIN_OBJS) $(GITLIBS)\n+git$X: git.c common-cmds.h $(BUILTIN_OBJS) $(GITLIBS) .git.prefix\n \t$(CC) -DGIT_VERSION='\"$(GIT_VERSION)\"' \\\n \t\t$(ALL_CFLAGS) -o $@ $(filter %.c,$^) \\\n \t\t$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)\n@@ -516,7 +517,7 @@ common-cmds.h: Documentation/git-*.txt\n \tchmod +x $@+\n \tmv $@+ $@\n \n-$(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py\n+$(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py .git.prefix\n \trm -f $@ $@+\n \tsed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \\\n \t    -e 's|@@GIT_PYTHON_PATH@@|$(GIT_PYTHON_DIR_SQ)|g' \\\n@@ -540,19 +541,19 @@ git$X git.spec \\\n \t$(patsubst %.py,%,$(SCRIPT_PYTHON)) \\\n \t: GIT-VERSION-FILE\n \n-%.o: %.c\n+%.o: %.c .git.prefix\n \t$(CC) -o $*.o -c $(ALL_CFLAGS) $<\n %.o: %.S\n \t$(CC) -o $*.o -c $(ALL_CFLAGS) $<\n \n-exec_cmd.o: exec_cmd.c\n+exec_cmd.o: exec_cmd.c .git.prefix\n \t$(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH=\"$(gitexecdir_SQ)\"' $<\n \n-http.o: http.c\n+http.o: http.c .git.prefix\n \t$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='\"git/$(GIT_VERSION)\"' $<\n \n ifdef NO_EXPAT\n-http-fetch.o: http-fetch.c http.h\n+http-fetch.o: http-fetch.c http.h .git.prefix\n \t$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $<\n endif\n \n@@ -609,6 +610,14 @@ tags:\n \trm -f tags\n \tfind . -name '*.[hcS]' -print | xargs ctags -a\n \n+### Detect prefix changes\n+.git.prefix: .FORCE-git.prefix\n+\t@PREFIXES='$(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)';\\\n+\t    if test x\"$$PREFIXES\" != x\"`cat .git.prefix 2>/dev/null`\" ; then \\\n+\t\techo 1>&2 \"    * prefix changed\"; \\\n+\t\techo \"$$PREFIXES\" >.git.prefix; \\\n+            fi\n+\n ### Testing rules\n \n # GNU make supports exporting all variables by \"export\" without parameters.\n@@ -632,6 +641,12 @@ test-dump-cache-tree$X: dump-cache-tree.\n check:\n \tfor i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done\n \n+test-prefix-change:\n+\tmkdir -p \"`pwd`/tmp1\" \"`pwd`/tmp2\"\n+\t$(MAKE) clean install prefix=\"`pwd`/tmp1\"\n+\t$(MAKE) install prefix=\"`pwd`/tmp2\"\n+\t@grep -r \"`pwd`/tmp1\" \"`pwd`/tmp2\" >/dev/null; if test $$? = 0 ; then\\\n+\t    echo Error, test failed; exit 1; else echo Ok, test passed; fi\n \n \n ### Installation rules\n@@ -714,7 +729,7 @@ clean:\n \trm -f GIT-VERSION-FILE\n \n .PHONY: all install clean strip\n-.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags\n+.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-git.prefix\n \n ### Check documentation\n #\n-- \n1.4.0\n"},{"id":"21797","messageId":"7vver3cxlw.fsf@assigned-by-dhcp.cox.net","threadId":"4510","inReplyTo":"0J0V00LDT7B9BU00@mxout2.netvision.net.il","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-14T20:04:43Z","receivedAt":"2006-06-14T20:04:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yakov Lerner <iler.ml@gmail.com> writes:\n\n> Many times, I mistakenly used 'make prefix=... install' where prefix value\n> was different from prefix value during build. This resulted in broken\n> install. This patch adds auto-detection of $prefix change to the Makefile.\n> This results in correct install whenever prefix is changed.\n>\n> Signed-off-by: Yakov Lerner <iler.ml@gmail.com>\n\nI do not mind this per se, and probably even agree that this is\nan improvement compared to the current state of affairs, but a few\npoints:\n\n - please make sure you clean that state file in \"make clean\";\n\n - we may want to make the state file a bit more visible (IOW, I\n   somewhat do mind the name being dot-git-dot-prefix).\n\n - we might want to later (or at the same time as this patch)\n   do \"consistent set of compilation flags\" (e.g. run early\n   part of compilation with openssl SHA-1 implementation,\n   interrupt it and build and link the rest with mozilla SHA-1\n   implementation -- then you will get a nonsense binary without\n   linker errors).  It might make sense to prepare this\n   mechanism so we could reuse it for that purpose.\n"},{"id":"21799","messageId":"f36b08ee0606141330l28330d79hab1aec5c741188c7@mail.gmail.com","threadId":"4510","inReplyTo":"7vver3cxlw.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2006-06-14T20:30:56Z","receivedAt":"2006-06-14T20:30:56Z","isPatch":true,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"On 6/14/06, Junio C Hamano <junkio@cox.net> wrote:\n> Yakov Lerner <iler.ml@gmail.com> writes:\n>\n> > Many times, I mistakenly used 'make prefix=... install' where prefix value\n> > was different from prefix value during build. This resulted in broken\n> > install. This patch adds auto-detection of $prefix change to the Makefile.\n> > This results in correct install whenever prefix is changed.\n> >\n> > Signed-off-by: Yakov Lerner <iler.ml@gmail.com>\n>\n> I do not mind this per se, and probably even agree that this is\n> an improvement compared to the current state of affairs, but a few\n> points:\n>\n>  - please make sure you clean that state file in \"make clean\";\ndone\n\n>  - we may want to make the state file a bit more visible (IOW, I\n>    somewhat do mind the name being dot-git-dot-prefix).\nI renamed .git.prefix to GIT-PREFIX. Is this ok.\n\n>  - we might want to later (or at the same time as this patch)\n>    do \"consistent set of compilation flags\" (e.g. run early\n>    part of compilation with openssl SHA-1 implementation,\n>    interrupt it and build and link the rest with mozilla SHA-1\n>    implementation -- then you will get a nonsense binary without\n>    linker errors).  It might make sense to prepare this\n>    mechanism so we could reuse it for that purpose.\n\nDo you think two separate GIT-PREFIX and GIT-BUILD-FLAGS are needed,\nor just once GIT-BUILD-FLAGS will do, which will include\nprefixes (as passed with -D... to cc) ?\n\nI think single GIT-BUILD-FLAGS\nis enough, which will cover prefixes, too. Is this OK ?\n\nBTW, I think it's useful to add Makefile itself as prerequisite for all *.o,\nso change in Makefile will cause recompilations. Shall I include this\ninto this patch, too ?\n\nYakov\n"},{"id":"21805","messageId":"7vhd2nctjk.fsf@assigned-by-dhcp.cox.net","threadId":"4510","inReplyTo":"f36b08ee0606141330l28330d79hab1aec5c741188c7@mail.gmail.com","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-14T21:32:31Z","receivedAt":"2006-06-14T21:32:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Yakov Lerner\" <iler.ml@gmail.com> writes:\n\n> I think single GIT-BUILD-FLAGS\n> is enough, which will cover prefixes, too. Is this OK ?\n\nYes, it was what I was getting at.  I think a single\nGIT-BUILD-FLAGS (or whatever name the list can fight over while\nI am away) is preferred.\n\n> BTW, I think it's useful to add Makefile itself as prerequisite for all *.o,\n> so change in Makefile will cause recompilations. Shall I include this\n> into this patch, too ?\n\nI've thought about it but in practice this would make things\nmore inconvenient for developers without much gain, so I'd leave\nit out.\n"},{"id":"21806","messageId":"f36b08ee0606141438u7d7b59e1ra68bc23e2e926290@mail.gmail.com","threadId":"4510","inReplyTo":"7vhd2nctjk.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2006-06-14T21:38:35Z","receivedAt":"2006-06-14T21:38:35Z","isPatch":true,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"On 6/15/06, Junio C Hamano <junkio@cox.net> wrote:\n> \"Yakov Lerner\" <iler.ml@gmail.com> writes:\n>\n> > I think single GIT-BUILD-FLAGS\n> > is enough, which will cover prefixes, too. Is this OK ?\n>\n> Yes, it was what I was getting at.  I think a single\n> GIT-BUILD-FLAGS (or whatever name the list can fight over while\n> I am away) is preferred.\n\nEither GIT-CFLAGS or GIT-BUILD-FLAGS,\nwhichever is shorter :-)\n\nYakov\n"},{"id":"21826","messageId":"E1Fqo70-0003pZ-PU@moooo.ath.cx","threadId":"4510","inReplyTo":"f36b08ee0606141438u7d7b59e1ra68bc23e2e926290@mail.gmail.com","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-06-15T09:26:02Z","receivedAt":"2006-06-15T09:26:02Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"> Either GIT-CFLAGS or GIT-BUILD-FLAGS,\n> whichever is shorter :-)\n\nI would not take GIT-CFLAGS because there is an environment variable\nused by make named CFLAGS and means something else.\n\nWhat is the target test-prefix-change good for? Should it really be\nincluded?\n"},{"id":"21827","messageId":"f36b08ee0606150411q67fce728vad6dc0403160f95a@mail.gmail.com","threadId":"4510","inReplyTo":"E1Fqo70-0003pZ-PU@moooo.ath.cx","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2006-06-15T11:11:55Z","receivedAt":"2006-06-15T11:11:55Z","isPatch":true,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"On 6/15/06, Matthias Lederhofer <matled@gmx.net> wrote:\n> > Either GIT-CFLAGS or GIT-BUILD-FLAGS,\n> > whichever is shorter :-)\n>\n> I would not take GIT-CFLAGS because there is an environment variable\n> used by make named CFLAGS and means something else.\n\nWhat is your preference for this filename ? Is GIT-BUILD-FLAGS\nbetter ? GIT-FLAGS ? Other ?\n\nGIT-CFLAGS is filename here, whereas  $(CFLAGS) is variable.\nMaybe writing it the filename ./GIT-CFLAGS would\nemphasize betterthat it's not make variable, but a filename ?\n\n> What is the target test-prefix-change good for? Should it really be\n> included?\n\nThe purpose of 'test-prefix-change' is to check that there are no\nmissing GIT-FLAGS as prerequisite which would result in broken install\nif prefix changed between 'make' and 'make install'. The\n'make test-prefix-change' would catch it if GIT-FLAGS happened\nto be missing in some places that if substantially dependent of $prefix.\n\nYakov\n"},{"id":"21828","messageId":"8aa486160606150426q19b0a661s@mail.gmail.com","threadId":"4510","inReplyTo":"0J0V00LDT7B9BU00@mxout2.netvision.net.il","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Santi","fromEmail":"sbejar@gmail.com","sentAt":"2006-06-15T11:26:27Z","receivedAt":"2006-06-15T11:26:27Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"Wed, 14 Jun 2006 22:26 +0300, Yakov Lerner <iler.ml@gmail.com>:\n> Many times, I mistakenly used 'make prefix=... install' where prefix value\n> was different from prefix value during build. This resulted in broken\n> install. This patch adds auto-detection of $prefix change to the Makefile.\n> This results in correct install whenever prefix is changed.\n\nI do this each time I install packages from source. I keep them with\n\"stow\" and the usual sequence is:\n\nmake prefix=/home/santi/usr\nmake install prefix=/home/santi/usr/stow/git\ncd /home/santi/usr/stow/\nstow -v git\n\nso with this auto-detection I'll compile some programs twice.\n\nSanti\n"},{"id":"21829","messageId":"f36b08ee0606150440l544455c7r5c52609b360d0f74@mail.gmail.com","threadId":"4510","inReplyTo":"8aa486160606150426q19b0a661s@mail.gmail.com","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2006-06-15T11:40:50Z","receivedAt":"2006-06-15T11:40:50Z","isPatch":true,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"On 6/15/06, Santi <sbejar@gmail.com> wrote:\n> Wed, 14 Jun 2006 22:26 +0300, Yakov Lerner <iler.ml@gmail.com>:\n> > Many times, I mistakenly used 'make prefix=... install' where prefix value\n> > was different from prefix value during build. This resulted in broken\n> > install. This patch adds auto-detection of $prefix change to the Makefile.\n> > This results in correct install whenever prefix is changed.\n>\n> I do this each time I install packages from source. I keep them with\n> \"stow\" and the usual sequence is:\n>\n> make prefix=/home/santi/usr\n> make install prefix=/home/santi/usr/stow/git\n> cd /home/santi/usr/stow/\n> stow -v git\n>\n> so with this auto-detection I'll compile some programs twice.\n\nI'm not familiar with stow. Does stow create some kind of symlinks from\n/home/santi/usr/stow/git to home/santi/usr ? If so, why can't you\nuse prefix=/home/santi/usr/stow/git both in 'make' and in 'make install' ?\nWould this work ?\n\nBTW, is it possible to have git use argv[0] to automatically determine\nthe executable_dir without compiled-in paths ?\n\nYakov\n"},{"id":"21830","messageId":"8aa486160606150549n4b55912ap@mail.gmail.com","threadId":"4510","inReplyTo":"f36b08ee0606150440l544455c7r5c52609b360d0f74@mail.gmail.com","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Santi","fromEmail":"sbejar@gmail.com","sentAt":"2006-06-15T12:49:12Z","receivedAt":"2006-06-15T12:49:12Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"2006/6/15, Yakov Lerner <iler.ml@gmail.com>:\n> On 6/15/06, Santi <sbejar@gmail.com> wrote:\n> > Wed, 14 Jun 2006 22:26 +0300, Yakov Lerner <iler.ml@gmail.com>:\n> > > Many times, I mistakenly used 'make prefix=... install' where prefix value\n> > > was different from prefix value during build. This resulted in broken\n> > > install. This patch adds auto-detection of $prefix change to the Makefile.\n> > > This results in correct install whenever prefix is changed.\n> >\n> > I do this each time I install packages from source. I keep them with\n> > \"stow\" and the usual sequence is:\n> >\n> > make prefix=/home/santi/usr\n> > make install prefix=/home/santi/usr/stow/git\n> > cd /home/santi/usr/stow/\n> > stow -v git\n> >\n> > so with this auto-detection I'll compile some programs twice.\n>\n> I'm not familiar with stow. Does stow create some kind of symlinks from\n> /home/santi/usr/stow/git to home/santi/usr ?\nIt makes links from .../usr/ to .../usr/stow/git/, for expample:\n\n$ls -l ~/usr/bin/git\nlrwxrwxrwx 1 santi santi 19 2006-06-01 09:42 /home/santi/usr/bin/git\n-> ../stow/git/bin/git*\n\n\n> If so, why can't you\n> use prefix=/home/santi/usr/stow/git both in 'make' and in 'make install' ?\n> Would this work ?\n\nFor the few tests I've made it does works, but it is not the\nrecommended method from the stow developers, and I suppose they know\nbetter than me.\n\n>\n> BTW, is it possible to have git use argv[0] to automatically determine\n> the executable_dir without compiled-in paths ?\n>\n> Yakov\n>\n"},{"id":"21831","messageId":"200606152000.43029.lan@academsoft.ru","threadId":"4510","inReplyTo":"8aa486160606150549n4b55912ap@mail.gmail.com","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Alexander Litvinov","fromEmail":"lan@academsoft.ru","sentAt":"2006-06-15T13:00:42Z","receivedAt":"2006-06-15T13:00:42Z","isPatch":true,"sender":{"key":"lan@academsoft.ru","avatar":null},"body":"> > If so, why can't you\n> > use prefix=/home/santi/usr/stow/git both in 'make' and in 'make install'\n> > ? Would this work ?\n>\n> For the few tests I've made it does works, but it is not the\n> recommended method from the stow developers, and I suppose they know\n> better than me.\n\nI always use make prefix=/usr/local/stow/git-bla-bla and it works. The only \nthing that make break is the case when you install library into such prefix \nand it store it in the pkgconfig file. And when you will compile application \nit will be build with library paths set to /usr/local/stow/lib/libxyz and not \nto /usr/local/lib/libxyz.\n\nBut I dont make such big dependences from sources so it works.\n"},{"id":"294447","messageId":"7vk67gbbe9.fsf@assigned-by-dhcp.cox.net","threadId":"4510","inReplyTo":"8aa486160606150426q19b0a661s@mail.gmail.com","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-17T05:26:38Z","receivedAt":"2006-06-17T05:26:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Santi <sbejar@gmail.com> writes:\n\n> Wed, 14 Jun 2006 22:26 +0300, Yakov Lerner <iler.ml@gmail.com>:\n>> Many times, I mistakenly used 'make prefix=... install' where prefix value\n>> was different from prefix value during build. This resulted in broken\n>> install. This patch adds auto-detection of $prefix change to the Makefile.\n>> This results in correct install whenever prefix is changed.\n>\n> I do this each time I install packages from source. I keep them with\n> \"stow\" and the usual sequence is:\n>\n> make prefix=/home/santi/usr\n> make install prefix=/home/santi/usr/stow/git\n> cd /home/santi/usr/stow/\n> stow -v git\n>\n> so with this auto-detection I'll compile some programs twice.\n\nI do not know what \"stow\" is about, but if it is to allow you to\nrun make-install to install things in somewhere else, examine\nthe result, and then move the result to the real location\n(implying that you should be able to nuke the \"somewhere else\"\nafter you have done so), with the patch, the above sequence\nwould install the binaries pointing at a wrong directory,\nbecause the second compilation would make them point at the\ntemporary installation directory ~/usr/stow/git, not the final\nlocation ~/usr/.\n\n\n"},{"id":"21939","messageId":"7vfyi4bbbn.fsf@assigned-by-dhcp.cox.net","threadId":"4510","inReplyTo":"f36b08ee0606150440l544455c7r5c52609b360d0f74@mail.gmail.com","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-17T05:28:12Z","receivedAt":"2006-06-17T05:28:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Yakov Lerner\" <iler.ml@gmail.com> writes:\n\n> BTW, is it possible to have git use argv[0] to automatically determine\n> the executable_dir without compiled-in paths ?\n\nIt is possible and I think we did that some time ago.\n\nWe fixed it since then, so that you can migrate away from\nassuming bindir==gitexecdir.\n"},{"id":"22010","messageId":"20060618112404.GA2446@diana.vm.bytemark.co.uk","threadId":"4510","inReplyTo":"7vk67gbbe9.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-06-18T11:24:04Z","receivedAt":"2006-06-18T11:24:04Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-06-16 22:26:38 -0700, Junio C Hamano wrote:\n\n> I do not know what \"stow\" is about, but if it is to allow you to run\n> make-install to install things in somewhere else, examine the\n> result, and then move the result to the real location (implying that\n> you should be able to nuke the \"somewhere else\" after you have done\n> so), with the patch, the above sequence would install the binaries\n> pointing at a wrong directory, because the second compilation would\n> make them point at the temporary installation directory\n> ~/usr/stow/git, not the final location ~/usr/.\n\nGNU stow doesn't move installed programs, it just maintains symlinks\nto them. You install programs under /usr/local/stow/foo-4.7.11, and\nstow sets up symlinks to them under /usr/local. (So for example,\n/usr/local/bin/foo would be a symlink to\n/usr/local/stow/foo-4.7.11/bin/foo.) This gives you the ability to\nnuke an installed program cleanly. And it just works, pathwise, since\nthe program remains in its original location.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"22011","messageId":"7vzmga1y9k.fsf@assigned-by-dhcp.cox.net","threadId":"4510","inReplyTo":"20060618112404.GA2446@diana.vm.bytemark.co.uk","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-18T11:47:19Z","receivedAt":"2006-06-18T11:47:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Karl Hasselström <kha@treskal.com> writes:\n\n> GNU stow doesn't move installed programs, it just maintains symlinks\n> to them. You install programs under /usr/local/stow/foo-4.7.11, and\n> stow sets up symlinks to them under /usr/local. (So for example,\n> /usr/local/bin/foo would be a symlink to\n> /usr/local/stow/foo-4.7.11/bin/foo.) This gives you the ability to\n> nuke an installed program cleanly. And it just works, pathwise, since\n> the program remains in its original location.\n\nThanks for the explanation.\n\nIf that's the case, I think it makes the original problem Santi\nbrought up a non-issue.  In this sequence:\n\n        make prefix=/home/santi/usr\n        make install prefix=/home/santi/usr/stow/git\n        cd /home/santi/usr/stow/\n        stow -v git\n\nthe building phase could have used the same prefix as the\ninstall phase uses, and git can find its subprograms in\ngitexecdir (= ~/usr/stow/git/bin) just fine.  It probably is\neven slightly more efficient since it does not have to go\nthrough the symlink stow installs.\n"},{"id":"22018","messageId":"20060618133138.GO2609@pasky.or.cz","threadId":"4510","inReplyTo":"7vver3cxlw.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-06-18T13:31:38Z","receivedAt":"2006-06-18T13:31:38Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Wed, Jun 14, 2006 at 10:04:43PM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n>  - we may want to make the state file a bit more visible (IOW, I\n>    somewhat do mind the name being dot-git-dot-prefix).\n\nWhat is the point? It is just a bit of internal build system state made\npersistent and shouldn't be interesting for the user, so why give it\nextra publicity in the tree?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"},{"id":"22020","messageId":"20060618144447.GB2446@diana.vm.bytemark.co.uk","threadId":"4510","inReplyTo":"7vzmga1y9k.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] auto-detect changed $prefix in Makefile and properly rebuild to avoid broken install","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-06-18T14:44:47Z","receivedAt":"2006-06-18T14:44:47Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-06-18 04:47:19 -0700, Junio C Hamano wrote:\n\n> Thanks for the explanation.\n>\n> If that's the case, I think it makes the original problem Santi\n> brought up a non-issue. In this sequence:\n>\n>         make prefix=/home/santi/usr\n>         make install prefix=/home/santi/usr/stow/git\n>         cd /home/santi/usr/stow/\n>         stow -v git\n>\n> the building phase could have used the same prefix as the install\n> phase uses, and git can find its subprograms in gitexecdir (=\n> ~/usr/stow/git/bin) just fine. It probably is even slightly more\n> efficient since it does not have to go through the symlink stow\n> installs.\n\nYes, exactly. I've always built git like this:\n\n  $ make prefix=/usr/local/stow/git\n  $ sudo make prefix=/usr/local/stow/git install\n  $ cd /usr/local/stow\n  $ sudo stow git\n\nIt works for all other programs I've tried too (most of which only\nrequire me to specify the prefix once, with ./configure --prefix=...).\nThe programs never need to know about the symlinks; they're only there\nfor when other programs need to access them (via PATH, etc.).\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}