{"thread":{"id":"47563","subject":"[PATCH v5 0/3] RUNTIME_PREFIX relocatable Git","startedAt":"2018-01-08T03:03:24Z","lastAt":"2018-01-08T22:18:27Z","messageCount":13,"participants":["Dan Jacques","Ævar Arnfjörð Bjarmason","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":5,"patchTotal":3},"messages":[{"id":"336117","messageId":"20180108030239.92036-1-dnj@google.com","threadId":"47563","inReplyTo":null,"subject":"[PATCH v5 0/3] RUNTIME_PREFIX relocatable Git","fromName":"Dan Jacques","fromEmail":"dnj@google.com","sentAt":"2018-01-08T03:02:36Z","receivedAt":"2018-01-08T03:03:24Z","isPatch":true,"sender":{"key":"dnj@google.com","avatar":"https://avatars.githubusercontent.com/u/9965104?v=4"},"body":"(Send #2, since I failed to CC everyone in the first posting).\n\nThis patch set expands support for the RUNTIME_PREFIX configuration flag,\ncurrently only used on Windows builds, to include Linux, Darwin, and\nFreeBSD. When Git is built with RUNTIME_PREFIX enabled, it resolves its\nancillary paths relative to the runtime location of its executable\nrather than hard-coding them at compile-time, allowing a Git\ninstallation to be deployed to a path other than the one in which it\nwas built/installed.\n\nNote that RUNTIME_PREFIX is not currently used outside of Windows.\nThis patch set should not have an impact on default Git builds.\n\nI'm uploading an updated patch set now that avarab@'s Perl Makefile\nsimplification patch set has advanced and seems to be stable. Please take\na look and let me know what you think!\n\nPrevious threads:\nv1: https://public-inbox.org/git/20171116170523.28696-1-dnj@google.com/\nv2: https://public-inbox.org/git/20171119173141.4896-1-dnj@google.com/\nv3: https://public-inbox.org/git/20171127164055.93283-1-dnj@google.com/\nv4: https://public-inbox.org/git/20171129223807.91343-1-dnj@google.com/\n\nChanges in v5 from v4:\n\n- Rebase on top of \"next\", notably incorporating the\n  \"ab/simplify-perl-makefile\" branch.\n- Cleaner Makefile relative path enforcement.\n- Update Perl header template path now that the \"perl/\" directory has\n  fewer build-related files in it.\n- Update Perl runtime prefix header to use a general system path resolution\n  function.\n- Implemented the injection of the locale directory into Perl's\n  \"Git/I18N.pm\" module from the runtime prefix Perl script header.\n- Updated Perl's \"Git/I18N.pm\" module to accept injected locale directory.\n- Added more content to some comments.\n\n=== Testing ===\n\nThe latest patch set is available for testing on my GitHub fork, including\n\"travis.ci\" testing. The \"runtime-prefix\" branch includes a \"config.mak\"\ncommit that enables runtime prefix for the Travis build; the\n\"runtime-prefix-no-config\" omits this file, testing this patch without\nruntime prefix enabled:\n- https://github.com/danjacques/git/tree/runtime-prefix\n- https://travis-ci.org/danjacques/git/branches\n\nBuilt/tested locally using this \"config.mak\" w/ autoconf:\n\n=== Example config.mak ===\n\n## (BEGIN config.mak)\n\nRUNTIME_PREFIX = YesPlease\nRUNTIME_PREFIX_PERL = YesPlease\ngitexecdir = libexec/git-core\ntemplate_dir = share/git-core/templates\nsysconfdir = etc\n\n## (END config.mak)\n\n=== Revision History ===\n\nChanges in v4 from v3:\n\n- Incorporated some quoting and Makefile dependency fixes, courtesy of\n  <johannes.schindelin@gmx.de>.\n\nChanges in v3 from v2:\n\n- Broken into multiple patches now that Perl is isolated in its own\n  RUNTIME_PREFIX_PERL flag.\n- Working with avarab@, several changes to Perl script runtime prefix\n  support:\n  - Moved Perl header body content from Makefile into external template\n    file(s).\n  - Added generic \"perllibdir\" variable to override Perl installation\n    path.\n  - RUNTIME_PREFIX_PERL generated script header is more descriptive and\n    consistent with how the C version operates.\n  - Fixed Generated Perl header Makefile dependency, should rebuild\n    when dependent files and flags change.\n- Changed some of the new RUNTIME_PREFIX trace strings to use consistent\n  formatting and terminology.\n\nChanges in v2 from v1:\n\n- Added comments and formatting to improve readability of\n  platform-sepecific executable path resolution sleds in\n  `git_get_exec_path`.\n- Consolidated \"cached_exec_path\" and \"argv_exec_path\" globals\n  into \"exec_path_value\".\n- Use `strbuf_realpath` instead of `realpath` for procfs resolution.\n- Removed new environment variable exports. Git with RUNTIME_PREFIX no\n  longer exports or consumes any additional environment information.\n- Updated Perl script resolution strategy: rather than having Git export\n  the relative executable path to the Perl scripts, they now resolve\n  it independently when RUNTIME_PREFIX_PERL is enabled.\n- Updated resolution strategy for \"gettext()\": use system_path() instead\n  of special environment variable.\n- Added `sysctl` executable resolution support for BSDs that don't\n  mount \"procfs\" by default (most of them).\n\nDan Jacques (3):\n  Makefile: generate Perl header from template file\n  Makefile: add Perl runtime prefix support\n  exec_cmd: RUNTIME_PREFIX on some POSIX systems\n\n .gitignore                                       |   1 +\n Makefile                                         | 114 +++++++++--\n cache.h                                          |   1 +\n common-main.c                                    |   4 +-\n config.mak.uname                                 |   7 +\n exec_cmd.c                                       | 241 ++++++++++++++++++++---\n exec_cmd.h                                       |   4 +-\n gettext.c                                        |   8 +-\n git.c                                            |   2 +-\n perl/Git/I18N.pm                                 |   2 +-\n perl/header_templates/fixed_prefix.template.pl   |   1 +\n perl/header_templates/runtime_prefix.template.pl |  32 +++\n 12 files changed, 364 insertions(+), 53 deletions(-)\n create mode 100644 perl/header_templates/fixed_prefix.template.pl\n create mode 100644 perl/header_templates/runtime_prefix.template.pl\n\n-- \n2.15.0.chromium12\n\n"},{"id":"336118","messageId":"20180108030239.92036-2-dnj@google.com","threadId":"47563","inReplyTo":"20180108030239.92036-1-dnj@google.com","subject":"[PATCH v5 1/3] Makefile: generate Perl header from template file","fromName":"Dan Jacques","fromEmail":"dnj@google.com","sentAt":"2018-01-08T03:02:37Z","receivedAt":"2018-01-08T03:03:30Z","isPatch":true,"sender":{"key":"dnj@google.com","avatar":"https://avatars.githubusercontent.com/u/9965104?v=4"},"body":"Currently, the generated Perl script headers are emitted by commands in\nthe Makefile. This mechanism restricts options to introduce alternative\nheader content, needed by Perl runtime prefix support, and obscures the\norigin of the Perl script header.\n\nChange the Makefile to generate a header by processing a template file and\nmove the header content into the \"perl/\" subdirectory. The processed\ngenerated will now be stored in the \"GIT-PERL-HEADER\" file. This allows\nthe content of the Perl header to be controlled by changing the path of\nthe template in the Makefile.\n\nSigned-off-by: Dan Jacques <dnj@google.com>\nThanks-to: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nThanks-to: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore                                     |  1 +\n Makefile                                       | 27 +++++++++++++++-----------\n perl/header_templates/fixed_prefix.template.pl |  1 +\n 3 files changed, 18 insertions(+), 11 deletions(-)\n create mode 100644 perl/header_templates/fixed_prefix.template.pl\n\ndiff --git a/.gitignore b/.gitignore\nindex 833ef3b0b..89bd7bd8a 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -3,6 +3,7 @@\n /GIT-LDFLAGS\n /GIT-PREFIX\n /GIT-PERL-DEFINES\n+/GIT-PERL-HEADER\n /GIT-PYTHON-VARS\n /GIT-SCRIPT-DEFINES\n /GIT-USER-AGENT\ndiff --git a/Makefile b/Makefile\nindex 37e02cec1..e5e81ca1b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1967,20 +1967,15 @@ git.res: git.rc GIT-VERSION-FILE\n $(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS\n \n ifndef NO_PERL\n-$(SCRIPT_PERL_GEN):\n-\n+PERL_HEADER_TEMPLATE = perl/header_templates/fixed_prefix.template.pl\n PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ):$(perllibdir_SQ)\n-$(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-VERSION-FILE\n+\n+$(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n-\tINSTLIBDIR='$(perllibdir_SQ)' && \\\n-\tINSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \\\n-\tINSTLIBDIR=\"$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}\" && \\\n \tsed -e '1{' \\\n \t    -e '\ts|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n-\t    -e '\th' \\\n-\t    -e '\ts=.*=use lib (split(/$(pathsep)/, $$ENV{GITPERLLIB} || \"'\"$$INSTLIBDIR\"'\"));=' \\\n-\t    -e '\tH' \\\n-\t    -e '\tx' \\\n+\t    -e '\trGIT-PERL-HEADER' \\\n+\t    -e '\tG' \\\n \t    -e '}' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n \t    $< >$@+ && \\\n@@ -1994,6 +1989,16 @@ GIT-PERL-DEFINES: FORCE\n \t\techo \"$$FLAGS\" >$@; \\\n \t    fi\n \n+GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile\n+\t$(QUIET_GEN)$(RM) $@ && \\\n+\tINSTLIBDIR='$(perllibdir_SQ)' && \\\n+\tINSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \\\n+\tINSTLIBDIR=\"$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}\" && \\\n+\tsed -e 's=@@PATHSEP@@=$(pathsep)=g' \\\n+\t    -e 's=@@INSTLIBDIR@@='$$INSTLIBDIR'=g' \\\n+\t    -e 's=@@PERLLIBDIR@@='$(perllibdir_SQ)'=g' \\\n+\t    $< >$@+ && \\\n+\tmv $@+ $@\n \n .PHONY: gitweb\n gitweb:\n@@ -2735,7 +2740,7 @@ ifndef NO_TCLTK\n endif\n \t$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-BUILD-OPTIONS\n \t$(RM) GIT-USER-AGENT GIT-PREFIX\n-\t$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PYTHON-VARS\n+\t$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS\n \n .PHONY: all install profile-clean clean strip\n .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell\ndiff --git a/perl/header_templates/fixed_prefix.template.pl b/perl/header_templates/fixed_prefix.template.pl\nnew file mode 100644\nindex 000000000..857b4391a\n--- /dev/null\n+++ b/perl/header_templates/fixed_prefix.template.pl\n@@ -0,0 +1 @@\n+use lib (split(/@@PATHSEP@@/, $ENV{GITPERLLIB} || '@@INSTLIBDIR@@'));\n-- \n2.15.0.chromium12\n\n"},{"id":"336119","messageId":"20180108030239.92036-3-dnj@google.com","threadId":"47563","inReplyTo":"20180108030239.92036-1-dnj@google.com","subject":"[PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Dan Jacques","fromEmail":"dnj@google.com","sentAt":"2018-01-08T03:02:38Z","receivedAt":"2018-01-08T03:03:35Z","isPatch":true,"sender":{"key":"dnj@google.com","avatar":"https://avatars.githubusercontent.com/u/9965104?v=4"},"body":"Add a new Makefile flag, RUNTIME_PREFIX_PERL, which, when enabled,\nconfigures Perl scripts to locate the Git installation's Perl support\nlibraries by resolving against the script's path, rather than\nhard-coding that path at build-time.\n\nEnabling RUNTIME_PREFIX_PERL overrides the system-specific Perl script\ninstallation path generated by MakeMaker to force installation into a\nplatform-neutral location, \"<prefix>/share/perl5\".\n\nThis change enables Git's Perl scripts to work when their Git installation\nis relocated or moved to another system.\n\nSigned-off-by: Dan Jacques <dnj@google.com>\nThanks-to: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nThanks-to: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Makefile                                         | 53 +++++++++++++++++++++++-\n perl/Git/I18N.pm                                 |  2 +-\n perl/header_templates/runtime_prefix.template.pl | 32 ++++++++++++++\n 3 files changed, 85 insertions(+), 2 deletions(-)\n create mode 100644 perl/header_templates/runtime_prefix.template.pl\n\ndiff --git a/Makefile b/Makefile\nindex e5e81ca1b..060b47879 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -428,6 +428,10 @@ all::\n #\n # When cross-compiling, define HOST_CPU as the canonical name of the CPU on\n # which the built Git will run (for instance \"x86_64\").\n+#\n+# Define RUNTIME_PREFIX_PERL to configure Git's PERL commands to locate Git\n+# support libraries relative to their filesystem path instead of hard-coding\n+# it.\n \n GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n@@ -465,6 +469,8 @@ ARFLAGS = rcs\n #   mandir\n #   infodir\n #   htmldir\n+#   localedir\n+#   perllibdir\n # This can help installing the suite in a relocatable way.\n \n prefix = $(HOME)\n@@ -486,9 +492,12 @@ lib = lib\n # DESTDIR =\n pathsep = :\n \n+gitexecdir_relative = $(patsubst $(prefix)/%,%,$(gitexecdir))\n mandir_relative = $(patsubst $(prefix)/%,%,$(mandir))\n infodir_relative = $(patsubst $(prefix)/%,%,$(infodir))\n+localedir_relative = $(patsubst $(prefix)/%,%,$(localedir))\n htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))\n+perllibdir_relative = $(patsubst $(prefix)/%,%,$(perllibdir))\n \n export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir\n \n@@ -1732,10 +1741,13 @@ mandir_relative_SQ = $(subst ','\\'',$(mandir_relative))\n infodir_relative_SQ = $(subst ','\\'',$(infodir_relative))\n perllibdir_SQ = $(subst ','\\'',$(perllibdir))\n localedir_SQ = $(subst ','\\'',$(localedir))\n+localedir_relative_SQ = $(subst ','\\'',$(localedir_relative))\n gitexecdir_SQ = $(subst ','\\'',$(gitexecdir))\n+gitexecdir_relative_SQ = $(subst ','\\'',$(gitexecdir_relative))\n template_dir_SQ = $(subst ','\\'',$(template_dir))\n htmldir_relative_SQ = $(subst ','\\'',$(htmldir_relative))\n prefix_SQ = $(subst ','\\'',$(prefix))\n+perllibdir_relative_SQ = $(subst ','\\'',$(perllibdir_relative))\n gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n@@ -1966,10 +1978,45 @@ git.res: git.rc GIT-VERSION-FILE\n # This makes sure we depend on the NO_PERL setting itself.\n $(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS\n \n+# Used for substitution in Perl modules. Disabled when using RUNTIME_PREFIX_PERL\n+# since the locale directory is injected.\n+perl_localedir_SQ = $(localedir_SQ)\n+\n ifndef NO_PERL\n PERL_HEADER_TEMPLATE = perl/header_templates/fixed_prefix.template.pl\n PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ):$(perllibdir_SQ)\n \n+PERL_DEFINES := $(PERL_PATH_SQ) $(PERLLIB_EXTRA_SQ) $(perllibdir_SQ)\n+PERL_DEFINES += $(RUNTIME_PREFIX_PERL)\n+\n+# Support Perl runtime prefix. In this mode, a different header is installed\n+# into Perl scripts. This header requires Perl resource directories to be\n+# relative to the executable installation path, $(gitexecdir), and uses this\n+# property to resolve $(perllibdir) and $(localedir).\n+ifdef RUNTIME_PREFIX_PERL\n+\n+PERL_HEADER_TEMPLATE = perl/header_templates/runtime_prefix.template.pl\n+\n+# Don't export a fixed $(localedir) path; it will be resolved by the Perl header\n+# at runtime.\n+perl_localedir_SQ =\n+\n+ifneq ($(filter /%,$(firstword $(perllibdir_relative))),)\n+$(error RUNTIME_PREFIX_PERL requires a relative perllibdir, not: $(perllibdir))\n+endif\n+\n+ifneq ($(filter /%,$(firstword $(gitexecdir_relative))),)\n+$(error RUNTIME_PREFIX_PERL requires a relative gitexecdir, not: $(gitexecdir))\n+endif\n+\n+ifneq ($(filter /%,$(firstword $(localedir_relative))),)\n+$(error RUNTIME_PREFIX_PERL requires a relative localedir, not: $(localedir))\n+endif\n+\n+endif\n+\n+PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir)\n+\n $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n \tsed -e '1{' \\\n@@ -1982,6 +2029,7 @@ $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE\n \tchmod +x $@+ && \\\n \tmv $@+ $@\n \n+PERL_DEFINES := $(subst $(space),:,$(PERL_DEFINES))\n GIT-PERL-DEFINES: FORCE\n \t@FLAGS='$(PERL_DEFINES)'; \\\n \t    if test x\"$$FLAGS\" != x\"`cat $@ 2>/dev/null`\" ; then \\\n@@ -1997,6 +2045,9 @@ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile\n \tsed -e 's=@@PATHSEP@@=$(pathsep)=g' \\\n \t    -e 's=@@INSTLIBDIR@@='$$INSTLIBDIR'=g' \\\n \t    -e 's=@@PERLLIBDIR@@='$(perllibdir_SQ)'=g' \\\n+\t    -e 's=@@PERLLIBDIR_REL@@=$(perllibdir_relative_SQ)=g' \\\n+\t    -e 's=@@GITEXECDIR_REL@@=$(gitexecdir_relative_SQ)=g' \\\n+\t    -e 's=@@LOCALEDIR_REL@@=$(localedir_relative_SQ)=g' \\\n \t    $< >$@+ && \\\n \tmv $@+ $@\n \n@@ -2310,7 +2361,7 @@ endif\n \n perl/build/lib/%.pm: perl/%.pm\n \t$(QUIET_GEN)mkdir -p $(dir $@) && \\\n-\tsed -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' < $< > $@\n+\tsed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' < $< > $@\n \n perl/build/man/man3/Git.3pm: perl/Git.pm\n \t$(QUIET_GEN)mkdir -p $(dir $@) && \\\ndiff --git a/perl/Git/I18N.pm b/perl/Git/I18N.pm\nindex dba96fff0..bfb4fb67a 100644\n--- a/perl/Git/I18N.pm\n+++ b/perl/Git/I18N.pm\n@@ -18,7 +18,7 @@ our @EXPORT_OK = @EXPORT;\n \n sub __bootstrap_locale_messages {\n \tour $TEXTDOMAIN = 'git';\n-\tour $TEXTDOMAINDIR = $ENV{GIT_TEXTDOMAINDIR} || '@@LOCALEDIR@@';\n+\tour $TEXTDOMAINDIR ||= $ENV{GIT_TEXTDOMAINDIR} || '@@LOCALEDIR@@';\n \n \trequire POSIX;\n \tPOSIX->import(qw(setlocale));\ndiff --git a/perl/header_templates/runtime_prefix.template.pl b/perl/header_templates/runtime_prefix.template.pl\nnew file mode 100644\nindex 000000000..ff24eebc5\n--- /dev/null\n+++ b/perl/header_templates/runtime_prefix.template.pl\n@@ -0,0 +1,32 @@\n+# BEGIN RUNTIME_PREFIX_PERL generated code.\n+#\n+# This finds our Git::* libraries relative to the script's runtime path.\n+sub __git_system_path {\n+\tmy ($relpath) = @_;\n+\tmy $gitexecdir_relative = '@@GITEXECDIR_REL@@';\n+\n+\t# GIT_EXEC_PATH is supplied by `git` or the test suite. Otherwise, resolve\n+\t# against the runtime path of this script.\n+\trequire FindBin;\n+\trequire File::Spec;\n+\t(my $prefix = $ENV{GIT_EXEC_PATH} || $FindBin::Bin) =~ s=${gitexecdir_relative}$==;\n+\treturn File::Spec->catdir($prefix, $relpath);\n+}\n+\n+BEGIN {\n+\tuse lib split /@@PATHSEP@@/,\n+\t(\n+\t\t$ENV{GITPERLLIB} ||\n+\t\tdo {\n+\t\t\tmy $perllibdir = __git_system_path('@@PERLLIBDIR_REL@@');\n+\t\t\t(-e $perllibdir) || die(\"Invalid system path ($relpath): $path\");\n+\t\t\t$perllibdir;\n+\t\t}\n+\t);\n+\n+\t# Export the system locale directory to the I18N module. The locale directory\n+\t# is only installed if NO_GETTEXT is set.\n+\t$Git::I18N::TEXTDOMAINDIR = __git_system_path('@@LOCALEDIR_REL@@');\n+}\n+\n+# END RUNTIME_PREFIX_PERL generated code.\n-- \n2.15.0.chromium12\n\n"},{"id":"336120","messageId":"20180108030239.92036-4-dnj@google.com","threadId":"47563","inReplyTo":"20180108030239.92036-1-dnj@google.com","subject":"[PATCH v5 3/3] exec_cmd: RUNTIME_PREFIX on some POSIX systems","fromName":"Dan Jacques","fromEmail":"dnj@google.com","sentAt":"2018-01-08T03:02:39Z","receivedAt":"2018-01-08T03:03:37Z","isPatch":true,"sender":{"key":"dnj@google.com","avatar":"https://avatars.githubusercontent.com/u/9965104?v=4"},"body":"Enable Git to resolve its own binary location using a variety of\nOS-specific and generic methods, including:\n\n- procfs via \"/proc/self/exe\" (Linux)\n- _NSGetExecutablePath (Darwin)\n- KERN_PROC_PATHNAME sysctl on BSDs.\n- argv0, if absolute (all, including Windows).\n\nThis is used to enable RUNTIME_PREFIX support for non-Windows systems,\nnotably Linux and Darwin. When configured with RUNTIME_PREFIX, Git will\ndo a best-effort resolution of its executable path and automatically use\nthis as its \"exec_path\" for relative helper and data lookups, unless\nexplicitly overridden.\n\nSmall incidental formatting cleanup of \"exec_cmd.c\".\n\nSigned-off-by: Dan Jacques <dnj@google.com>\nThanks-to: Robbie Iannucci <iannucci@google.com>\nThanks-to: Junio C Hamano <gitster@pobox.com>\n---\n Makefile         |  36 ++++++++-\n cache.h          |   1 +\n common-main.c    |   4 +-\n config.mak.uname |   7 ++\n exec_cmd.c       | 241 ++++++++++++++++++++++++++++++++++++++++++++++++-------\n exec_cmd.h       |   4 +-\n gettext.c        |   8 +-\n git.c            |   2 +-\n 8 files changed, 262 insertions(+), 41 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 060b47879..587ff18e9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -412,6 +412,16 @@ all::\n #\n # Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function.\n #\n+# Define HAVE_BSD_KERN_PROC_SYSCTL if your platform supports the KERN_PROC BSD\n+# sysctl function.\n+#\n+# Define PROCFS_EXECUTABLE_PATH if your platform mounts a \"procfs\" filesystem\n+# capable of resolving the path of the current executable. If defined, this\n+# must be the canonical path for the \"procfs\" current executable path.\n+#\n+# Define HAVE_NS_GET_EXECUTABLE_PATH if your platform supports calling\n+# _NSGetExecutablePath to retrieve the path of the running executable.\n+#\n # Define HAVE_GETDELIM if your system has the getdelim() function.\n #\n # Define PAGER_ENV to a SP separated VAR=VAL pairs to define\n@@ -429,9 +439,17 @@ all::\n # When cross-compiling, define HOST_CPU as the canonical name of the CPU on\n # which the built Git will run (for instance \"x86_64\").\n #\n+# Define RUNTIME_PREFIX to configure Git to resolve its ancillary tooling and\n+# support files relative to the location of the runtime binary, rather than\n+# hard-coding them into the binary. Git installations built with RUNTIME_PREFIX\n+# can be moved to arbitrary filesystem locations. Users may want to enable\n+# RUNTIME_PREFIX_PERL as well (see below).\n+#\n # Define RUNTIME_PREFIX_PERL to configure Git's PERL commands to locate Git\n # support libraries relative to their filesystem path instead of hard-coding\n-# it.\n+# it. This is intentionally separate from RUNTIME_PREFIX so that notably Windows\n+# can hard-code Perl library paths while still enabling RUNTIME_PREFIX\n+# resolution.\n \n GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n@@ -1653,10 +1671,23 @@ ifdef HAVE_BSD_SYSCTL\n \tBASIC_CFLAGS += -DHAVE_BSD_SYSCTL\n endif\n \n+ifdef HAVE_BSD_KERN_PROC_SYSCTL\n+\tBASIC_CFLAGS += -DHAVE_BSD_KERN_PROC_SYSCTL\n+endif\n+\n ifdef HAVE_GETDELIM\n \tBASIC_CFLAGS += -DHAVE_GETDELIM\n endif\n \n+ifneq ($(PROCFS_EXECUTABLE_PATH),)\n+\tprocfs_executable_path_SQ = $(subst ','\\'',$(PROCFS_EXECUTABLE_PATH))\n+\tBASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH=\"$(procfs_executable_path_SQ)\"'\n+endif\n+\n+ifdef HAVE_NS_GET_EXECUTABLE_PATH\n+\tBASIC_CFLAGS += -DHAVE_NS_GET_EXECUTABLE_PATH\n+endif\n+\n ifeq ($(TCLTK_PATH),)\n NO_TCLTK = NoThanks\n endif\n@@ -2194,6 +2225,7 @@ endif\n exec_cmd.sp exec_cmd.s exec_cmd.o: GIT-PREFIX\n exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \\\n \t'-DGIT_EXEC_PATH=\"$(gitexecdir_SQ)\"' \\\n+\t'-DGIT_LOCALE_PATH=\"$(localedir_relative_SQ)\"' \\\n \t'-DBINDIR=\"$(bindir_relative_SQ)\"' \\\n \t'-DPREFIX=\"$(prefix_SQ)\"'\n \n@@ -2211,7 +2243,7 @@ attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \\\n \n gettext.sp gettext.s gettext.o: GIT-PREFIX\n gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \\\n-\t-DGIT_LOCALE_PATH='\"$(localedir_SQ)\"'\n+\t-DGIT_LOCALE_PATH='\"$(localedir_relative_SQ)\"'\n \n http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \\\n \t-DCURL_DISABLE_TYPECHECK\ndiff --git a/cache.h b/cache.h\nindex d8b975a57..212c1a631 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -452,6 +452,7 @@ static inline enum object_type object_type(unsigned int mode)\n #define GIT_ICASE_PATHSPECS_ENVIRONMENT \"GIT_ICASE_PATHSPECS\"\n #define GIT_QUARANTINE_ENVIRONMENT \"GIT_QUARANTINE_PATH\"\n #define GIT_OPTIONAL_LOCKS_ENVIRONMENT \"GIT_OPTIONAL_LOCKS\"\n+#define GIT_TEXT_DOMAIN_DIR_ENVIRONMENT \"GIT_TEXTDOMAINDIR\"\n \n /*\n  * Environment variable used in handshaking the wire protocol.\ndiff --git a/common-main.c b/common-main.c\nindex 6a689007e..6516a1f89 100644\n--- a/common-main.c\n+++ b/common-main.c\n@@ -32,12 +32,12 @@ int main(int argc, const char **argv)\n \t */\n \tsanitize_stdfds();\n \n+\tgit_resolve_executable_dir(argv[0]);\n+\n \tgit_setup_gettext();\n \n \tattr_start();\n \n-\tgit_extract_argv0_path(argv[0]);\n-\n \trestore_sigpipe_to_default();\n \n \treturn cmd_main(argc, argv);\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 685a80d13..58fd62b4d 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -37,6 +37,7 @@ ifeq ($(uname_S),Linux)\n \tHAVE_GETDELIM = YesPlease\n \tSANE_TEXT_GREP=-a\n \tFREAD_READS_DIRECTORIES = UnfortunatelyYes\n+\tPROCFS_EXECUTABLE_PATH = /proc/self/exe\n endif\n ifeq ($(uname_S),GNU/kFreeBSD)\n \tHAVE_ALLOCA_H = YesPlease\n@@ -111,6 +112,7 @@ ifeq ($(uname_S),Darwin)\n \tBASIC_CFLAGS += -DPROTECT_HFS_DEFAULT=1\n \tHAVE_BSD_SYSCTL = YesPlease\n \tFREAD_READS_DIRECTORIES = UnfortunatelyYes\n+\tHAVE_NS_GET_EXECUTABLE_PATH = YesPlease\n endif\n ifeq ($(uname_S),SunOS)\n \tNEEDS_SOCKET = YesPlease\n@@ -206,6 +208,7 @@ ifeq ($(uname_S),FreeBSD)\n \tHAVE_PATHS_H = YesPlease\n \tGMTIME_UNRELIABLE_ERRORS = UnfortunatelyYes\n \tHAVE_BSD_SYSCTL = YesPlease\n+\tHAVE_BSD_KERN_PROC_SYSCTL = YesPlease\n \tPAGER_ENV = LESS=FRX LV=-c MORE=FRX\n \tFREAD_READS_DIRECTORIES = UnfortunatelyYes\n endif\n@@ -218,6 +221,8 @@ ifeq ($(uname_S),OpenBSD)\n \tBASIC_LDFLAGS += -L/usr/local/lib\n \tHAVE_PATHS_H = YesPlease\n \tHAVE_BSD_SYSCTL = YesPlease\n+\tHAVE_BSD_KERN_PROC_SYSCTL = YesPlease\n+\tPROCFS_EXECUTABLE_PATH = /proc/curproc/file\n endif\n ifeq ($(uname_S),MirBSD)\n \tNO_STRCASESTR = YesPlease\n@@ -236,6 +241,8 @@ ifeq ($(uname_S),NetBSD)\n \tUSE_ST_TIMESPEC = YesPlease\n \tHAVE_PATHS_H = YesPlease\n \tHAVE_BSD_SYSCTL = YesPlease\n+\tHAVE_BSD_KERN_PROC_SYSCTL = YesPlease\n+\tPROCFS_EXECUTABLE_PATH = /proc/curproc/exe\n endif\n ifeq ($(uname_S),AIX)\n \tDEFAULT_PAGER = more\ndiff --git a/exec_cmd.c b/exec_cmd.c\nindex ce192a2d6..6585fc05a 100644\n--- a/exec_cmd.c\n+++ b/exec_cmd.c\n@@ -2,53 +2,234 @@\n #include \"exec_cmd.h\"\n #include \"quote.h\"\n #include \"argv-array.h\"\n-#define MAX_ARGS\t32\n \n-static const char *argv_exec_path;\n+#if defined(RUNTIME_PREFIX)\n+\n+#if defined(HAVE_NS_GET_EXECUTABLE_PATH)\n+#include <mach-o/dyld.h>\n+#endif\n+\n+#if defined(HAVE_BSD_KERN_PROC_SYSCTL)\n+#include <sys/param.h>\n+#include <sys/types.h>\n+#include <sys/sysctl.h>\n+#endif\n+\n+#endif /* RUNTIME_PREFIX */\n+\n+#define MAX_ARGS 32\n+\n+static const char *system_prefix(void);\n \n #ifdef RUNTIME_PREFIX\n-static const char *argv0_path;\n+\n+/**\n+ * When using a runtime prefix, Git dynamically resolves paths relative to its\n+ * executable.\n+ *\n+ * The method for determining the path of the executable is highly\n+ * platform-specific.\n+ */\n+\n+/**\n+ * Path to the current Git executable. Resolved on startup by\n+ * 'git_resolve_executable_dir'.\n+ */\n+static const char *executable_dirname;\n \n static const char *system_prefix(void)\n {\n \tstatic const char *prefix;\n \n-\tassert(argv0_path);\n-\tassert(is_absolute_path(argv0_path));\n+\tassert(executable_dirname);\n+\tassert(is_absolute_path(executable_dirname));\n \n \tif (!prefix &&\n-\t    !(prefix = strip_path_suffix(argv0_path, GIT_EXEC_PATH)) &&\n-\t    !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&\n-\t    !(prefix = strip_path_suffix(argv0_path, \"git\"))) {\n+\t    !(prefix = strip_path_suffix(executable_dirname, GIT_EXEC_PATH)) &&\n+\t    !(prefix = strip_path_suffix(executable_dirname, BINDIR)) &&\n+\t    !(prefix = strip_path_suffix(executable_dirname, \"git\"))) {\n \t\tprefix = PREFIX;\n \t\ttrace_printf(\"RUNTIME_PREFIX requested, \"\n-\t\t\t\t\"but prefix computation failed.  \"\n-\t\t\t\t\"Using static fallback '%s'.\\n\", prefix);\n+\t\t\t     \"but prefix computation failed.  \"\n+\t\t\t     \"Using static fallback '%s'.\\n\",\n+\t\t\t     prefix);\n \t}\n \treturn prefix;\n }\n \n-void git_extract_argv0_path(const char *argv0)\n+/*\n+ * Resolves the executable path from argv[0], only if it is absolute.\n+ *\n+ * Returns 0 on success, -1 on failure.\n+ */\n+static int git_get_exec_path_from_argv0(struct strbuf *buf, const char *argv0)\n {\n \tconst char *slash;\n \n \tif (!argv0 || !*argv0)\n-\t\treturn;\n+\t\treturn -1;\n \n \tslash = find_last_dir_sep(argv0);\n+\tif (slash) {\n+\t\ttrace_printf(\"trace: resolved executable path from argv0: %s\\n\",\n+\t\t\t     argv0);\n+\t\tstrbuf_add_absolute_path(buf, argv0);\n+\t\treturn 0;\n+\t}\n+\treturn -1;\n+}\n \n+#ifdef PROCFS_EXECUTABLE_PATH\n+/*\n+ * Resolves the executable path by examining a procfs symlink.\n+ *\n+ * Returns 0 on success, -1 on failure.\n+ */\n+static int git_get_exec_path_procfs(struct strbuf *buf)\n+{\n+\tif (strbuf_realpath(buf, PROCFS_EXECUTABLE_PATH, 0)) {\n+\t\ttrace_printf(\n+\t\t\t\"trace: resolved executable path from procfs: %s\\n\",\n+\t\t\tbuf->buf);\n+\t\treturn 0;\n+\t}\n+\treturn -1;\n+}\n+#endif /* PROCFS_EXECUTABLE_PATH */\n+\n+#ifdef HAVE_BSD_KERN_PROC_SYSCTL\n+/*\n+ * Resolves the executable path using KERN_PROC_PATHNAME BSD sysctl.\n+ *\n+ * Returns 0 on success, -1 on failure.\n+ */\n+static int git_get_exec_path_bsd_sysctl(struct strbuf *buf)\n+{\n+\tint mib[4];\n+\tchar path[MAXPATHLEN];\n+\tsize_t cb = sizeof(path);\n+\n+\tmib[0] = CTL_KERN;\n+\tmib[1] = KERN_PROC;\n+\tmib[2] = KERN_PROC_PATHNAME;\n+\tmib[3] = -1;\n+\tif (!sysctl(mib, 4, path, &cb, NULL, 0)) {\n+\t\ttrace_printf(\n+\t\t\t\"trace: resolved executable path from sysctl: %s\\n\",\n+\t\t\tpath);\n+\t\tstrbuf_addstr(buf, path);\n+\t\treturn 0;\n+\t}\n+\treturn -1;\n+}\n+#endif /* HAVE_BSD_KERN_PROC_SYSCTL */\n+\n+#ifdef HAVE_NS_GET_EXECUTABLE_PATH\n+/*\n+ * Resolves the executable path by querying Darwin applicaton stack.\n+ *\n+ * Returns 0 on success, -1 on failure.\n+ */\n+static int git_get_exec_path_darwin(struct strbuf *buf)\n+{\n+\tchar path[PATH_MAX];\n+\tuint32_t size = sizeof(path);\n+\tif (!_NSGetExecutablePath(path, &size)) {\n+\t\ttrace_printf(\n+\t\t\t\"trace: resolved executable path from Darwin stack: %s\\n\",\n+\t\t\tpath);\n+\t\tstrbuf_addstr(buf, path);\n+\t\treturn 0;\n+\t}\n+\treturn -1;\n+}\n+#endif /* HAVE_NS_GET_EXECUTABLE_PATH */\n+\n+/*\n+ * Resolves the absolute path of the current executable.\n+ *\n+ * Returns 0 on success, -1 on failure.\n+ */\n+static int git_get_exec_path(struct strbuf *buf, const char *argv0)\n+{\n+\t/*\n+\t * Identifying the executable path is operating system specific.\n+\t * Selectively employ all available methods in order of preference,\n+\t * preferring highly-available authoratative methods over\n+\t * selectively-available or non- authoratative methods.\n+\t *\n+\t * All cases fall back on resolving against argv[0] if there isn't a\n+\t * better functional method. However, note that argv[0] can be\n+\t * used-supplied on many operating sysetems, and is not authoratative\n+\t * in those cases.\n+\t *\n+\t * Each of these functions returns 0 on success, so evaluation will stop\n+\t * after the first successful method.\n+\t */\n+\tif (\n+#ifdef HAVE_BSD_KERN_PROC_SYSCTL\n+\t\tgit_get_exec_path_bsd_sysctl(buf) &&\n+#endif /* HAVE_BSD_KERN_PROC_SYSCTL */\n+\n+#ifdef HAVE_NS_GET_EXECUTABLE_PATH\n+\t\tgit_get_exec_path_darwin(buf) &&\n+#endif /* HAVE_NS_GET_EXECUTABLE_PATH */\n+\n+#ifdef PROCFS_EXECUTABLE_PATH\n+\t\tgit_get_exec_path_procfs(buf) &&\n+#endif /* PROCFS_EXECUTABLE_PATH */\n+\n+\t\tgit_get_exec_path_from_argv0(buf, argv0)) {\n+\t\treturn -1;\n+\t}\n+\n+\tif (strbuf_normalize_path(buf)) {\n+\t\ttrace_printf(\"trace: could not normalize path: %s\\n\", buf->buf);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+void git_resolve_executable_dir(const char *argv0)\n+{\n+\tstruct strbuf buf = STRBUF_INIT;\n+\tchar *resolved;\n+\tconst char *slash;\n+\n+\tif (git_get_exec_path(&buf, argv0)) {\n+\t\ttrace_printf(\n+\t\t\t\"trace: could not determine executable path from: %s\\n\",\n+\t\t\targv0);\n+\t\tstrbuf_release(&buf);\n+\t\treturn;\n+\t}\n+\n+\tresolved = strbuf_detach(&buf, NULL);\n+\tslash = find_last_dir_sep(resolved);\n \tif (slash)\n-\t\targv0_path = xstrndup(argv0, slash - argv0);\n+\t\tresolved[slash - resolved] = '\\0';\n+\n+\texecutable_dirname = resolved;\n+\ttrace_printf(\"trace: resolved executable dir: %s\\n\",\n+\t\t     executable_dirname);\n }\n \n #else\n \n+/*\n+ * When not using a runtime prefix, Git uses a hard-coded path.\n+ */\n static const char *system_prefix(void)\n {\n \treturn PREFIX;\n }\n \n-void git_extract_argv0_path(const char *argv0)\n+/*\n+ * This is called during initialization, but No work needs to be done here when\n+ * runtime prefix is not being used.\n+ */\n+void git_resolve_executable_dir(const char *argv0)\n {\n }\n \n@@ -65,32 +246,28 @@ char *system_path(const char *path)\n \treturn strbuf_detach(&d, NULL);\n }\n \n-void git_set_argv_exec_path(const char *exec_path)\n+static const char *exec_path_value;\n+\n+void git_set_exec_path(const char *exec_path)\n {\n-\targv_exec_path = exec_path;\n+\texec_path_value = exec_path;\n \t/*\n \t * Propagate this setting to external programs.\n \t */\n \tsetenv(EXEC_PATH_ENVIRONMENT, exec_path, 1);\n }\n \n-\n-/* Returns the highest-priority, location to look for git programs. */\n+/* Returns the highest-priority location to look for git programs. */\n const char *git_exec_path(void)\n {\n-\tstatic char *cached_exec_path;\n-\n-\tif (argv_exec_path)\n-\t\treturn argv_exec_path;\n-\n-\tif (!cached_exec_path) {\n+\tif (!exec_path_value) {\n \t\tconst char *env = getenv(EXEC_PATH_ENVIRONMENT);\n \t\tif (env && *env)\n-\t\t\tcached_exec_path = xstrdup(env);\n+\t\t\texec_path_value = xstrdup(env);\n \t\telse\n-\t\t\tcached_exec_path = system_path(GIT_EXEC_PATH);\n+\t\t\texec_path_value = system_path(GIT_EXEC_PATH);\n \t}\n-\treturn cached_exec_path;\n+\treturn exec_path_value;\n }\n \n static void add_path(struct strbuf *out, const char *path)\n@@ -103,10 +280,12 @@ static void add_path(struct strbuf *out, const char *path)\n \n void setup_path(void)\n {\n+\tconst char *exec_path = git_exec_path();\n \tconst char *old_path = getenv(\"PATH\");\n \tstruct strbuf new_path = STRBUF_INIT;\n \n-\tadd_path(&new_path, git_exec_path());\n+\tgit_set_exec_path(exec_path);\n+\tadd_path(&new_path, exec_path);\n \n \tif (old_path)\n \t\tstrbuf_addstr(&new_path, old_path);\n@@ -125,7 +304,8 @@ const char **prepare_git_cmd(struct argv_array *out, const char **argv)\n \treturn out->argv;\n }\n \n-int execv_git_cmd(const char **argv) {\n+int execv_git_cmd(const char **argv)\n+{\n \tstruct argv_array nargv = ARGV_ARRAY_INIT;\n \n \tprepare_git_cmd(&nargv, argv);\n@@ -140,8 +320,7 @@ int execv_git_cmd(const char **argv) {\n \treturn -1;\n }\n \n-\n-int execl_git_cmd(const char *cmd,...)\n+int execl_git_cmd(const char *cmd, ...)\n {\n \tint argc;\n \tconst char *argv[MAX_ARGS + 1];\ndiff --git a/exec_cmd.h b/exec_cmd.h\nindex ff0b48048..2522453cd 100644\n--- a/exec_cmd.h\n+++ b/exec_cmd.h\n@@ -3,8 +3,8 @@\n \n struct argv_array;\n \n-extern void git_set_argv_exec_path(const char *exec_path);\n-extern void git_extract_argv0_path(const char *path);\n+extern void git_set_exec_path(const char *exec_path);\n+extern void git_resolve_executable_dir(const char *path);\n extern const char *git_exec_path(void);\n extern void setup_path(void);\n extern const char **prepare_git_cmd(struct argv_array *out, const char **argv);\ndiff --git a/gettext.c b/gettext.c\nindex db727ea02..6b64d5c2e 100644\n--- a/gettext.c\n+++ b/gettext.c\n@@ -2,7 +2,8 @@\n  * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n  */\n \n-#include \"git-compat-util.h\"\n+#include \"cache.h\"\n+#include \"exec_cmd.h\"\n #include \"gettext.h\"\n #include \"strbuf.h\"\n #include \"utf8.h\"\n@@ -157,10 +158,11 @@ static void init_gettext_charset(const char *domain)\n \n void git_setup_gettext(void)\n {\n-\tconst char *podir = getenv(\"GIT_TEXTDOMAINDIR\");\n+\tconst char *podir = getenv(GIT_TEXT_DOMAIN_DIR_ENVIRONMENT);\n \n \tif (!podir)\n-\t\tpodir = GIT_LOCALE_PATH;\n+\t\tpodir = system_path(GIT_LOCALE_PATH);\n+\n \tbindtextdomain(\"git\", podir);\n \tsetlocale(LC_MESSAGES, \"\");\n \tsetlocale(LC_TIME, \"\");\ndiff --git a/git.c b/git.c\nindex c870b9719..ed2535a19 100644\n--- a/git.c\n+++ b/git.c\n@@ -65,7 +65,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)\n \t\t */\n \t\tif (skip_prefix(cmd, \"--exec-path\", &cmd)) {\n \t\t\tif (*cmd == '=')\n-\t\t\t\tgit_set_argv_exec_path(cmd + 1);\n+\t\t\t\tgit_set_exec_path(cmd + 1);\n \t\t\telse {\n \t\t\t\tputs(git_exec_path());\n \t\t\t\texit(0);\n-- \n2.15.0.chromium12\n\n"},{"id":"336123","messageId":"87inccbscj.fsf@evledraar.gmail.com","threadId":"47563","inReplyTo":"20180108030239.92036-3-dnj@google.com","subject":"Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-01-08T09:41:16Z","receivedAt":"2018-01-08T09:41:32Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Jan 08 2018, Dan Jacques jotted:\n\nThanks, applied this on top of next and it works for me, i.e. install to\n/tmp/git and move to /tmp/git2 = works for me. Comments below.\n\n> Enabling RUNTIME_PREFIX_PERL overrides the system-specific Perl script\n> installation path generated by MakeMaker to force installation into a\n> platform-neutral location, \"<prefix>/share/perl5\".\n\nNot generated by MakeMaker anymore :)\n\nFrom 3/3 (not not send 2 e-mails):\n\n>+# it. This is intentionally separate from RUNTIME_PREFIX so that notably Windows\n>+# can hard-code Perl library paths while still enabling RUNTIME_PREFIX\n>+# resolution.\n\nMaybe we covered this in previous submissions, but refresh my memory,\nwhy is the *_PERL define still needed? Reading this explanation doesn't\nmake sense to me, but I'm probably missing something.\n\nIf we have a system where we have some perl library paths on the system\nwe want to use, then they'll still be in @INC after our 'use lib'-ing,\nso we'll find libraries there.\n\nThe only reason I can think of for doing this for C and not for Perl\nwould be if you for some reason want to have a git in /tmp/git but then\nuse a different version of the Git.pm from some system install, but I\ncan't imagine why.\n\nOr there's another option...\n\n> +\t# GIT_EXEC_PATH is supplied by `git` or the test suite. Otherwise, resolve\n> +\t# against the runtime path of this script.\n> +\trequire FindBin;\n> +\trequire File::Spec;\n> +\t(my $prefix = $ENV{GIT_EXEC_PATH} || $FindBin::Bin) =~ s=${gitexecdir_relative}$==;\n\nSo why are we falling back on $FindBin::Bin? Just so you can do\ne.g. /tmp/git2/libexec/git-core/git-svn like you can do\n/tmp/git2/libexec/git-core/git-status, i.e. will this never be false if\ninvoked via \"git\"?\n\nI don't mind it, just wondering if I'm missing something and we need to\nuse the fallback path in some \"normal\" codepath.\n\n> +\treturn File::Spec->catdir($prefix, $relpath);\n\nI think you initially got some version of this from me (or not), so this\nis probably my fault, but reading this again I think this would be\nbetter as just:\n\n    return $prefix . '@@PATHSEP@@' . $relpath;\n\nI.e. right after this we split on @@PATHSEP@@, and that clearly works\n(as opposed to using File::Spec->splitpath) since we've used it\nforever.\n\nBetter just to use the same idiom on both ends to not leave the reader\nwondering why we can split paths one way, but need to join them another\nway.\n"},{"id":"336174","messageId":"20180108191812.52565-1-dnj@google.com","threadId":"47563","inReplyTo":"87inccbscj.fsf@evledraar.gmail.com","subject":"Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Dan Jacques","fromEmail":"dnj@google.com","sentAt":"2018-01-08T19:18:12Z","receivedAt":"2018-01-08T19:18:27Z","isPatch":true,"sender":{"key":"dnj@google.com","avatar":"https://avatars.githubusercontent.com/u/9965104?v=4"},"body":"On Mon, 08 Jan 2018, Ævar Arnfjörð Bjarmason replied:\n\n> Thanks, applied this on top of next and it works for me, i.e. install to\n> /tmp/git and move to /tmp/git2 = works for me. Comments below.\n\nGood to hear! I've run this through a few machines at my disposal, but\nthe more hands on the better.\n\n>> Enabling RUNTIME_PREFIX_PERL overrides the system-specific Perl script\n>> installation path generated by MakeMaker to force installation into a\n>> platform-neutral location, \"<prefix>/share/perl5\".\n>\n> Not generated by MakeMaker anymore :)\n\nHah good catch! I'll update the commit message.\n\n>>+# it. This is intentionally separate from RUNTIME_PREFIX so that notably Windows\n>>+# can hard-code Perl library paths while still enabling RUNTIME_PREFIX\n>>+# resolution.\n>\n> Maybe we covered this in previous submissions, but refresh my memory,\n> why is the *_PERL define still needed? Reading this explanation doesn't\n> make sense to me, but I'm probably missing something.\n>\n> If we have a system where we have some perl library paths on the system\n> we want to use, then they'll still be in @INC after our 'use lib'-ing,\n> so we'll find libraries there.\n>\n> The only reason I can think of for doing this for C and not for Perl\n> would be if you for some reason want to have a git in /tmp/git but then\n> use a different version of the Git.pm from some system install, but I\n> can't imagine why.\n\nThe reason is entirely due to the way Git-for-Windows is structured. In\nGit-for-Windows, Git binaries are run directly from Windows, meaning that\nthey require RUNTIME_PREFIX resolution. However, Perl scripts are run from\na MinGW universe, within which filesystem paths are fixed. Therefore,\nWindows Perl scripts don't require a runtime prefix resolution.\n\nThis makes sense because they are clearly functional right now without this\npatch enabled :) However, we don't have the luxury of running Perl in a\nseparate universe on other OSes, so this patch is necessary for them.\n\nI created a separate option because I wanted to ensure that I don't change\nanything fundamental in Windows, which currently relies on runtime prefix\nresoultion. On all other operating systems, Perl and binary runtime prefix\nresolution is disabled by default, so if this patch set does end up having\nbugs or edge cases in the Perl runtime prefix code, it won't inpact anybody's\ncurrent builds.\n\nI can foresee a future where Windows maintainers decide that\nPERL_RUNTIME_PREFIX is fine for Windows and merge the two options; however,\nI didn't want to force that decision in the initial implementation.\n\n> > +\t# GIT_EXEC_PATH is supplied by `git` or the test suite. Otherwise, resolve\n> > +\t# against the runtime path of this script.\n> > +\trequire FindBin;\n> > +\trequire File::Spec;\n> > +\t(my $prefix = $ENV{GIT_EXEC_PATH} || $FindBin::Bin) =~ s=${gitexecdir_relative}$==;\n>\n> So why are we falling back on $FindBin::Bin? Just so you can do\n> e.g. /tmp/git2/libexec/git-core/git-svn like you can do\n> /tmp/git2/libexec/git-core/git-status, i.e. will this never be false if\n> invoked via \"git\"?\n>\n> I don't mind it, just wondering if I'm missing something and we need to\n> use the fallback path in some \"normal\" codepath.\n\nYep, exactly. The ability to directly invoke Perl scripts is currently\nfunctional in non-runtime-prefix builds, so enabling it in runtime-prefix\nbuilds seemed appropriate. I have found this useful for testing.\n\nHowever, since GIT_EXEC_PATH is probably going to be the common path,\nI'll scoop the FindBin code (including the \"require\" statement) into a\nconditional in v6 and use it only when GIT_EXEC_PATH is empty.\n\n> > +\treturn File::Spec->catdir($prefix, $relpath);\n>\n> I think you initially got some version of this from me (or not), so this\n> is probably my fault, but reading this again I think this would be\n> better as just:\n>\n>     return $prefix . '@@PATHSEP@@' . $relpath;\n>\n> I.e. right after this we split on @@PATHSEP@@, and that clearly works\n> (as opposed to using File::Spec->splitpath) since we've used it\n> forever.\n>\n> Better just to use the same idiom on both ends to not leave the reader\n> wondering why we can split paths one way, but need to join them another\n> way.\n\nPATHSEP is the path separator (\":\"), as opposed to the filesystem separator\n(\"/\"). We split on PATHSEP below b/c we need to \"use lib\" as an array, but\nit may be a \":\"-delimited string.\n"},{"id":"336181","messageId":"878td8azp1.fsf@evledraar.gmail.com","threadId":"47563","inReplyTo":"20180108191812.52565-1-dnj@google.com","subject":"Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-01-08T20:00:10Z","receivedAt":"2018-01-08T20:00:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Jan 08 2018, Dan Jacques jotted:\n\n> On Mon, 08 Jan 2018, Ævar Arnfjörð Bjarmason replied:\n>>>+# it. This is intentionally separate from RUNTIME_PREFIX so that notably Windows\n>>>+# can hard-code Perl library paths while still enabling RUNTIME_PREFIX\n>>>+# resolution.\n>>\n>> Maybe we covered this in previous submissions, but refresh my memory,\n>> why is the *_PERL define still needed? Reading this explanation doesn't\n>> make sense to me, but I'm probably missing something.\n>>\n>> If we have a system where we have some perl library paths on the system\n>> we want to use, then they'll still be in @INC after our 'use lib'-ing,\n>> so we'll find libraries there.\n>>\n>> The only reason I can think of for doing this for C and not for Perl\n>> would be if you for some reason want to have a git in /tmp/git but then\n>> use a different version of the Git.pm from some system install, but I\n>> can't imagine why.\n>\n> The reason is entirely due to the way Git-for-Windows is structured. In\n> Git-for-Windows, Git binaries are run directly from Windows, meaning that\n> they require RUNTIME_PREFIX resolution. However, Perl scripts are run from\n> a MinGW universe, within which filesystem paths are fixed. Therefore,\n> Windows Perl scripts don't require a runtime prefix resolution.\n>\n> This makes sense because they are clearly functional right now without this\n> patch enabled :) However, we don't have the luxury of running Perl in a\n> separate universe on other OSes, so this patch is necessary for them.\n>\n> I created a separate option because I wanted to ensure that I don't change\n> anything fundamental in Windows, which currently relies on runtime prefix\n> resoultion. On all other operating systems, Perl and binary runtime prefix\n> resolution is disabled by default, so if this patch set does end up having\n> bugs or edge cases in the Perl runtime prefix code, it won't inpact anybody's\n> current builds.\n>\n> I can foresee a future where Windows maintainers decide that\n> PERL_RUNTIME_PREFIX is fine for Windows and merge the two options; however,\n> I didn't want to force that decision in the initial implementation.\n\nMakes sense, well not really, But that's not your fault, but Windows's.\n\nI do think you're being overly conservative here, the perl change is no\nmore invasive than the C changes (less so actually), and from anyone\nwho's not on Windows it makes sense to be able to enable this with just\nRUNTIME_PREFIX=YesPlease, and have NO_RUNTIME_PREFIX_PERL=NotNeededHere\nfor Windows, if someone ends up needing it.\n\nWe usually hide stuff you might want in general, but isn't needed on one\nspecial snowflake platform behind NO_*, not the other way around.\n\nMaybe others disagre... \n\n>> > +\t# GIT_EXEC_PATH is supplied by `git` or the test suite. Otherwise, resolve\n>> > +\t# against the runtime path of this script.\n>> > +\trequire FindBin;\n>> > +\trequire File::Spec;\n>> > +\t(my $prefix = $ENV{GIT_EXEC_PATH} || $FindBin::Bin) =~ s=${gitexecdir_relative}$==;\n>>\n>> So why are we falling back on $FindBin::Bin? Just so you can do\n>> e.g. /tmp/git2/libexec/git-core/git-svn like you can do\n>> /tmp/git2/libexec/git-core/git-status, i.e. will this never be false if\n>> invoked via \"git\"?\n>>\n>> I don't mind it, just wondering if I'm missing something and we need to\n>> use the fallback path in some \"normal\" codepath.\n>\n> Yep, exactly. The ability to directly invoke Perl scripts is currently\n> functional in non-runtime-prefix builds, so enabling it in runtime-prefix\n> builds seemed appropriate. I have found this useful for testing.\n>\n> However, since GIT_EXEC_PATH is probably going to be the common path,\n> I'll scoop the FindBin code (including the \"require\" statement) into a\n> conditional in v6 and use it only when GIT_EXEC_PATH is empty.\n\nBoth make sense.\n\n>> > +\treturn File::Spec->catdir($prefix, $relpath);\n>>\n>> I think you initially got some version of this from me (or not), so this\n>> is probably my fault, but reading this again I think this would be\n>> better as just:\n>>\n>>     return $prefix . '@@PATHSEP@@' . $relpath;\n>>\n>> I.e. right after this we split on @@PATHSEP@@, and that clearly works\n>> (as opposed to using File::Spec->splitpath) since we've used it\n>> forever.\n>>\n>> Better just to use the same idiom on both ends to not leave the reader\n>> wondering why we can split paths one way, but need to join them another\n>> way.\n>\n> PATHSEP is the path separator (\":\"), as opposed to the filesystem separator\n> (\"/\"). We split on PATHSEP below b/c we need to \"use lib\" as an array, but\n> it may be a \":\"-delimited string.\n\nYes, silly me. Nevermind.\n"},{"id":"336185","messageId":"nycvar.QRO.7.76.6.1801081558580.31@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"47563","inReplyTo":"87inccbscj.fsf@evledraar.gmail.com","subject":"Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-01-08T20:24:20Z","receivedAt":"2018-01-08T20:24:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 8 Jan 2018, Ævar Arnfjörð Bjarmason wrote:\n\n> \n> On Mon, Jan 08 2018, Dan Jacques jotted:\n> \n> From 3/3 (not not send 2 e-mails):\n> \n> >+# it. This is intentionally separate from RUNTIME_PREFIX so that notably Windows\n> >+# can hard-code Perl library paths while still enabling RUNTIME_PREFIX\n> >+# resolution.\n> \n> Maybe we covered this in previous submissions, but refresh my memory,\n> why is the *_PERL define still needed? Reading this explanation doesn't\n> make sense to me, but I'm probably missing something.\n\nIf the reason is to accommodate Windows, I think it'd make more sense to\nchange the way Git for Windows handles this, and use the same relative\npaths (if possible, that is, see the GITPERLLIB problems I mentioned\nelsewhere and which necessitated\nhttps://github.com/git-for-windows/git/commit/3b2f716bd8).\n\nBTW I managed to run your `runtime-prefix` branch through VSTS builds on\nWindows, macOS and Linux and they all pass the test suite. (Including the\nRUNTIME_PREFIX_PERL=YesPlease setting you added for Travis CI testing.)\n\nWhat do you think? Should we just fold the RUNTIME_PREFIX_PERL handling\ninto RUNTIME_PREFIX and be done with that part?\n\nCiao,\nJohannes"},{"id":"336186","messageId":"nycvar.QRO.7.76.6.1801082125210.31@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"47563","inReplyTo":"20180108191812.52565-1-dnj@google.com","subject":"Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-01-08T20:27:37Z","receivedAt":"2018-01-08T20:27:54Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 8 Jan 2018, Dan Jacques wrote:\n\n> On Mon, 08 Jan 2018, Ævar Arnfjörð Bjarmason replied:\n> \n> >>+# it. This is intentionally separate from RUNTIME_PREFIX so that\n> >>notably Windows +# can hard-code Perl library paths while still\n> >>enabling RUNTIME_PREFIX +# resolution.\n> >\n> > Maybe we covered this in previous submissions, but refresh my memory,\n> > why is the *_PERL define still needed? Reading this explanation\n> > doesn't make sense to me, but I'm probably missing something.\n> >\n> > If we have a system where we have some perl library paths on the\n> > system we want to use, then they'll still be in @INC after our 'use\n> > lib'-ing, so we'll find libraries there.\n> >\n> > The only reason I can think of for doing this for C and not for Perl\n> > would be if you for some reason want to have a git in /tmp/git but\n> > then use a different version of the Git.pm from some system install,\n> > but I can't imagine why.\n> \n> The reason is entirely due to the way Git-for-Windows is structured. In\n> Git-for-Windows, Git binaries are run directly from Windows, meaning\n> that they require RUNTIME_PREFIX resolution. However, Perl scripts are\n> run from a MinGW universe, within which filesystem paths are fixed.\n> Therefore, Windows Perl scripts don't require a runtime prefix\n> resolution.\n\nAs I mentioned in the mail I just finished and sent (I started it hours\nago, but then got busy with other things while the builds were running): I\nam totally cool with changing this on Windows, too. Should simplify\nthings, right?\n\nCiao,\nJohannes"},{"id":"336204","messageId":"xmqqzi5o6mp1.fsf@gitster.mtv.corp.google.com","threadId":"47563","inReplyTo":"nycvar.QRO.7.76.6.1801082125210.31@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","subject":"Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-01-08T21:54:34Z","receivedAt":"2018-01-08T21:54:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Mon, 8 Jan 2018, Dan Jacques wrote:\n>\n>> On Mon, 08 Jan 2018, Ævar Arnfjörð Bjarmason replied:\n>> \n>> >>+# it. This is intentionally separate from RUNTIME_PREFIX so that\n>> >>notably Windows +# can hard-code Perl library paths while still\n>> >>enabling RUNTIME_PREFIX +# resolution.\n>> >\n>> > Maybe we covered this in previous submissions, but refresh my memory,\n>> > why is the *_PERL define still needed? Reading this explanation\n>> > doesn't make sense to me, but I'm probably missing something.\n>> >\n>> > If we have a system where we have some perl library paths on the\n>> > system we want to use, then they'll still be in @INC after our 'use\n>> > lib'-ing, so we'll find libraries there.\n>> >\n>> > The only reason I can think of for doing this for C and not for Perl\n>> > would be if you for some reason want to have a git in /tmp/git but\n>> > then use a different version of the Git.pm from some system install,\n>> > but I can't imagine why.\n>> \n>> The reason is entirely due to the way Git-for-Windows is structured. In\n>> Git-for-Windows, Git binaries are run directly from Windows, meaning\n>> that they require RUNTIME_PREFIX resolution. However, Perl scripts are\n>> run from a MinGW universe, within which filesystem paths are fixed.\n>> Therefore, Windows Perl scripts don't require a runtime prefix\n>> resolution.\n>\n> As I mentioned in the mail I just finished and sent (I started it hours\n> ago, but then got busy with other things while the builds were running): I\n> am totally cool with changing this on Windows, too. Should simplify\n> things, right?\n\nWonderful to see that you two are in agreement.  Will look forward\nto see a simplified solution in a later round ;-)\n\n"},{"id":"336205","messageId":"20180108220550.66256-1-dnj@google.com","threadId":"47563","inReplyTo":"nycvar.QRO.7.76.6.1801082125210.31@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","subject":"Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Dan Jacques","fromEmail":"dnj@google.com","sentAt":"2018-01-08T22:05:50Z","receivedAt":"2018-01-08T22:06:00Z","isPatch":true,"sender":{"key":"dnj@google.com","avatar":"https://avatars.githubusercontent.com/u/9965104?v=4"},"body":"On 2018-01-08 20:27, Johannes Schindelin wrote:\n\n> > Maybe we covered this in previous submissions, but refresh my memory,\n> > why is the *_PERL define still needed? Reading this explanation doesn't\n> > make sense to me, but I'm probably missing something.\n>\n> If the reason is to accommodate Windows, I think it'd make more sense to\n> change the way Git for Windows handles this, and use the same relative\n> paths (if possible, that is, see the GITPERLLIB problems I mentioned\n> elsewhere and which necessitated\n> https://github.com/git-for-windows/git/commit/3b2f716bd8).\n> (...)\n> What do you think? Should we just fold the RUNTIME_PREFIX_PERL handling\n> into RUNTIME_PREFIX and be done with that part?\n> (...)\n> As I mentioned in the mail I just finished and sent (I started it hours\n> ago, but then got busy with other things while the builds were running): I\n> am totally cool with changing this on Windows, too. Should simplify\n> things, right?\n\nNo objections here. I see it as adding slightly more risk to this patch's\npotential impact on Windows builds, but if Git-for-Windows is okay with that,\nI'll go ahead and fold RUNTIME_PREFIX_PERL into RUNTIME_PREFIX for\nsimplicity's sake.\n\nI'll add a \"NO_RUNTIME_PREFIX_PERL\" flag as per avarab@'s suggestion as a\npotential mitigation if a problem does end up arising in Windows builds,\nwith a note that NO_RUNTIME_PREFIX_PERL can be deleted if everything seems\nto be working. What do you think?\n\n> BTW I managed to run your `runtime-prefix` branch through VSTS builds on\n> Windows, macOS and Linux and they all pass the test suite. (Including the\n> RUNTIME_PREFIX_PERL=YesPlease setting you added for Travis CI testing.)\n\nGreat news, thanks for doing this!\n"},{"id":"336210","messageId":"877essatef.fsf@evledraar.gmail.com","threadId":"47563","inReplyTo":"20180108220550.66256-1-dnj@google.com","subject":"Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-01-08T22:16:08Z","receivedAt":"2018-01-08T22:16:17Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Jan 08 2018, Dan Jacques jotted:\n\n> On 2018-01-08 20:27, Johannes Schindelin wrote:\n>\n>> > Maybe we covered this in previous submissions, but refresh my memory,\n>> > why is the *_PERL define still needed? Reading this explanation doesn't\n>> > make sense to me, but I'm probably missing something.\n>>\n>> If the reason is to accommodate Windows, I think it'd make more sense to\n>> change the way Git for Windows handles this, and use the same relative\n>> paths (if possible, that is, see the GITPERLLIB problems I mentioned\n>> elsewhere and which necessitated\n>> https://github.com/git-for-windows/git/commit/3b2f716bd8).\n>> (...)\n>> What do you think? Should we just fold the RUNTIME_PREFIX_PERL handling\n>> into RUNTIME_PREFIX and be done with that part?\n>> (...)\n>> As I mentioned in the mail I just finished and sent (I started it hours\n>> ago, but then got busy with other things while the builds were running): I\n>> am totally cool with changing this on Windows, too. Should simplify\n>> things, right?\n>\n> No objections here. I see it as adding slightly more risk to this patch's\n> potential impact on Windows builds, but if Git-for-Windows is okay with that,\n> I'll go ahead and fold RUNTIME_PREFIX_PERL into RUNTIME_PREFIX for\n> simplicity's sake.\n>\n> I'll add a \"NO_RUNTIME_PREFIX_PERL\" flag as per avarab@'s suggestion as a\n> potential mitigation if a problem does end up arising in Windows builds,\n> with a note that NO_RUNTIME_PREFIX_PERL can be deleted if everything seems\n> to be working. What do you think?\n\nTo be clear, I meant that if it's determined by you/others that an\nopt-out on Windows is needed I think it makes sense to make it a NO_*\nflag, but if there's a solution where we can just turn it on for\neverything then ideally we'd just have RUNTIME_PREFIX=YesPlease.\n"},{"id":"336211","messageId":"20180108221813.66805-1-dnj@google.com","threadId":"47563","inReplyTo":"877essatef.fsf@evledraar.gmail.com","subject":"Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support","fromName":"Dan Jacques","fromEmail":"dnj@google.com","sentAt":"2018-01-08T22:18:13Z","receivedAt":"2018-01-08T22:18:27Z","isPatch":true,"sender":{"key":"dnj@google.com","avatar":"https://avatars.githubusercontent.com/u/9965104?v=4"},"body":"On Mon, 08 Jan 2018, Ævar Arnfjörð Bjarmason wrote:\n\n> > I'll add a \"NO_RUNTIME_PREFIX_PERL\" flag as per avarab@'s suggestion as a\n> > potential mitigation if a problem does end up arising in Windows builds,\n> > with a note that NO_RUNTIME_PREFIX_PERL can be deleted if everything seems\n> > to be working. What do you think?\n>\n> To be clear, I meant that if it's determined by you/others that an\n> opt-out on Windows is needed I think it makes sense to make it a NO_*\n> flag, but if there's a solution where we can just turn it on for\n> everything then ideally we'd just have RUNTIME_PREFIX=YesPlease.\n\nOh that's fair. Okay, we'll go all in and just have RUNTIME_PREFIX.\n"}]}