{"thread":{"id":"62556","subject":"Building git with /bin/sh⇔dash produces suboptimal GIT-CFLAGS file","startedAt":"2024-11-28T13:58:47Z","lastAt":"2024-11-28T18:53:04Z","messageCount":3,"participants":["Дилян Палаузов","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"508270","messageId":"b4ef94b2a0294c338d115fee68e0c31e44dad3b9.camel@aegee.org","threadId":"62556","inReplyTo":null,"subject":"Building git with /bin/sh⇔dash produces suboptimal GIT-CFLAGS file","fromName":"Дилян Палаузов","fromEmail":"dilyan.palauzov@aegee.org","sentAt":"2024-11-28T13:53:21Z","receivedAt":"2024-11-28T13:58:47Z","isPatch":false,"sender":{"key":"dilyan.palauzov@aegee.org","avatar":null},"body":"Hello,\n\nwhen /bin/sh is bash, target GIT-CFLAGS: FORCE in Makefile puts in the file GIT-CFLAGS the content\n\ngcc:  -g -O2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU=\"\\\"x86_64\\\"\" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\\\"git-compat-util.h\\\"\" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\\\"git-compat-util.h\\\"\" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_STRINGS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-\nDPROCFS_EXECUTABLE_PATH=\"/proc/self/exe\"' -DFREAD_READS_DIRECTORIES -DSHELL_PATH='\"/bin/sh\"':\n\nwhen /bin/sh is dash (b3e38ad), the same file GIT-CFLAGS contains\n\ngcc:  -g -O2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU=\"\"x86_64\"\" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\"git-compat-util.h\"\" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\"git-compat-util.h\"\" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_STRINGS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-\nDPROCFS_EXECUTABLE_PATH=\"/proc/self/exe\"' -DFREAD_READS_DIRECTORIES -DSHELL_PATH='\"/bin/sh\"':\n\nNote the differences in the -DGIT_HOST_CPU, -DSHA1DC_CUSTOM_INCLUDE_SHA1_C values.  Because of the differences, in Makefile:3150   if test x\"$$FLAGS\" != x\"`cat GIT-CFLAGS 2>/dev/null`\" ; then  always succeeds, prints “* new build flags” and every run of make starts rebuilding daemon.o.  So the empty build is not empty.\n\nGreetings\n  Дилян\n"},{"id":"508301","messageId":"Z0inflH-gQbZwNCX@tapette.crustytoothpaste.net","threadId":"62556","inReplyTo":"b4ef94b2a0294c338d115fee68e0c31e44dad3b9.camel@aegee.org","subject":"Re: Building git with /bin/sh⇔dash produces suboptimal GIT-CFLAGS file","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2024-11-28T17:25:18Z","receivedAt":"2024-11-28T17:25:28Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2024-11-28 at 13:53:21, Дилян Палаузов wrote:\n> Hello,\n> \n> when /bin/sh is bash, target GIT-CFLAGS: FORCE in Makefile puts in the file GIT-CFLAGS the content\n> \n> gcc:  -g -O2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU=\"\\\"x86_64\\\"\" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\\\"git-compat-util.h\\\"\" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\\\"git-compat-util.h\\\"\" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_STRINGS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-\n> DPROCFS_EXECUTABLE_PATH=\"/proc/self/exe\"' -DFREAD_READS_DIRECTORIES -DSHELL_PATH='\"/bin/sh\"':\n> \n> when /bin/sh is dash (b3e38ad), the same file GIT-CFLAGS contains\n> \n> gcc:  -g -O2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU=\"\"x86_64\"\" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\"git-compat-util.h\"\" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\"git-compat-util.h\"\" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_STRINGS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-\n> DPROCFS_EXECUTABLE_PATH=\"/proc/self/exe\"' -DFREAD_READS_DIRECTORIES -DSHELL_PATH='\"/bin/sh\"':\n> \n> Note the differences in the -DGIT_HOST_CPU, -DSHA1DC_CUSTOM_INCLUDE_SHA1_C values.  Because of the differences, in Makefile:3150   if test x\"$$FLAGS\" != x\"`cat GIT-CFLAGS 2>/dev/null`\" ; then  always succeeds, prints “* new build flags” and every run of make starts rebuilding daemon.o.  So the empty build is not empty.\n\nI don't see this on Debian unstable's 0.5.12-9, so I'd say that this is\nlikely a dash bug upstream, probably a regression, and I'd suggest you\nreport it to them.  I don't see any reason that the Makefile should be\ndoing anything incorrect here after some inspection.\n\nI've noted, looking at the upstream Git repository, that (unlike zsh)\nthere's no testsuite, so perhaps this is the kind of thing that could\nwell end up in a future testsuite.\n-- \nbrian m. carlson (they/them or he/him)\nToronto, Ontario, CA\n"},{"id":"508305","messageId":"580342884c7b59f74f29ce1b824ffcb096113ee7.camel@aegee.org","threadId":"62556","inReplyTo":"Z0inflH-gQbZwNCX@tapette.crustytoothpaste.net","subject":"Re: Building git with /bin/sh⇔dash produces suboptimal GIT-CFLAGS file","fromName":"Дилян Палаузов","fromEmail":"dilyan.palauzov@aegee.org","sentAt":"2024-11-28T18:52:55Z","receivedAt":"2024-11-28T18:53:04Z","isPatch":false,"sender":{"key":"dilyan.palauzov@aegee.org","avatar":null},"body":"Hello,\n\necho U\\\"\\\\\\\"U > out\n\nputs in out \n\nU\"\\\"U\n\nunder bash, and \n\nU\"\"U\n\nwith dash.  Every time I report to dash@vger.kernel.org that something is broken, e.g. because it behaves differently in dash from bash, the answer is that both behaviours are allowed by POSIX, echo is not portable and should not be used.  git’s Makefile does  echo \"$$FLAGS\" >GIT-CFLAGS so I am not going to report this to dash.\n\nGreetings\n  Дилян\n\n-----Original Message-----\nFrom: brian m. carlson <sandals@crustytoothpaste.net>\nTo: Дилян Палаузов <dilyan.palauzov@aegee.org>\nCc: git@vger.kernel.org\nSubject: Re: Building git with /bin/sh⇔dash produces suboptimal GIT-CFLAGS file\nDate: 28/11/24 18:25:18\n\nOn 2024-11-28 at 13:53:21, Дилян Палаузов wrote:\n> Hello,\n> \n> when /bin/sh is bash, target GIT-CFLAGS: FORCE in Makefile puts in the file GIT-CFLAGS the content\n> \n> gcc:  -g -O2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU=\"\\\"x86_64\\\"\" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\\\"git-compat-util.h\\\"\" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\\\"git-compat-util.h\\\"\" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_STRINGS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-\n> DPROCFS_EXECUTABLE_PATH=\"/proc/self/exe\"' -DFREAD_READS_DIRECTORIES -DSHELL_PATH='\"/bin/sh\"':\n> \n> when /bin/sh is dash (b3e38ad), the same file GIT-CFLAGS contains\n> \n> gcc:  -g -O2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU=\"\"x86_64\"\" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\"git-compat-util.h\"\" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\"git-compat-util.h\"\" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_STRINGS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-\n> DPROCFS_EXECUTABLE_PATH=\"/proc/self/exe\"' -DFREAD_READS_DIRECTORIES -DSHELL_PATH='\"/bin/sh\"':\n> \n> Note the differences in the -DGIT_HOST_CPU, -DSHA1DC_CUSTOM_INCLUDE_SHA1_C values.  Because of the differences, in Makefile:3150   if test x\"$$FLAGS\" != x\"`cat GIT-CFLAGS 2>/dev/null`\" ; then  always succeeds, prints “* new build flags” and every run of make starts rebuilding daemon.o.  So the empty build is not empty.\n\nI don't see this on Debian unstable's 0.5.12-9, so I'd say that this is\nlikely a dash bug upstream, probably a regression, and I'd suggest you\nreport it to them.  I don't see any reason that the Makefile should be\ndoing anything incorrect here after some inspection.\n\nI've noted, looking at the upstream Git repository, that (unlike zsh)\nthere's no testsuite, so perhaps this is the kind of thing that could\nwell end up in a future testsuite.\n\n"}]}