Message ID | 87794514ef3a83f95d81f89287b81aeed5c92296.1541516148.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Windows: force-recompile git.res for differing architectures | expand |
Am 06.11.18 um 15:55 schrieb Johannes Schindelin via GitGitGadget: > From: Johannes Schindelin <johannes.schindelin@gmx.de> > > When git.rc is compiled into git.res, the result is actually dependent > on the architecture. That is, you cannot simply link a 32-bit git.res > into a 64-bit git.exe. > > Therefore, to allow 32-bit and 64-bit builds in the same directory, we > let git.res depend on GIT-PREFIX so that it gets recompiled when > compiling for a different architecture (this works because the exec path > changes based on the architecture: /mingw32/libexec/git-core for 32-bit > and /mingw64/libexec/git-core for 64-bit). On Linux, when I recompile for a different architecture, CFLAGS would change, so I would have thought that GIT-CFLAGS were the natural choice for a dependency. Don't they change in this case on Windows, too? > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > --- > Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index bbfbb4292d..8375736c32 100644 > --- a/Makefile > +++ b/Makefile > @@ -2110,7 +2110,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES > $(QUIET_GEN)$(cmd_munge_script) && \ > mv $@+ $@ > > -git.res: git.rc GIT-VERSION-FILE > +git.res: git.rc GIT-VERSION-FILE GIT-PREFIX > $(QUIET_RC)$(RC) \ > $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \ > $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \ >
Johannes Sixt <j6t@kdbg.org> writes: > Am 06.11.18 um 15:55 schrieb Johannes Schindelin via GitGitGadget: >> From: Johannes Schindelin <johannes.schindelin@gmx.de> >> >> When git.rc is compiled into git.res, the result is actually dependent >> on the architecture. That is, you cannot simply link a 32-bit git.res >> into a 64-bit git.exe. >> >> Therefore, to allow 32-bit and 64-bit builds in the same directory, we >> let git.res depend on GIT-PREFIX so that it gets recompiled when >> compiling for a different architecture (this works because the exec path >> changes based on the architecture: /mingw32/libexec/git-core for 32-bit >> and /mingw64/libexec/git-core for 64-bit). > > On Linux, when I recompile for a different architecture, CFLAGS would > change, so I would have thought that GIT-CFLAGS were the natural > choice for a dependency. Don't they change in this case on Windows, > too? Depending on GIT-CFLAGS would have a better chance of being safe, I guess, even though it can at times be overly safe, than GIT-PREFIX, I suspect. As a single user target in Makefile, which is only used by Dscho, who intends to stick to /mingw(32|64)/ convention til the end of time, I think the posted patch is OK, though.
Am 07.11.18 um 02:32 schrieb Junio C Hamano: > Johannes Sixt <j6t@kdbg.org> writes: >> On Linux, when I recompile for a different architecture, CFLAGS would >> change, so I would have thought that GIT-CFLAGS were the natural >> choice for a dependency. Don't they change in this case on Windows, >> too? > > Depending on GIT-CFLAGS would have a better chance of being safe, I > guess, even though it can at times be overly safe, than GIT-PREFIX, > I suspect. As a single user target in Makefile, which is only used > by Dscho, who intends to stick to /mingw(32|64)/ convention til the > end of time, I think the posted patch is OK, though. I think that it's not only Dscho who uses the target (my build environment, for example, is different from Dscho's and compiles git.res, too). But since the patch helps him most and doesn't hurt others, it is good to go. No objection from my side. -- Hannes
Johannes Sixt <j6t@kdbg.org> writes: > Am 07.11.18 um 02:32 schrieb Junio C Hamano: >> Johannes Sixt <j6t@kdbg.org> writes: >>> On Linux, when I recompile for a different architecture, CFLAGS would >>> change, so I would have thought that GIT-CFLAGS were the natural >>> choice for a dependency. Don't they change in this case on Windows, >>> too? >> >> Depending on GIT-CFLAGS would have a better chance of being safe, I >> guess, even though it can at times be overly safe, than GIT-PREFIX, >> I suspect. As a single user target in Makefile, which is only used >> by Dscho, who intends to stick to /mingw(32|64)/ convention til the >> end of time, I think the posted patch is OK, though. > > I think that it's not only Dscho who uses the target (my build > environment, for example, is different from Dscho's and compiles > git.res, too). But since the patch helps him most and doesn't hurt > others, it is good to go. No objection from my side. Yeah, that was phrased poorly. What I meant was by "only by Dscho" was "only by those who share the convention that GIT-PREFIX is changed if and only if targetting a different arch". Anyway, I just wanted to say that GIT-PREFIX may not be precise enough but would give sufficient signal; GIT-CFLAGS may be a more cautious choice, but it may change a bit too often ;-).
Hi, On Wed, 7 Nov 2018, Junio C Hamano wrote: > Johannes Sixt <j6t@kdbg.org> writes: > > > Am 07.11.18 um 02:32 schrieb Junio C Hamano: > >> Johannes Sixt <j6t@kdbg.org> writes: > >>> On Linux, when I recompile for a different architecture, CFLAGS would > >>> change, so I would have thought that GIT-CFLAGS were the natural > >>> choice for a dependency. Don't they change in this case on Windows, > >>> too? > >> > >> Depending on GIT-CFLAGS would have a better chance of being safe, I > >> guess, even though it can at times be overly safe, than GIT-PREFIX, > >> I suspect. As a single user target in Makefile, which is only used > >> by Dscho, who intends to stick to /mingw(32|64)/ convention til the > >> end of time, I think the posted patch is OK, though. > > > > I think that it's not only Dscho who uses the target (my build > > environment, for example, is different from Dscho's and compiles > > git.res, too). But since the patch helps him most and doesn't hurt > > others, it is good to go. No objection from my side. > > Yeah, that was phrased poorly. What I meant was by "only by Dscho" > was "only by those who share the convention that GIT-PREFIX is > changed if and only if targetting a different arch". > > Anyway, I just wanted to say that GIT-PREFIX may not be precise > enough but would give sufficient signal; GIT-CFLAGS may be a more > cautious choice, but it may change a bit too often ;-). I am fine with GIT-CFLAGS, too. Do you want me to "rick-roll" a v2? Ciao, Dscho
diff --git a/Makefile b/Makefile index bbfbb4292d..8375736c32 100644 --- a/Makefile +++ b/Makefile @@ -2110,7 +2110,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES $(QUIET_GEN)$(cmd_munge_script) && \ mv $@+ $@ -git.res: git.rc GIT-VERSION-FILE +git.res: git.rc GIT-VERSION-FILE GIT-PREFIX $(QUIET_RC)$(RC) \ $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \ $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \