{"thread":{"id":"47639","subject":"[RFC PATCH] NonStop port changes for git 2.16.0.","startedAt":"2018-01-18T22:43:19Z","lastAt":"2018-01-19T01:23:10Z","messageCount":4,"participants":["randall.s.becker@rogers.com","Stefan Beller","Ævar Arnfjörð Bjarmason","Randall S. Becker"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"336845","messageId":"20180118224243.5016-1-randall.s.becker@rogers.com","threadId":"47639","inReplyTo":null,"subject":"[RFC PATCH] NonStop port changes for git 2.16.0.","fromName":"","fromEmail":"randall.s.becker@rogers.com","sentAt":"2018-01-18T22:42:43Z","receivedAt":"2018-01-18T22:43:19Z","isPatch":true,"sender":{"key":"randall.s.becker@rogers.com","avatar":null},"body":"From: \"Randall S. Becker\" <rsbecker@nexbridge.com>\n\nExplanation: I'm looking for comments on how best to handle the changes\nbelow that are needed for the NonStop port. The hashmap.h and\ntransport-helper.c will not be included in the final patch as they have \nalready been communicated but did not make it into 2.16.0.\nIt is likely that some of the changes below are in the wrong files\n(for example: NSIG, intptr_t) and should be moved. This is just the\ncurrent state of the port, as it grew (and fortunately shrank a lot)\nover the past few years. My objective, as the platform maintainer, is\nto clean it up, and to try to get the platform's modifications\nincluded so that we can just (obviously) pull directly from the standard\nrepository and not have to apply these mods in future and focus on\nany platform-related breakages.\n\nFurther: there are 6 known breakages that have been reported. The perl\nissues relating to completion codes are being examined at present by the\nplatform support teams so are not addressed by this patch.\n\nWith Respect,\nRandall\n\n* Fixes platform issues not covered in the vanilla git code.\n\n* Pulls previous ports forward into a single commit.\n\n* Still has some known breaks based on platform limits and restrictions.\n\n* Makefile: allows error codes during install. Change the options associated\n  with the tar operation providing options required on platform. To be\n  refactored into variables.\n\n* regcomp.c: fixes missing intptr_t on NonStop.\n\n* config.mak.uname: upgrades old options for current operating system\n  requirements.\n\n* git-compat-util.h: adds FLOSS definitions to allow platform support.\n\n* remote.c: force ignoring of GCC __attribute construct not supported\n  by c99.\n\n* run_command.c: Added NSIG definition that is missing from NonStop\n  signal.h.\n\n* lib-git-daemon.sh: fixed incompatibilities with ksh traps not cleared\n  automatically on platform.\n\n* wrapper.c: added setbuf(stream,0) to force pipe flushes not enabled by\n  default on platform.\n\nSigned-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n---\n Makefile               |  4 ++--\n compat/regex/regcomp.c |  7 +++++++\n config.mak.uname       | 29 +++++++++++++++++++++--------\n git-compat-util.h      |  9 +++++++++\n hashmap.h              |  3 +--\n remote.c               |  4 ++++\n run-command.c          |  5 +++++\n t/lib-git-daemon.sh    |  3 +++\n transport-helper.c     |  2 +-\n wrapper.c              |  3 +++\n 10 files changed, 56 insertions(+), 13 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 1a9b23b67..c91602609 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2567,9 +2567,9 @@ install: all\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'\n \t$(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'\n ifndef NO_GETTEXT\n-\t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)'\n+\t-$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)'\n \t(cd po/build/locale && $(TAR) cf - .) | \\\n-\t(cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -)\n+\t(cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xvof -)\n endif\n ifndef NO_PERL\n \t$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install\ndiff --git a/compat/regex/regcomp.c b/compat/regex/regcomp.c\nindex 51cd60baa..cb03fab78 100644\n--- a/compat/regex/regcomp.c\n+++ b/compat/regex/regcomp.c\n@@ -17,6 +17,13 @@\n    License along with the GNU C Library; if not, see\n    <http://www.gnu.org/licenses/>.  */\n \n+#if defined __TANDEM\n+#ifdef NO_INTPTR_T\n+typedef long intptr_t;\n+typedef unsigned long uintptr_t;\n+#endif\n+#endif\n+\n static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,\n \t\t\t\t\t  size_t length, reg_syntax_t syntax);\n static void re_compile_fastmap_iter (regex_t *bufp,\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 685a80d13..d9f8d57e3 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -428,27 +428,37 @@ ifeq ($(uname_S),NONSTOP_KERNEL)\n \t# INLINE='' would just replace one set of warnings with another and\n \t# still not compile in c89 mode, due to non-const array initializations.\n \tCC = cc -c99\n+\t# Build down-rev compatible objects that don't use our new getopt_long.\n+\tifeq ($(uname_R).$(uname_V),J06.21)\n+\t\tCC += -WRVU=J06.20\n+\tendif\n+\tifeq ($(uname_R).$(uname_V),L17.02)\n+\t\tCC += -WRVU=L16.05\n+\tendif\n \t# Disable all optimization, seems to result in bad code, with -O or -O2\n \t# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects\n \t# abends on \"git push\". Needs more investigation.\n-\tCFLAGS = -g -O0\n+\tCFLAGS = -g -O0 -Winline\n \t# We'd want it to be here.\n \tprefix = /usr/local\n \t# Our's are in ${prefix}/bin (perl might also be in /usr/bin/perl).\n-\tPERL_PATH = ${prefix}/bin/perl\n-\tPYTHON_PATH = ${prefix}/bin/python\n-\n+\tPERL_PATH = /usr/bin/perl\n+\tPYTHON_PATH = /usr/bin/python\n+\tRM = /bin/rm -f\n \t# As detected by './configure'.\n \t# Missdetected, hence commented out, see below.\n \t#NO_CURL = YesPlease\n \t# Added manually, see above.\n \tNEEDS_SSL_WITH_CURL = YesPlease\n+\tNEEDS_CRYPTO_WITH_SSL = YesPlease\n+\tHAVE_DEV_TTY = YesPlease\n \tHAVE_LIBCHARSET_H = YesPlease\n \tHAVE_STRINGS_H = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n \tNEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease\n \tNO_SYS_SELECT_H = UnfortunatelyYes\n \tNO_D_TYPE_IN_DIRENT = YesPlease\n+\tNO_GETTEXT = YesPlease\n \tNO_HSTRERROR = YesPlease\n \tNO_STRCASESTR = YesPlease\n \tNO_MEMMEM = YesPlease\n@@ -458,8 +468,13 @@ ifeq ($(uname_S),NONSTOP_KERNEL)\n \tNO_MKDTEMP = YesPlease\n \t# Currently libiconv-1.9.1.\n \tOLD_ICONV = UnfortunatelyYes\n-\tNO_REGEX = YesPlease\n+\tNO_REGEX=NeedsStartEnd\n \tNO_PTHREADS = UnfortunatelyYes\n+\tifdef NO_PTHREADS\n+\telse # WIP, use Posix User Threads\n+\t\tPTHREAD_CFLAGS = -D_PUT_MODEL_ -I/usr/include\n+\t\tPTHREAD_LIBS = -lput\n+\tendif\n \n \t# Not detected (nor checked for) by './configure'.\n \t# We don't have SA_RESTART on NonStop, unfortunalety.\n@@ -477,9 +492,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)\n \t# RFE 10-120912-4693 submitted to HP NonStop development.\n \tNO_SETITIMER = UnfortunatelyYes\n \tSANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin\n-\tSHELL_PATH = /usr/local/bin/bash\n-\t# as of H06.25/J06.14, we might better use this\n-\t#SHELL_PATH = /usr/coreutils/bin/bash\n+\tSHELL_PATH = /usr/coreutils/bin/bash\n endif\n ifneq (,$(findstring MINGW,$(uname_S)))\n \tpathsep = ;\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 68b2ad531..5fc6b259d 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -378,6 +378,15 @@ static inline char *git_find_last_dir_sep(const char *path)\n #define find_last_dir_sep git_find_last_dir_sep\n #endif\n \n+#ifdef __TANDEM\n+#if !defined(_THREAD_SUPPORT_FUNCTIONS) && !defined(_PUT_MODEL_)\n+/* #include <floss.h(floss_read,floss_write,floss_fsync,floss_fork)> */\n+/* #include <floss.h(floss_fork)> */\n+#endif\n+#include <floss.h(floss_execl,floss_execlp,floss_execv,floss_execvp)>\n+#include <floss.h(floss_getpwuid)>\n+#endif\n+\n #if defined(__HP_cc) && (__HP_cc >= 61000)\n #define NORETURN __attribute__((noreturn))\n #define NORETURN_PTR\ndiff --git a/hashmap.h b/hashmap.h\nindex 7ce79f3f7..d375d9cce 100644\n--- a/hashmap.h\n+++ b/hashmap.h\n@@ -400,7 +400,6 @@ static inline void hashmap_disable_item_counting(struct hashmap *map)\n  */\n static inline void hashmap_enable_item_counting(struct hashmap *map)\n {\n-\tvoid *item;\n \tunsigned int n = 0;\n \tstruct hashmap_iter iter;\n \n@@ -408,7 +407,7 @@ static inline void hashmap_enable_item_counting(struct hashmap *map)\n \t\treturn;\n \n \thashmap_iter_init(map, &iter);\n-\twhile ((item = hashmap_iter_next(&iter)))\n+\twhile (hashmap_iter_next(&iter))\n \t\tn++;\n \n \tmap->do_count_items = 1;\ndiff --git a/remote.c b/remote.c\nindex 4e93753e1..c18f9de7f 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -11,6 +11,10 @@\n #include \"mergesort.h\"\n #include \"argv-array.h\"\n \n+#if defined (__TANDEM)\n+#define __attribute(a)\n+#endif\n+\n enum map_direction { FROM_SRC, FROM_DST };\n \n static struct refspec s_tag_refspec = {\ndiff --git a/run-command.c b/run-command.c\nindex 31fc5ea86..aaae8b54d 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -7,6 +7,11 @@\n #include \"strbuf.h\"\n #include \"string-list.h\"\n \n+#if defined __TANDEM && ! defined NSIG\n+/* See platform kill -l for list is all signals */\n+# define NSIG 100\n+#endif\n+\n void child_process_init(struct child_process *child)\n {\n \tmemset(child, 0, sizeof(*child));\ndiff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh\nindex 987d40680..955beecd9 100644\n--- a/t/lib-git-daemon.sh\n+++ b/t/lib-git-daemon.sh\n@@ -68,6 +68,7 @@ start_git_daemon() {\n \t\ttest_skip_or_die $GIT_TEST_GIT_DAEMON \\\n \t\t\t\"git daemon failed to start\"\n \tfi\n+\ttrap '' EXIT\n }\n \n stop_git_daemon() {\n@@ -89,4 +90,6 @@ stop_git_daemon() {\n \tfi\n \tGIT_DAEMON_PID=\n \trm -f git_daemon_output\n+\n+\ttrap '' EXIT\n }\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 508015023..d48be722a 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -1207,7 +1207,7 @@ static int udt_do_read(struct unidirectional_transfer *t)\n \t\treturn 0;\t/* No space for more. */\n \n \ttransfer_debug(\"%s is readable\", t->src_name);\n-\tbytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);\n+\tbytes = xread(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);\n \tif (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&\n \t\terrno != EINTR) {\n \t\terror_errno(\"read(%s) failed\", t->src_name);\ndiff --git a/wrapper.c b/wrapper.c\nindex d20356a77..671cbb4b4 100644\n--- a/wrapper.c\n+++ b/wrapper.c\n@@ -403,6 +403,9 @@ FILE *xfdopen(int fd, const char *mode)\n \tFILE *stream = fdopen(fd, mode);\n \tif (stream == NULL)\n \t\tdie_errno(\"Out of memory? fdopen failed\");\n+#ifdef __TANDEM\n+\tsetbuf(stream,0);\n+#endif\n \treturn stream;\n }\n \n-- \n2.16.0.31.gf1a482c\n\n"},{"id":"336847","messageId":"CAGZ79kb4Zr6QnNydRX56B_4Jo5fveufBFJAD7r_8U-NRSMa2qQ@mail.gmail.com","threadId":"47639","inReplyTo":"20180118224243.5016-1-randall.s.becker@rogers.com","subject":"Re: [RFC PATCH] NonStop port changes for git 2.16.0.","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-01-18T22:50:19Z","receivedAt":"2018-01-18T22:50:25Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Thu, Jan 18, 2018 at 2:42 PM,  <randall.s.becker@rogers.com> wrote:\n> From: \"Randall S. Becker\" <rsbecker@nexbridge.com>\n>\n> Explanation: I'm looking for comments on how best to handle the changes\n> below that are needed for the NonStop port.\n\nIdeally you'd send them as single patches, each of them describing why it\nmakes sense generally (such as the s/read/xread/ line) or specifically for\nyour arch (these #ifdefs and Makefile changes).\n\n> The hashmap.h and\n> transport-helper.c will not be included in the final patch as they have\n> already been communicated but did not make it into 2.16.0.\n> It is likely that some of the changes below are in the wrong files\n> (for example: NSIG, intptr_t) and should be moved. This is just the\n> current state of the port, as it grew (and fortunately shrank a lot)\n> over the past few years. My objective, as the platform maintainer, is\n> to clean it up, and to try to get the platform's modifications\n> included so that we can just (obviously) pull directly from the standard\n> repository and not have to apply these mods in future and focus on\n> any platform-related breakages.\n\nThanks for keeping up with the latest version! The xread issue sounds\nlike you found a bug across all platforms, which is valued by the wider\ncommunity. So feel free to send individual patches and the list will get\nback to you. :)\n\n> Further: there are 6 known breakages that have been reported. The perl\n> issues relating to completion codes are being examined at present by the\n> platform support teams so are not addressed by this patch.\n\nFor perl I'd suggest cc'ing Ævar (cc'd just now) as that seems his\nfield of expertise.\n\nThanks for such a report,\nStefan\n"},{"id":"336864","messageId":"87a7xaiu7z.fsf@evledraar.gmail.com","threadId":"47639","inReplyTo":"CAGZ79kb4Zr6QnNydRX56B_4Jo5fveufBFJAD7r_8U-NRSMa2qQ@mail.gmail.com","subject":"Re: [RFC PATCH] NonStop port changes for git 2.16.0.","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-01-19T00:10:40Z","receivedAt":"2018-01-19T00:13:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Jan 18 2018, Stefan Beller jotted:\n\n> On Thu, Jan 18, 2018 at 2:42 PM,  <randall.s.becker@rogers.com> wrote:\n>> Further: there are 6 known breakages that have been reported. The perl\n>> issues relating to completion codes are being examined at present by the\n>> platform support teams so are not addressed by this patch.\n>\n> For perl I'd suggest cc'ing Ævar (cc'd just now) as that seems his\n> field of expertise.\n\nJust to make sure I'm keeping up, this refers to some breakage not\ndetailed in the patch above, right?\n\nThe only perl-related change I see is undoing part of 6c109904bc (\"Port\nto HP NonStop\", 2012-09-19) having to do with how we find perl/python\n(which, not being at all familiar with NonStop, makes sense to me).\n\nBut sure, if there's some details about those 6 issues I might have time\nto take a look, but it sounds like it's being looked at by NonStop\nsupport...\n"},{"id":"336872","messageId":"00ba01d390c4$083b7360$18b25a20$@nexbridge.com","threadId":"47639","inReplyTo":"87a7xaiu7z.fsf@evledraar.gmail.com","subject":"RE: [RFC PATCH] NonStop port changes for git 2.16.0.","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2018-01-19T01:22:49Z","receivedAt":"2018-01-19T01:23:10Z","isPatch":true,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 18, 2018 7:11 PM, Ævar Arnfjörð Bjarmason wrote:\n> On Thu, Jan 18 2018, Stefan Beller jotted:\n> > On Thu, Jan 18, 2018 at 2:42 PM,  <randall.s.becker@rogers.com> wrote:\n> >> Further: there are 6 known breakages that have been reported. The\n> >> perl issues relating to completion codes are being examined at\n> >> present by the platform support teams so are not addressed by this\n> patch.\n> >\n> > For perl I'd suggest cc'ing Ævar (cc'd just now) as that seems his\n> > field of expertise.\n> \n> Just to make sure I'm keeping up, this refers to some breakage not detailed\n> in the patch above, right?\n> \n> The only perl-related change I see is undoing part of 6c109904bc (\"Port to HP\n> NonStop\", 2012-09-19) having to do with how we find perl/python (which,\n> not being at all familiar with NonStop, makes sense to me).\n> \n> But sure, if there's some details about those 6 issues I might have time to\n> take a look, but it sounds like it's being looked at by NonStop support...\n\nThe issue I found is that NonStop perl is reporting completion code 162/169 when 'die \"stuff\";' is run from stdin, while reporting 255 when a real file is used. This isn't covered by the patch. The values are in the range 128+sig#, but no such signals are value on the platform (SIGABEND is 31 and SIGGUARDIAN is 99 with a gap between those). I had tried a few experiments mapping the wonky completion codes in run-command.c to something sane but that caused more breakages (60) in the test suite than leaving well enough alone (6). From what I can determine, git is behaving reasonably properly in the conditions tested, but the test suite structure in its use of perl is triggering artifacts that appear to be breakages when really not. This is currently being investigated by the HPE support team, so I'm leaving perl completion matters in their hands for now.\n\nCheers,\nRandall\n\n-- Brief whoami:\n  NonStop developer since approximately NonStop(211288444200000000)\n  UNIX developer since approximately 421664400\n-- In my real life, I talk too much.\n\n\n\n"}]}