{"thread":{"id":"49771","subject":"[PATCH 0/1] Windows: force-recompile git.res for differing architectures","startedAt":"2018-11-06T14:55:53Z","lastAt":"2018-11-07T11:25:57Z","messageCount":7,"participants":["Johannes Schindelin via GitGitGadget","Johannes Sixt","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"362577","messageId":"pull.67.git.gitgitgadget@gmail.com","threadId":"49771","inReplyTo":null,"subject":"[PATCH 0/1] Windows: force-recompile git.res for differing architectures","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-11-06T14:55:49Z","receivedAt":"2018-11-06T14:55:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This is a patch designed to help maintaining Git for Windows better: when\nthe same source code is \"cross-compiled\" for i686 as well as x86_64, we want\nto rebuild the whole thing, including the resource file git.res.\n\nNote: regular C files are re-compiled appropriately, as the default prefix\nin Git for Windows is /mingw32 or /mingw64 depending on the architecture,\nand this difference is manifested in the CFLAGS (which, upon change, trigger\na complete rebuild).\n\nAs non-Windows platforms do not even compile these .res files, this patch\nshould have exactly no effect on non-Windows builds.\n\nJohannes Schindelin (1):\n  Windows: force-recompile git.res for differing architectures\n\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n\nbase-commit: cd69ec8cde54af1817630331fc441f493866f0d4\nPublished-As: https://github.com/gitgitgadget/git/releases/tags/pr-67%2Fdscho%2Fmingw-git.res-bitness-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-67/dscho/mingw-git.res-bitness-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/67\n-- \ngitgitgadget\n"},{"id":"362578","messageId":"87794514ef3a83f95d81f89287b81aeed5c92296.1541516148.git.gitgitgadget@gmail.com","threadId":"49771","inReplyTo":"pull.67.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] Windows: force-recompile git.res for differing architectures","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-11-06T14:55:50Z","receivedAt":"2018-11-06T14:55:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWhen git.rc is compiled into git.res, the result is actually dependent\non the architecture. That is, you cannot simply link a 32-bit git.res\ninto a 64-bit git.exe.\n\nTherefore, to allow 32-bit and 64-bit builds in the same directory, we\nlet git.res depend on GIT-PREFIX so that it gets recompiled when\ncompiling for a different architecture (this works because the exec path\nchanges based on the architecture: /mingw32/libexec/git-core for 32-bit\nand /mingw64/libexec/git-core for 64-bit).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex bbfbb4292d..8375736c32 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2110,7 +2110,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n \t$(QUIET_GEN)$(cmd_munge_script) && \\\n \tmv $@+ $@\n \n-git.res: git.rc GIT-VERSION-FILE\n+git.res: git.rc GIT-VERSION-FILE GIT-PREFIX\n \t$(QUIET_RC)$(RC) \\\n \t  $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \\\n \t    $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \\\n-- \ngitgitgadget\n"},{"id":"362615","messageId":"c4e3790e-4c41-0d15-38d9-79fa288fb9b3@kdbg.org","threadId":"49771","inReplyTo":"87794514ef3a83f95d81f89287b81aeed5c92296.1541516148.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] Windows: force-recompile git.res for differing architectures","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2018-11-06T21:44:07Z","receivedAt":"2018-11-06T21:44:11Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 06.11.18 um 15:55 schrieb Johannes Schindelin via GitGitGadget:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> When git.rc is compiled into git.res, the result is actually dependent\n> on the architecture. That is, you cannot simply link a 32-bit git.res\n> into a 64-bit git.exe.\n> \n> Therefore, to allow 32-bit and 64-bit builds in the same directory, we\n> let git.res depend on GIT-PREFIX so that it gets recompiled when\n> compiling for a different architecture (this works because the exec path\n> changes based on the architecture: /mingw32/libexec/git-core for 32-bit\n> and /mingw64/libexec/git-core for 64-bit).\n\nOn Linux, when I recompile for a different architecture, CFLAGS would \nchange, so I would have thought that GIT-CFLAGS were the natural choice \nfor a dependency. Don't they change in this case on Windows, too?\n\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>   Makefile | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/Makefile b/Makefile\n> index bbfbb4292d..8375736c32 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2110,7 +2110,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n>   \t$(QUIET_GEN)$(cmd_munge_script) && \\\n>   \tmv $@+ $@\n>   \n> -git.res: git.rc GIT-VERSION-FILE\n> +git.res: git.rc GIT-VERSION-FILE GIT-PREFIX\n>   \t$(QUIET_RC)$(RC) \\\n>   \t  $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \\\n>   \t    $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \\\n> \n\n"},{"id":"362627","messageId":"xmqqk1lpd65h.fsf@gitster-ct.c.googlers.com","threadId":"49771","inReplyTo":"c4e3790e-4c41-0d15-38d9-79fa288fb9b3@kdbg.org","subject":"Re: [PATCH 1/1] Windows: force-recompile git.res for differing architectures","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-11-07T01:32:10Z","receivedAt":"2018-11-07T01:32:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Am 06.11.18 um 15:55 schrieb Johannes Schindelin via GitGitGadget:\n>> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>>\n>> When git.rc is compiled into git.res, the result is actually dependent\n>> on the architecture. That is, you cannot simply link a 32-bit git.res\n>> into a 64-bit git.exe.\n>>\n>> Therefore, to allow 32-bit and 64-bit builds in the same directory, we\n>> let git.res depend on GIT-PREFIX so that it gets recompiled when\n>> compiling for a different architecture (this works because the exec path\n>> changes based on the architecture: /mingw32/libexec/git-core for 32-bit\n>> and /mingw64/libexec/git-core for 64-bit).\n>\n> On Linux, when I recompile for a different architecture, CFLAGS would\n> change, so I would have thought that GIT-CFLAGS were the natural\n> choice for a dependency. Don't they change in this case on Windows,\n> too?\n\nDepending on GIT-CFLAGS would have a better chance of being safe, I\nguess, even though it can at times be overly safe, than GIT-PREFIX,\nI suspect.  As a single user target in Makefile, which is only used\nby Dscho, who intends to stick to /mingw(32|64)/ convention til the\nend of time, I think the posted patch is OK, though.\n\n"},{"id":"362631","messageId":"ad98ab16-c6bf-7294-f498-d0e7295105fc@kdbg.org","threadId":"49771","inReplyTo":"xmqqk1lpd65h.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/1] Windows: force-recompile git.res for differing architectures","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2018-11-07T06:55:38Z","receivedAt":"2018-11-07T06:55:42Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 07.11.18 um 02:32 schrieb Junio C Hamano:\n> Johannes Sixt <j6t@kdbg.org> writes:\n>> On Linux, when I recompile for a different architecture, CFLAGS would\n>> change, so I would have thought that GIT-CFLAGS were the natural\n>> choice for a dependency. Don't they change in this case on Windows,\n>> too?\n> \n> Depending on GIT-CFLAGS would have a better chance of being safe, I\n> guess, even though it can at times be overly safe, than GIT-PREFIX,\n> I suspect.  As a single user target in Makefile, which is only used\n> by Dscho, who intends to stick to /mingw(32|64)/ convention til the\n> end of time, I think the posted patch is OK, though.\n\nI think that it's not only Dscho who uses the target (my build \nenvironment, for example, is different from Dscho's and compiles \ngit.res, too). But since the patch helps him most and doesn't hurt \nothers, it is good to go. No objection from my side.\n\n-- Hannes\n"},{"id":"362634","messageId":"xmqq36sdcl9t.fsf@gitster-ct.c.googlers.com","threadId":"49771","inReplyTo":"ad98ab16-c6bf-7294-f498-d0e7295105fc@kdbg.org","subject":"Re: [PATCH 1/1] Windows: force-recompile git.res for differing architectures","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-11-07T09:03:10Z","receivedAt":"2018-11-07T09:03:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Am 07.11.18 um 02:32 schrieb Junio C Hamano:\n>> Johannes Sixt <j6t@kdbg.org> writes:\n>>> On Linux, when I recompile for a different architecture, CFLAGS would\n>>> change, so I would have thought that GIT-CFLAGS were the natural\n>>> choice for a dependency. Don't they change in this case on Windows,\n>>> too?\n>>\n>> Depending on GIT-CFLAGS would have a better chance of being safe, I\n>> guess, even though it can at times be overly safe, than GIT-PREFIX,\n>> I suspect.  As a single user target in Makefile, which is only used\n>> by Dscho, who intends to stick to /mingw(32|64)/ convention til the\n>> end of time, I think the posted patch is OK, though.\n>\n> I think that it's not only Dscho who uses the target (my build\n> environment, for example, is different from Dscho's and compiles\n> git.res, too). But since the patch helps him most and doesn't hurt\n> others, it is good to go. No objection from my side.\n\nYeah, that was phrased poorly.  What I meant was by \"only by Dscho\"\nwas \"only by those who share the convention that GIT-PREFIX is\nchanged if and only if targetting a different arch\".\n\nAnyway, I just wanted to say that GIT-PREFIX may not be precise\nenough but would give sufficient signal; GIT-CFLAGS may be a more\ncautious choice, but it may change a bit too often ;-).\n"},{"id":"362646","messageId":"nycvar.QRO.7.76.6.1811071225230.39@tvgsbejvaqbjf.bet","threadId":"49771","inReplyTo":"xmqq36sdcl9t.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/1] Windows: force-recompile git.res for differing architectures","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-11-07T11:25:50Z","receivedAt":"2018-11-07T11:25:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 7 Nov 2018, Junio C Hamano wrote:\n\n> Johannes Sixt <j6t@kdbg.org> writes:\n> \n> > Am 07.11.18 um 02:32 schrieb Junio C Hamano:\n> >> Johannes Sixt <j6t@kdbg.org> writes:\n> >>> On Linux, when I recompile for a different architecture, CFLAGS would\n> >>> change, so I would have thought that GIT-CFLAGS were the natural\n> >>> choice for a dependency. Don't they change in this case on Windows,\n> >>> too?\n> >>\n> >> Depending on GIT-CFLAGS would have a better chance of being safe, I\n> >> guess, even though it can at times be overly safe, than GIT-PREFIX,\n> >> I suspect.  As a single user target in Makefile, which is only used\n> >> by Dscho, who intends to stick to /mingw(32|64)/ convention til the\n> >> end of time, I think the posted patch is OK, though.\n> >\n> > I think that it's not only Dscho who uses the target (my build\n> > environment, for example, is different from Dscho's and compiles\n> > git.res, too). But since the patch helps him most and doesn't hurt\n> > others, it is good to go. No objection from my side.\n> \n> Yeah, that was phrased poorly.  What I meant was by \"only by Dscho\"\n> was \"only by those who share the convention that GIT-PREFIX is\n> changed if and only if targetting a different arch\".\n> \n> Anyway, I just wanted to say that GIT-PREFIX may not be precise\n> enough but would give sufficient signal; GIT-CFLAGS may be a more\n> cautious choice, but it may change a bit too often ;-).\n\nI am fine with GIT-CFLAGS, too. Do you want me to \"rick-roll\" a v2?\n\nCiao,\nDscho\n"}]}