{"thread":{"id":"57661","subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","startedAt":"2022-04-04T23:04:58Z","lastAt":"2022-04-06T22:33:00Z","messageCount":18,"participants":["rsbecker@nexbridge.com","Junio C Hamano","Carlo Marcelo Arenas Belón","brian m. carlson","Carlo Arenas"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"453064","messageId":"034101d84873$993f96f0$cbbec4d0$@nexbridge.com","threadId":"57661","inReplyTo":null,"subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-04-04T22:30:28Z","receivedAt":"2022-04-04T23:04:58Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On April 4, 2022 4:43 PM,  Junio C Hamano wrote:\n>To: git@vger.kernel.org\n>Cc: git-packagers@googlegroups.com\n>Subject: [ANNOUNCE] Git v2.36.0-rc0\n>\n>An early preview release Git v2.36.0-rc0 is now available for\n>testing at the usual places.  It is comprised of 661 non-merge\n>commits since v2.35.0, contributed by 80 people, 25 of which are\n>new faces [*].\n\nI rather expected this... build error hit very early on both NonStop ia64 and x86:\n\ncc -c99 -o wrapper.o -c     -WRVU=J06.21 -g -O2 -Winline -I/usr/local-ssl3.0/include -I. -DGIT_HOST_CPU=\"\\\"NSE\\\"\" -DCURL_STATICLIB -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND -DNO_D_TYPE_IN_DIRENT -DNO_ST_BLOCKS_IN_STRUCT_STAT -DNO_NSEC -DNO_GETTEXT -DNO_SYS_SELECT_H -DNO_POLL_H -DNO_SYS_POLL_H -DOLD_ICONV -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\\\"cache.h\\\"\" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\\\"git-compat-util.h\\\"\" -DSHA256_BLK -DNO_PTHREADS -DHAVE_LIBCHARSET_H -DHAVE_STRINGS_H -DHAVE_DEV_TTY -DHAVE_OPENSSL_CSPRNG  -DSA_RESTART=0 -DHAVE_STRING_H=1 -DFREAD_READS_DIRECTORIES -DNO_POLL -Icompat/poll -DNO_STRCASESTR -DNO_STRLCPY -DNO_SETENV -DNO_MKDTEMP -DNO_UNSETENV -DNO_MMAP -DNO_PREAD -DNO_INTPTR_T -DNO_HSTRERROR -DNO_MEMMEM -Icompat/regex -DSHELL_PATH='\"/usr/coreutils/bin/bash\"'  wrapper.c\n\n  \tint res = RAND_bytes(buf, len);\n  \t          ^\n\"wrapper.c\", line 817: error(114): identifier \"RAND_bytes\" is undefined\n\nI thought we did not have a direct reference to OpenSSL. What do I need here to resolve this?\n\n--Randall\n\n"},{"id":"453065","messageId":"CAPc5daWSDYSexkSeUUpfYDyT-M_F8d-rSMko5pqw140iLwBc_w@mail.gmail.com","threadId":"57661","inReplyTo":"034101d84873$993f96f0$cbbec4d0$@nexbridge.com","subject":"Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-04-04T22:32:46Z","receivedAt":"2022-04-04T23:05:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"CSPRNG_METHOD?\n"},{"id":"453067","messageId":"034701d84875$030bfb40$0923f1c0$@nexbridge.com","threadId":"57661","inReplyTo":"CAPc5daWSDYSexkSeUUpfYDyT-M_F8d-rSMko5pqw140iLwBc_w@mail.gmail.com","subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-04-04T22:40:35Z","receivedAt":"2022-04-04T23:08:26Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n>To: Randall S. Becker <rsbecker@nexbridge.com>\n>Cc: Git Mailing List <git@vger.kernel.org>; git-packagers@googlegroups.com\n>Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n>\n>CSPRNG_METHOD?\n\nWe already have\n\n        CSPRNG_METHOD = openssl\n\nIn the config for NonStop. Should that not have worked?\n\n"},{"id":"453072","messageId":"20220405002610.27sgjva5wfryrcio@carlos-mbp.lan","threadId":"57661","inReplyTo":"034701d84875$030bfb40$0923f1c0$@nexbridge.com","subject":"Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2022-04-05T00:26:10Z","receivedAt":"2022-04-05T00:41:14Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Mon, Apr 04, 2022 at 06:40:35PM -0400, rsbecker@nexbridge.com wrote:\n> On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n> >To: Randall S. Becker <rsbecker@nexbridge.com>\n> >Cc: Git Mailing List <git@vger.kernel.org>; git-packagers@googlegroups.com\n> >Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n> >\n> >CSPRNG_METHOD?\n> \n> We already have\n> \n>         CSPRNG_METHOD = openssl\n> \n> In the config for NonStop. Should that not have worked?\n\nonly if you are not telling your openssl to hide that function[1]\n\nCarlo\n\n[1] https://www.openssl.org/docs/manmaster/man3/RAND_bytes.html\n"},{"id":"453073","messageId":"20220405005418.3s2zayr3dmpxg45q@carlos-mbp.lan","threadId":"57661","inReplyTo":"20220405002610.27sgjva5wfryrcio@carlos-mbp.lan","subject":"Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2022-04-05T00:54:18Z","receivedAt":"2022-04-05T01:08:42Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Mon, Apr 04, 2022 at 05:26:10PM -0700, Carlo Marcelo Arenas Belón wrote:\n> On Mon, Apr 04, 2022 at 06:40:35PM -0400, rsbecker@nexbridge.com wrote:\n> > On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n> > >To: Randall S. Becker <rsbecker@nexbridge.com>\n> > >Cc: Git Mailing List <git@vger.kernel.org>; git-packagers@googlegroups.com\n> > >Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n> > >\n> > >CSPRNG_METHOD?\n> > \n> > We already have\n> > \n> >         CSPRNG_METHOD = openssl\n> > \n> > In the config for NonStop. Should that not have worked?\n> \n> only if you are not telling your openssl to hide that function[1]\n> \n> Carlo\n> \n> [1] https://www.openssl.org/docs/manmaster/man3/RAND_bytes.html\n\nneverming, it seems we forgot to track this header somehow, so will need\nsomething like (untested and likely to need changes to support NO_OPENSSL)\n\nCarlo\n--- >8 ---\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 4d444dca274..68a9b9cd975 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -525,6 +525,10 @@ void warning_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));\n #include <openssl/x509v3.h>\n #endif /* NO_OPENSSL */\n \n+#ifdef HAVE_OPENSSL_CSPRNG\n+#include <openssl/rand.h>\n+#endif\n+\n /*\n  * Let callers be aware of the constant return value; this can help\n  * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,\n"},{"id":"453076","messageId":"035301d84890$51449810$f3cdc830$@nexbridge.com","threadId":"57661","inReplyTo":"20220405002610.27sgjva5wfryrcio@carlos-mbp.lan","subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-04-05T01:56:02Z","receivedAt":"2022-04-05T02:47:54Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On April 4, 2022 8:26 PM, Carlo Marcelo Arenas Belón wrote:\n>On Mon, Apr 04, 2022 at 06:40:35PM -0400, rsbecker@nexbridge.com wrote:\n>> On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n>> >To: Randall S. Becker <rsbecker@nexbridge.com>\n>> >Cc: Git Mailing List <git@vger.kernel.org>;\ngit-packagers@googlegroups.com\n>> >Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n>> >\n>> >CSPRNG_METHOD?\n>>\n>> We already have\n>>\n>>         CSPRNG_METHOD = openssl\n>>\n>> In the config for NonStop. Should that not have worked?\n>\n>only if you are not telling your openssl to hide that function[1]\n\nThere is nothing in our code that causes that.\n\n"},{"id":"453079","messageId":"035b01d84899$3cdc5b20$b6951160$@nexbridge.com","threadId":"57661","inReplyTo":"20220405005418.3s2zayr3dmpxg45q@carlos-mbp.lan","subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-04-05T02:59:54Z","receivedAt":"2022-04-05T03:08:51Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On April 4, 2022 8:54 PM, Carlo Marcelo Arenas Belón wrote:\n>On Mon, Apr 04, 2022 at 05:26:10PM -0700, Carlo Marcelo Arenas Belón wrote:\n>> On Mon, Apr 04, 2022 at 06:40:35PM -0400, rsbecker@nexbridge.com wrote:\n>> > On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n>> > >To: Randall S. Becker <rsbecker@nexbridge.com>\n>> > >Cc: Git Mailing List <git@vger.kernel.org>;\n>> > >git-packagers@googlegroups.com\n>> > >Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n>> > >\n>> > >CSPRNG_METHOD?\n>> >\n>> > We already have\n>> >\n>> >         CSPRNG_METHOD = openssl\n>> >\n>> > In the config for NonStop. Should that not have worked?\n>>\n>> only if you are not telling your openssl to hide that function[1]\n>>\n>> Carlo\n>>\n>> [1] https://www.openssl.org/docs/manmaster/man3/RAND_bytes.html\n>\n>neverming, it seems we forgot to track this header somehow, so will need\n>something like (untested and likely to need changes to support NO_OPENSSL)\n>\n>Carlo\n>--- >8 ---\n>diff --git a/git-compat-util.h b/git-compat-util.h index 4d444dca274..68a9b9cd975\n>100644\n>--- a/git-compat-util.h\n>+++ b/git-compat-util.h\n>@@ -525,6 +525,10 @@ void warning_errno(const char *err, ...)\n>__attribute__((format (printf, 1, 2)));  #include <openssl/x509v3.h>  #endif /*\n>NO_OPENSSL */\n>\n>+#ifdef HAVE_OPENSSL_CSPRNG\n>+#include <openssl/rand.h>\n>+#endif\n>+\n> /*\n>  * Let callers be aware of the constant return value; this can help\n>  * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,\n\nI was able to make the build work, adding the above patch and libcrypto.so and libssl.so to our LDFLAGS. This patch is probably required. What confuses me somewhat is why RAND_bytes is required for anything in the fsync series, but it is what it is.\n\nIf there is a knob for force -lcrypto and -lssl in config.mak.uname, it would help. The CSPRNG_METHOD=openssl should be forcing these two libraries into the link, I would think. The DLLs do show up in other links, so I am suspecting there is an omission somewhere that includes the git-daemon link.\n\nThe test cycle has begun, but that will take at least 40 hours on an ia64 to get complete results.\n\n--Randall\n\n"},{"id":"453083","messageId":"20220405042826.56vyilttx3lo4scv@carlos-mbp.lan","threadId":"57661","inReplyTo":"035b01d84899$3cdc5b20$b6951160$@nexbridge.com","subject":"Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2022-04-05T04:28:26Z","receivedAt":"2022-04-05T04:28:35Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Mon, Apr 04, 2022 at 10:59:54PM -0400, rsbecker@nexbridge.com wrote:\n> On April 4, 2022 8:54 PM, Carlo Marcelo Arenas Belón wrote:\n> >On Mon, Apr 04, 2022 at 05:26:10PM -0700, Carlo Marcelo Arenas Belón wrote:\n> >> On Mon, Apr 04, 2022 at 06:40:35PM -0400, rsbecker@nexbridge.com wrote:\n> >> > On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n> >> > >To: Randall S. Becker <rsbecker@nexbridge.com>\n> >> > >Cc: Git Mailing List <git@vger.kernel.org>;\n> >> > >git-packagers@googlegroups.com\n> >> > >Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n> >> > >\n> >> > >CSPRNG_METHOD?\n> >> >\n> >> > We already have\n> >> >\n> >> >         CSPRNG_METHOD = openssl\n> >> >\n> >> > In the config for NonStop. Should that not have worked?\n> >>\n> >> only if you are not telling your openssl to hide that function[1]\n> >>\n> >> Carlo\n> >>\n> >> [1] https://www.openssl.org/docs/manmaster/man3/RAND_bytes.html\n> >\n> >nevermind, it seems we forgot to track this header somehow, so will need\n> >something like (untested and likely to need changes to support NO_OPENSSL)\n> >\n> >Carlo\n> >--- >8 ---\n> >diff --git a/git-compat-util.h b/git-compat-util.h index 4d444dca274..68a9b9cd975\n> >100644\n> >--- a/git-compat-util.h\n> >+++ b/git-compat-util.h\n> >@@ -525,6 +525,10 @@ void warning_errno(const char *err, ...)\n> >__attribute__((format (printf, 1, 2)));  #include <openssl/x509v3.h>  #endif /*\n> >NO_OPENSSL */\n> >\n> >+#ifdef HAVE_OPENSSL_CSPRNG\n> >+#include <openssl/rand.h>\n> >+#endif\n> >+\n> > /*\n> >  * Let callers be aware of the constant return value; this can help\n> >  * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,\n> \n> I was able to make the build work, adding the above patch and libcrypto.so and libssl.so to our LDFLAGS.\n\nAdding libcrypto wasn't enough?; of course it will depend on your linker\nbut when tested in Linux and macOS the only \"U\" symbol that got pulled\nwas RAND_bytes and -lcrypto was all that was needed.\n\nOfficial patch including both libraries below, but it would be ideal to\nonly pull one if possible.\n\nCarlo\n-- >8 --\nSubject: [PATCH] git-compat-util: really support openssl as a source of entropy\n\n05cd988dce5 (wrapper: add a helper to generate numbers from a CSPRNG,\n2022-01-17), configure openssl as the source for entropy in NON-STOP\nbut doesn't add the needed header or link options.\n\nSince the only system that is configured to use openssl as a source\nof entropy is NON-STOP, add the header unconditionally, and -lcrypto\nto the list of external libraries.\n\nAn additional change is required to make sure a NO_OPENSSL=1 build\nwill be able to work as well (tested on Linux with a modified value\nof CSPRNG_METHOD = openssl), and the more complex logic that allows\nfor compatibility with APPLE_COMMON_CRYPTO or allowing for simpler\nways to link (without libssl) has been punted for now.\n\nReported-by: Randall Becker <rsbecker@nexbridge.com>\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n Makefile          | 1 +\n git-compat-util.h | 4 ++++\n imap-send.c       | 2 +-\n 3 files changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 91738485626..f8bccfab5e9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1972,6 +1972,7 @@ endif\n \n ifneq ($(findstring openssl,$(CSPRNG_METHOD)),)\n \tBASIC_CFLAGS += -DHAVE_OPENSSL_CSPRNG\n+\tEXTLIBS += -lcrypto -lssl\n endif\n \n ifneq ($(PROCFS_EXECUTABLE_PATH),)\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 4d444dca274..68a9b9cd975 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -525,6 +525,10 @@ void warning_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));\n #include <openssl/x509v3.h>\n #endif /* NO_OPENSSL */\n \n+#ifdef HAVE_OPENSSL_CSPRNG\n+#include <openssl/rand.h>\n+#endif\n+\n /*\n  * Let callers be aware of the constant return value; this can help\n  * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,\ndiff --git a/imap-send.c b/imap-send.c\nindex 5ac6fa9c664..a50af56b827 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -27,7 +27,7 @@\n #include \"exec-cmd.h\"\n #include \"run-command.h\"\n #include \"parse-options.h\"\n-#ifdef NO_OPENSSL\n+#if defined(NO_OPENSSL) && !defined(HAVE_OPENSSL_CSPRNG)\n typedef void *SSL;\n #endif\n #ifdef USE_CURL_FOR_IMAP_SEND\n-- \n2.35.1.505.g27486cd1b2d\n\n"},{"id":"453102","messageId":"Ykv5dCEv/gl7aHMq@camp.crustytoothpaste.net","threadId":"57661","inReplyTo":"20220405042826.56vyilttx3lo4scv@carlos-mbp.lan","subject":"Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2022-04-05T08:10:28Z","receivedAt":"2022-04-05T08:23:11Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2022-04-05 at 04:28:26, Carlo Marcelo Arenas Belón wrote:\n> Subject: [PATCH] git-compat-util: really support openssl as a source of entropy\n> \n> 05cd988dce5 (wrapper: add a helper to generate numbers from a CSPRNG,\n> 2022-01-17), configure openssl as the source for entropy in NON-STOP\n> but doesn't add the needed header or link options.\n> \n> Since the only system that is configured to use openssl as a source\n> of entropy is NON-STOP, add the header unconditionally, and -lcrypto\n> to the list of external libraries.\n> \n> An additional change is required to make sure a NO_OPENSSL=1 build\n> will be able to work as well (tested on Linux with a modified value\n> of CSPRNG_METHOD = openssl), and the more complex logic that allows\n> for compatibility with APPLE_COMMON_CRYPTO or allowing for simpler\n> ways to link (without libssl) has been punted for now.\n\nI didn't consider the case that we had NO_OPENSSL=1 because it seems a\nbit bizarre to say, \"No, I don't want OpenSSL—oh, wait, I do want\nOpenSSL!\"\n\nThis patch also didn't seem necessary for me on Linux when I tested, but\nof course it might be necessary on some systems, so if it fixes things,\nI'm in favour.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"453124","messageId":"038001d848e9$5a9c4440$0fd4ccc0$@nexbridge.com","threadId":"57661","inReplyTo":"20220405042826.56vyilttx3lo4scv@carlos-mbp.lan","subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-04-05T12:33:23Z","receivedAt":"2022-04-05T15:00:01Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On April 5, 2022 12:28 AM, Carlo Marcelo Arenas Belón wrote:\n>On Mon, Apr 04, 2022 at 10:59:54PM -0400, rsbecker@nexbridge.com wrote:\n>> On April 4, 2022 8:54 PM, Carlo Marcelo Arenas Belón wrote:\n>> >On Mon, Apr 04, 2022 at 05:26:10PM -0700, Carlo Marcelo Arenas Belón wrote:\n>> >> On Mon, Apr 04, 2022 at 06:40:35PM -0400, rsbecker@nexbridge.com wrote:\n>> >> > On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n>> >> > >To: Randall S. Becker <rsbecker@nexbridge.com>\n>> >> > >Cc: Git Mailing List <git@vger.kernel.org>;\n>> >> > >git-packagers@googlegroups.com\n>> >> > >Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on\n>> >> > >NonStops\n>> >> > >\n>> >> > >CSPRNG_METHOD?\n>> >> >\n>> >> > We already have\n>> >> >\n>> >> >         CSPRNG_METHOD = openssl\n>> >> >\n>> >> > In the config for NonStop. Should that not have worked?\n>> >>\n>> >> only if you are not telling your openssl to hide that function[1]\n>> >>\n>> >> Carlo\n>> >>\n>> >> [1] https://www.openssl.org/docs/manmaster/man3/RAND_bytes.html\n>> >\n>> >nevermind, it seems we forgot to track this header somehow, so will\n>> >need something like (untested and likely to need changes to support\n>> >NO_OPENSSL)\n>> >\n>> >Carlo\n>> >--- >8 ---\n>> >diff --git a/git-compat-util.h b/git-compat-util.h index\n>> >4d444dca274..68a9b9cd975\n>> >100644\n>> >--- a/git-compat-util.h\n>> >+++ b/git-compat-util.h\n>> >@@ -525,6 +525,10 @@ void warning_errno(const char *err, ...)\n>> >__attribute__((format (printf, 1, 2)));  #include <openssl/x509v3.h>\n>> >#endif /* NO_OPENSSL */\n>> >\n>> >+#ifdef HAVE_OPENSSL_CSPRNG\n>> >+#include <openssl/rand.h>\n>> >+#endif\n>> >+\n>> > /*\n>> >  * Let callers be aware of the constant return value; this can help\n>> >  * gcc with -Wuninitialized analysis. We restrict this trick to gcc,\n>> > though,\n>>\n>> I was able to make the build work, adding the above patch and libcrypto.so and\n>libssl.so to our LDFLAGS.\n>\n>Adding libcrypto wasn't enough?; of course it will depend on your linker but when\n>tested in Linux and macOS the only \"U\" symbol that got pulled was RAND_bytes\n>and -lcrypto was all that was needed.\n>\n>Official patch including both libraries below, but it would be ideal to only pull one if\n>possible.\n>\n>Carlo\n>-- >8 --\n>Subject: [PATCH] git-compat-util: really support openssl as a source of entropy\n>\n>05cd988dce5 (wrapper: add a helper to generate numbers from a CSPRNG, 2022-\n>01-17), configure openssl as the source for entropy in NON-STOP but doesn't add\n>the needed header or link options.\n>\n>Since the only system that is configured to use openssl as a source of entropy is\n>NON-STOP, add the header unconditionally, and -lcrypto to the list of external\n>libraries.\n>\n>An additional change is required to make sure a NO_OPENSSL=1 build will be able\n>to work as well (tested on Linux with a modified value of CSPRNG_METHOD =\n>openssl), and the more complex logic that allows for compatibility with\n>APPLE_COMMON_CRYPTO or allowing for simpler ways to link (without libssl) has\n>been punted for now.\n>\n>Reported-by: Randall Becker <rsbecker@nexbridge.com>\n>Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n>---\n> Makefile          | 1 +\n> git-compat-util.h | 4 ++++\n> imap-send.c       | 2 +-\n> 3 files changed, 6 insertions(+), 1 deletion(-)\n>\n>diff --git a/Makefile b/Makefile\n>index 91738485626..f8bccfab5e9 100644\n>--- a/Makefile\n>+++ b/Makefile\n>@@ -1972,6 +1972,7 @@ endif\n>\n> ifneq ($(findstring openssl,$(CSPRNG_METHOD)),)\n> \tBASIC_CFLAGS += -DHAVE_OPENSSL_CSPRNG\n>+\tEXTLIBS += -lcrypto -lssl\n> endif\n>\n> ifneq ($(PROCFS_EXECUTABLE_PATH),)\n>diff --git a/git-compat-util.h b/git-compat-util.h index 4d444dca274..68a9b9cd975\n>100644\n>--- a/git-compat-util.h\n>+++ b/git-compat-util.h\n>@@ -525,6 +525,10 @@ void warning_errno(const char *err, ...)\n>__attribute__((format (printf, 1, 2)));  #include <openssl/x509v3.h>  #endif /*\n>NO_OPENSSL */\n>\n>+#ifdef HAVE_OPENSSL_CSPRNG\n>+#include <openssl/rand.h>\n>+#endif\n>+\n> /*\n>  * Let callers be aware of the constant return value; this can help\n>  * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though, diff --git\n>a/imap-send.c b/imap-send.c index 5ac6fa9c664..a50af56b827 100644\n>--- a/imap-send.c\n>+++ b/imap-send.c\n>@@ -27,7 +27,7 @@\n> #include \"exec-cmd.h\"\n> #include \"run-command.h\"\n> #include \"parse-options.h\"\n>-#ifdef NO_OPENSSL\n>+#if defined(NO_OPENSSL) && !defined(HAVE_OPENSSL_CSPRNG)\n> typedef void *SSL;\n> #endif\n> #ifdef USE_CURL_FOR_IMAP_SEND\n>--\n>2.35.1.505.g27486cd1b2d\n\nWill retest when this has been rolled into rc1. Thanks\nRandall\n\n"},{"id":"453146","messageId":"CAPUEspjAiXKz00VgP16RRA+ZKYpG0QjpU4XxwJXYnZm+MQwwqg@mail.gmail.com","threadId":"57661","inReplyTo":"Ykv5dCEv/gl7aHMq@camp.crustytoothpaste.net","subject":"Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"Carlo Arenas","fromEmail":"carenas@gmail.com","sentAt":"2022-04-05T22:47:37Z","receivedAt":"2022-04-06T05:07:46Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Tue, Apr 5, 2022 at 1:10 AM brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> I didn't consider the case that we had NO_OPENSSL=1 because it seems a\n> bit bizarre to say, \"No, I don't want OpenSSL—oh, wait, I do want\n> OpenSSL!\"\n\nNO_OPENSSL is definitely strange, for example in macOS it means: do\nnot link with openssl if it comes from homebrew or macports, but maybe\nuse the one that comes with the system, which happens to be based on\nopenssl anyway (based on libressl, boringssl, or even a really old\nversion of openssl, depending on which version of the OS you got).\n\nEither way, the choice of using the openssl function this requires\ncould work with any of those if provided with the right linker\nsettings, but it doesn't seem worth the trouble to do, especially not\nfor rc0.\n\n> This patch also didn't seem necessary for me on Linux when I tested, but\n> of course it might be necessary on some systems, so if it fixes things,\n> I'm in favour.\n\nNot sure if the required changes got somehow dropped in one of the\nrebases after your tests, but it definitely didn't work for me when\ntested on Linux (using debian stable or sid) and I can't see how it\nwould work unless the crypto library is pulled in some other way, and\neven in that case the lack of the header should break, at least with\nDEVELOPER=1.\n\nCarlo\n"},{"id":"453152","messageId":"03f101d84942$36be25d0$a43a7170$@nexbridge.com","threadId":"57661","inReplyTo":"CAPUEspjAiXKz00VgP16RRA+ZKYpG0QjpU4XxwJXYnZm+MQwwqg@mail.gmail.com","subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-04-05T23:09:28Z","receivedAt":"2022-04-06T05:07:47Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On April 5, 2022 6:48 PM, Carlo Arenas wrote:\n>To: brian m. carlson <sandals@crustytoothpaste.net>; Carlo Marcelo Arenas Belón\n><carenas@gmail.com>; rsbecker@nexbridge.com; Junio C Hamano\n><gitster@pobox.com>; Git Mailing List <git@vger.kernel.org>; git-\n>packagers@googlegroups.com\n>Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n>\n>On Tue, Apr 5, 2022 at 1:10 AM brian m. carlson <sandals@crustytoothpaste.net>\n>wrote:\n>> I didn't consider the case that we had NO_OPENSSL=1 because it seems a\n>> bit bizarre to say, \"No, I don't want OpenSSL—oh, wait, I do want\n>> OpenSSL!\"\n>\n>NO_OPENSSL is definitely strange, for example in macOS it means: do not link with\n>openssl if it comes from homebrew or macports, but maybe use the one that\n>comes with the system, which happens to be based on openssl anyway (based on\n>libressl, boringssl, or even a really old version of openssl, depending on which\n>version of the OS you got).\n>\n>Either way, the choice of using the openssl function this requires could work with\n>any of those if provided with the right linker settings, but it doesn't seem worth\n>the trouble to do, especially not for rc0.\n>\n>> This patch also didn't seem necessary for me on Linux when I tested,\n>> but of course it might be necessary on some systems, so if it fixes\n>> things, I'm in favour.\n>\n>Not sure if the required changes got somehow dropped in one of the rebases\n>after your tests, but it definitely didn't work for me when tested on Linux (using\n>debian stable or sid) and I can't see how it would work unless the crypto library is\n>pulled in some other way, and even in that case the lack of the header should\n>break, at least with DEVELOPER=1.\n\nI had to be explicit and override the LDFLAGS to include -lcrypto and -lssl at least for git-daemon with the wrapper.c patch. Testing is still going - currently at t5531 on the ia64 NonStop variant without problems. I deliberately picked the more finicky of the two systems since x86 uses a slightly simpler OpenSSL with the x86 hardware randomizer.\n\n"},{"id":"453197","messageId":"046001d849d2$9daf2290$d90d67b0$@nexbridge.com","threadId":"57661","inReplyTo":"xmqqv8vmyysp.fsf@gitster.g","subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-04-06T16:23:09Z","receivedAt":"2022-04-06T17:49:50Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On April 6, 2022 12:14 PM, Junio C Hamano wrote:\n><rsbecker@nexbridge.com> writes:\n>\n>> On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n>>>To: Randall S. Becker <rsbecker@nexbridge.com>\n>>>Cc: Git Mailing List <git@vger.kernel.org>;\n>>>git-packagers@googlegroups.com\n>>>Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n>>>\n>>>CSPRNG_METHOD?\n>>\n>> We already have\n>>\n>>         CSPRNG_METHOD = openssl\n>>\n>> In the config for NonStop. Should that not have worked?\n>\n>In your original report, you said\n>\n>>> I thought we did not have a direct reference to OpenSSL. What do I\n>>> need here to resolve this?\n>\n>I misread it as \"I did not directly ask to use OpenSSL---why am I seeing\nbreakage\n>from RAND_bytes() that is an OpenSSL thing?\", and where my suggestion to\nlook\n>for CSPRNG_METHOD came from.\n>\n>Downthread, folks seem to have figured out that OpenSSL support failed to\n>include a necessary header and link with libraries, while I was offline\nyesterday, so\n>hopefully all is well?\n>\n>Since d073bdc6 (Merge branch 'bc/csprng-mktemps', 2022-02-11) the CSPRNG\n>code has been in 'master/main' and the topic was merged to 'next' much\nearlier,\n>at 2e32375c (Merge branch 'bc/csprng-mktemps'\n>into next, 2022-02-04).  I was puzzled why it took this long for your\nreport to come,\n>as I somehow thought you've been quite good at reporting portability issues\nto\n>your platform quickly, and was wondering if we broke something between the\n>time we merged it to 'next' and -rc0, but it seems that it was not working\nfrom the\n>beginning X-<.\n\nI have no explanation on why this and the PATH issue showed up at 2.36.0-rc0\nand not at 2.35.1. 2.35.0. Our build/test cycles are thorough but only on\nthe releases and rc* notices because it takes 50+ hours to run the whole\ntest cycle. The CSPRNG_METHOD was already set in the platform config, so we\ndid not have to change that. wrapper.c had an issue that was missing the\nrequired includes on more than just our platform - adding that in did help.\nt6200 did not previously fail but we are looking into whether an OpenSSH\ninstall caused that. I think we will have to selectively modify the path in\nconfig.mak.uname for each build going forward for tests to pass.\n\nI am sorry that I do not have better or more clear info.\n--Randall\n\n"},{"id":"453198","messageId":"xmqqzgkyyz97.fsf@gitster.g","threadId":"57661","inReplyTo":"Ykv5dCEv/gl7aHMq@camp.crustytoothpaste.net","subject":"Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-04-06T16:04:20Z","receivedAt":"2022-04-06T17:53:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> I didn't consider the case that we had NO_OPENSSL=1 because it seems a\n> bit bizarre to say, \"No, I don't want OpenSSL—oh, wait, I do want\n> OpenSSL!\"\n\nIndeed ;-).\n\n> This patch also didn't seem necessary for me on Linux when I tested, but\n> of course it might be necessary on some systems, so if it fixes things,\n> I'm in favour.\n\nI think I've seen the breakage myself when I tried to force\nCSPRNG_METHOD = openssl in my build.  Let's take the patch as-is for\nnow.\n\n\n"},{"id":"453200","messageId":"xmqqv8vmyysp.fsf@gitster.g","threadId":"57661","inReplyTo":"034701d84875$030bfb40$0923f1c0$@nexbridge.com","subject":"Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-04-06T16:14:14Z","receivedAt":"2022-04-06T18:00:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<rsbecker@nexbridge.com> writes:\n\n> On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n>>To: Randall S. Becker <rsbecker@nexbridge.com>\n>>Cc: Git Mailing List <git@vger.kernel.org>; git-packagers@googlegroups.com\n>>Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n>>\n>>CSPRNG_METHOD?\n>\n> We already have\n>\n>         CSPRNG_METHOD = openssl\n>\n> In the config for NonStop. Should that not have worked?\n\nIn your original report, you said\n\n>> I thought we did not have a direct reference to OpenSSL. What do\n>> I need here to resolve this?\n\nI misread it as \"I did not directly ask to use OpenSSL---why am I\nseeing breakage from RAND_bytes() that is an OpenSSL thing?\", and\nwhere my suggestion to look for CSPRNG_METHOD came from.\n\nDownthread, folks seem to have figured out that OpenSSL support\nfailed to include a necessary header and link with libraries, while\nI was offline yesterday, so hopefully all is well?\n\nSince d073bdc6 (Merge branch 'bc/csprng-mktemps', 2022-02-11) the\nCSPRNG code has been in 'master/main' and the topic was merged to\n'next' much earlier, at 2e32375c (Merge branch 'bc/csprng-mktemps'\ninto next, 2022-02-04).  I was puzzled why it took this long for\nyour report to come, as I somehow thought you've been quite good at\nreporting portability issues to your platform quickly, and was\nwondering if we broke something between the time we merged it to\n'next' and -rc0, but it seems that it was not working from the\nbeginning X-<.\n\nThanks.\n"},{"id":"453218","messageId":"xmqqsfqqxat4.fsf@gitster.g","threadId":"57661","inReplyTo":"046001d849d2$9daf2290$d90d67b0$@nexbridge.com","subject":"Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-04-06T19:37:43Z","receivedAt":"2022-04-06T21:02:49Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<rsbecker@nexbridge.com> writes:\n\n> I have no explanation on why this and the PATH issue showed up at 2.36.0-rc0\n> and not at 2.35.1. 2.35.0. Our build/test cycles are thorough but only on\n> the releases and rc* ...\n\nAh, OK, so I had a wrong impression, which explains my puzzlement.\n\nI somehow thought that you caught us soon after stuff got merged to\n'master', and sometimes even to 'next', for a few times before.\n\nThanks.\n"},{"id":"453221","messageId":"047c01d849f1$1192a9c0$34b7fd40$@nexbridge.com","threadId":"57661","inReplyTo":"xmqqv8vmyysp.fsf@gitster.g","subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-04-06T20:01:08Z","receivedAt":"2022-04-06T21:14:48Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On April 6, 2022 12:14 PM, Junio C Hamano wrote:\n><rsbecker@nexbridge.com> writes:\n>\n>> On April 4, 2022 6:33 PM, Junio C Hamano wrote:\n>>>To: Randall S. Becker <rsbecker@nexbridge.com>\n>>>Cc: Git Mailing List <git@vger.kernel.org>;\n>>>git-packagers@googlegroups.com\n>>>Subject: Re: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops\n>>>\n>>>CSPRNG_METHOD?\n>>\n>> We already have\n>>\n>>         CSPRNG_METHOD = openssl\n>>\n>> In the config for NonStop. Should that not have worked?\n>\n>In your original report, you said\n>\n>>> I thought we did not have a direct reference to OpenSSL. What do I\n>>> need here to resolve this?\n>\n>I misread it as \"I did not directly ask to use OpenSSL---why am I seeing\nbreakage\n>from RAND_bytes() that is an OpenSSL thing?\", and where my suggestion to\nlook\n>for CSPRNG_METHOD came from.\n>\n>Downthread, folks seem to have figured out that OpenSSL support failed to\n>include a necessary header and link with libraries, while I was offline\nyesterday, so\n>hopefully all is well?\n>\n>Since d073bdc6 (Merge branch 'bc/csprng-mktemps', 2022-02-11) the CSPRNG\n>code has been in 'master/main' and the topic was merged to 'next' much\nearlier,\n>at 2e32375c (Merge branch 'bc/csprng-mktemps'\n>into next, 2022-02-04).  I was puzzled why it took this long for your\nreport to come,\n>as I somehow thought you've been quite good at reporting portability issues\nto\n>your platform quickly, and was wondering if we broke something between the\n>time we merged it to 'next' and -rc0, but it seems that it was not working\nfrom the\n>beginning X-<.\n\nThe 2.35.1 build happened on 29 Jan 2022, which appears to be before the\nchange. That's why I didn't report it. This was the first build/test since\nthen. So, no surprise actually. The build was done on commit\n4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a. At least we know why the problem\nonly showed up now. As I said, it's 50 hours to run the test cycle on ia64,\nso I only run this when an announcement happens.\n\nRegards,\nRandall\n\n"},{"id":"453234","messageId":"048601d84a06$416fe120$c44fa360$@nexbridge.com","threadId":"57661","inReplyTo":"xmqqsfqqxat4.fsf@gitster.g","subject":"RE: [ANNOUNCE] Git v2.36.0-rc0 - Build failure on NonStops","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-04-06T22:32:48Z","receivedAt":"2022-04-06T22:33:00Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"\n\n>-----Original Message-----\nOn April 6, 2022 3:38 PM, Junio C Hamano wrote\n><rsbecker@nexbridge.com> writes:\n>\n>> I have no explanation on why this and the PATH issue showed up at\n>> 2.36.0-rc0 and not at 2.35.1. 2.35.0. Our build/test cycles are\n>> thorough but only on the releases and rc* ...\n>\n>Ah, OK, so I had a wrong impression, which explains my puzzlement.\n>\n>I somehow thought that you caught us soon after stuff got merged to\n'master',\n>and sometimes even to 'next', for a few times before.\n\nI am working on getting a much faster system. Once that happens, I hope we\ncan increase the cadence of my test cycle.\n\nRegards,\nRandall\n\n"}]}