{"thread":{"id":"58448","subject":"[BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0","startedAt":"2022-09-16T23:05:02Z","lastAt":"2022-09-17T00:46:26Z","messageCount":4,"participants":["rsbecker@nexbridge.com","Victoria Dye","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"463119","messageId":"011001d8ca20$bc4d81f0$34e885d0$@nexbridge.com","threadId":"58448","inReplyTo":null,"subject":"[BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-09-16T23:04:49Z","receivedAt":"2022-09-16T23:05:02Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"The dirent d_type field is not available on every system. This was\nintroduced at 2.38.0-rc0 in diagnose.c\n\ndiagnose.c, line 79: error(1565): struct \"dirent\" has no field \"d_type\"\n\n  \t\t    e->d_type == DT_DIR && strlen(e->d_name) == 2 &&\n\n(3 more issues in diagnose exist of this form).\n\nThe code should use the  NO_D_TYPE_IN_DIRENT knob to detect whether this is\nan existing field as defined in cache.h.\n\nThis change breaks the build on NonStop systems (at least). I'm sorry I\nmissed this during review.\n\nRandall\n\n--\nBrief whoami: NonStop&UNIX developer since approximately\nUNIX(421664400)\nNonStop(211288444200000000)\n-- In real life, I talk too much.\n\n\n\n"},{"id":"463120","messageId":"5d02d3b8-dc79-a2d8-f5e1-129d2228ff23@github.com","threadId":"58448","inReplyTo":"011001d8ca20$bc4d81f0$34e885d0$@nexbridge.com","subject":"Re: [BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0","fromName":"Victoria Dye","fromEmail":"vdye@github.com","sentAt":"2022-09-16T23:11:23Z","receivedAt":"2022-09-16T23:11:30Z","isPatch":false,"sender":{"key":"vdye@github.com","avatar":"https://avatars.githubusercontent.com/u/3619353?v=4"},"body":"rsbecker@nexbridge.com wrote:\n> The dirent d_type field is not available on every system. This was\n> introduced at 2.38.0-rc0 in diagnose.c\n> \n> diagnose.c, line 79: error(1565): struct \"dirent\" has no field \"d_type\"\n> \n>   \t\t    e->d_type == DT_DIR && strlen(e->d_name) == 2 &&\n> \n> (3 more issues in diagnose exist of this form).\n> \n> The code should use the  NO_D_TYPE_IN_DIRENT knob to detect whether this is\n> an existing field as defined in cache.h.\n\nApologies for missing that, I'll try to send a patch fixing it either later\ntoday or sometime Monday.\n\nThanks,\n-Victoria\n\n> \n> This change breaks the build on NonStop systems (at least). I'm sorry I\n> missed this during review.\n> \n> Randall\n> \n> --\n> Brief whoami: NonStop&UNIX developer since approximately\n> UNIX(421664400)\n> NonStop(211288444200000000)\n> -- In real life, I talk too much.\n> \n> \n> \n\n"},{"id":"463121","messageId":"011101d8ca22$04b68940$0e239bc0$@nexbridge.com","threadId":"58448","inReplyTo":"5d02d3b8-dc79-a2d8-f5e1-129d2228ff23@github.com","subject":"RE: [BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-09-16T23:14:00Z","receivedAt":"2022-09-16T23:14:12Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On September 16, 2022 7:11 PM, Victoria Dye wrote:\n>rsbecker@nexbridge.com wrote:\n>> The dirent d_type field is not available on every system. This was\n>> introduced at 2.38.0-rc0 in diagnose.c\n>>\n>> diagnose.c, line 79: error(1565): struct \"dirent\" has no field \"d_type\"\n>>\n>>   \t\t    e->d_type == DT_DIR && strlen(e->d_name) == 2 &&\n>>\n>> (3 more issues in diagnose exist of this form).\n>>\n>> The code should use the  NO_D_TYPE_IN_DIRENT knob to detect whether\n>> this is an existing field as defined in cache.h.\n>\n>Apologies for missing that, I'll try to send a patch fixing it either later today or\n>sometime Monday.\n\nThanks. If you need it tested in advance \"in the wild\", please let me know.\n\nRegards,\nRandall\n\n"},{"id":"463122","messageId":"xmqqtu56eskk.fsf@gitster.g","threadId":"58448","inReplyTo":"5d02d3b8-dc79-a2d8-f5e1-129d2228ff23@github.com","subject":"Re: [BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-09-17T00:46:19Z","receivedAt":"2022-09-17T00:46:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Victoria Dye <vdye@github.com> writes:\n\n> rsbecker@nexbridge.com wrote:\n>> The dirent d_type field is not available on every system. This was\n>> introduced at 2.38.0-rc0 in diagnose.c\n>> \n>> diagnose.c, line 79: error(1565): struct \"dirent\" has no field \"d_type\"\n>> \n>>   \t\t    e->d_type == DT_DIR && strlen(e->d_name) == 2 &&\n>> \n>> (3 more issues in diagnose exist of this form).\n>> \n>> The code should use the  NO_D_TYPE_IN_DIRENT knob to detect whether this is\n>> an existing field as defined in cache.h.\n\nAlso, even if d_type member exists in the dirent struct, the value\ncan be DT_UNKNOWN and the code should be prepared to fall back to do\nlstat() on the path in such a case.\n\ndir.c::resolve_dtype() can be looked at for inspiration but only for\ninspiration and not for copying (because it is about tracked working\ntree paths, the function does a lot more than what diagnose.c wants\nto).\n\n> Apologies for missing that, I'll try to send a patch fixing it either later\n> today or sometime Monday.\n\nThanks, both of you.\n\n"}]}