RUNTIME_PREFIX relocatable Git
v6 cover RUNTIME_PREFIX relocatable Git
This patch set expands support for the RUNTIME_PREFIX configuration flag, currently only used on Windows builds, to include Linux, Darwin, and FreeBSD. When Git is built with RUNTIME_PREFIX enabled, it resolves its ancillary paths relative to the runtime location of its executable rather than hard-coding them at compile-time, allowing a Git installation to be deployed to a path other than the one in which it was built/installed.
Note that RUNTIME_PREFIX is not currently used outside of Windows. This patch set should not have an impact on default Git builds.
I'm dusting this back off now that avarab@'s Perl Makefile simplification patch set has landed. It's been a few months, so I'm a bit rusty, but I think that I've incorporated all of the feedback. Please take a look and let me know what you think!
Previous threads:
v1: https://public-inbox.org/git/[email protected]/
v2: https://public-inbox.org/git/[email protected]/
v3: https://public-inbox.org/git/[email protected]/
v4: https://public-inbox.org/git/[email protected]/
v5: https://public-inbox.org/git/[email protected]/
Changes in v6 from v5:
- Rebased on top of "master".
- Updated commit messages.
- Updated runtime prefix Perl header comment and code to clarify when and why FindBin is used.
- With Johannes' blessing on Git-for-Windows, folded "RUNTIME_PREFIX_PERL" functionality into "RUNTIME_PREFIX".
- Updated "run-command" test to accommodate RUNTIME_PREFIX trace messages.
=== Testing ===
The latest patch set is available for testing on my GitHub fork, including "travis.ci" testing. The "runtime-prefix" branch includes a "config.mak" commit that enables runtime prefix for the Travis build; the "runtime-prefix-no-config" omits this file, testing this patch without runtime prefix enabled:
- https://github.com/danjacques/git/tree/runtime-prefix
- https://github.com/danjacques/git/tree/runtime-prefix-no-config
- https://travis-ci.org/danjacques/git/branches
Built/tested locally using this "config.mak" w/ autoconf:
=== Example config.mak ===
## (BEGIN config.mak)
RUNTIME_PREFIX = YesPleaseRUNTIME_PREFIX_PERL = YesPlease
gitexecdir = libexec/git-coretemplate_dir = share/git-core/templates
sysconfdir = etc
## (END config.mak)
=== Revision History ===
Changes in v5 from v4:
- Rebase on top of "next", notably incorporating the "ab/simplify-perl-makefile" branch.
- Cleaner Makefile relative path enforcement.
- Update Perl header template path now that the "perl/" directory has fewer build-related files in it.
- Update Perl runtime prefix header to use a general system path resolution function.
- Implemented the injection of the locale directory into Perl's "Git/I18N.pm" module from the runtime prefix Perl script header.
- Updated Perl's "Git/I18N.pm" module to accept injected locale directory.
- Added more content to some comments.
Changes in v4 from v3:
- Incorporated some quoting and Makefile dependency fixes, courtesy of <[email protected]>.
Changes in v3 from v2:
- Broken into multiple patches now that Perl is isolated in its own RUNTIME_PREFIX_PERL flag.
- Working with avarab@, several changes to Perl script runtime prefix support:
- Moved Perl header body content from Makefile into external template
file(s).
- Added generic "perllibdir" variable to override Perl installation path.
- RUNTIME_PREFIX_PERL generated script header is more descriptive and consistent with how the C version operates.
- Fixed Generated Perl header Makefile dependency, should rebuild when dependent files and flags change.
- Changed some of the new RUNTIME_PREFIX trace strings to use consistent formatting and terminology.
Changes in v2 from v1:
- Added comments and formatting to improve readability of platform-sepecific executable path resolution sleds in git_get_exec_path.
- Consolidated "cached_exec_path" and "argv_exec_path" globals into "exec_path_value".
- Use strbuf_realpath instead of realpath for procfs resolution.
- Removed new environment variable exports. Git with RUNTIME_PREFIX no longer exports or consumes any additional environment information.
- Updated Perl script resolution strategy: rather than having Git export the relative executable path to the Perl scripts, they now resolve it independently when RUNTIME_PREFIX_PERL is enabled.
- Updated resolution strategy for "gettext()": use system_path() instead of special environment variable.
- Added sysctl executable resolution support for BSDs that don't mount "procfs" by default (most of them).
Dan Jacques (3):
Makefile: generate Perl header from template file
Makefile: add Perl runtime prefix support
exec_cmd: RUNTIME_PREFIX on some POSIX systems
.gitignore | 1 + Makefile | 120 +++++++++-- cache.h | 1 + common-main.c | 4 +- config.mak.uname | 7 + exec_cmd.c | 241 ++++++++++++++++++++--- exec_cmd.h | 4 +- gettext.c | 8 +- git.c | 2 +- perl/Git/I18N.pm | 2 +- perl/header_templates/fixed_prefix.template.pl | 1 + perl/header_templates/runtime_prefix.template.pl | 40 ++++ t/t0061-run-command.sh | 2 +- 13 files changed, 379 insertions(+), 54 deletions(-) create mode 100644 perl/header_templates/fixed_prefix.template.pl create mode 100644 perl/header_templates/runtime_prefix.template.pl
Signature · 1 line
2.15.0.chromium12
PATCH v6 1/3 Makefile: generate Perl header from template file
Currently, the generated Perl script headers are emitted by commands in the Makefile. This mechanism restricts options to introduce alternative header content, needed by Perl runtime prefix support, and obscures the origin of the Perl script header.
Change the Makefile to generate a header by processing a template file and move the header content into the "perl/" subdirectory. The processed generated will now be stored in the "GIT-PERL-HEADER" file. This allows the content of the Perl header to be controlled by changing the path of the template in the Makefile.
Thanks-to: Ævar Arnfjörð Bjarmason <[email protected]>
Thanks-to: Johannes Schindelin <[email protected]>
--- .gitignore | 1 + Makefile | 27 +++++++++++++++----------- perl/header_templates/fixed_prefix.template.pl | 1 + 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 perl/header_templates/fixed_prefix.template.pl
.gitignore +1 -0
@@ -3,6 +3,7 @@ /GIT-LDFLAGS /GIT-PREFIX /GIT-PERL-DEFINES +/GIT-PERL-HEADER /GIT-PYTHON-VARS /GIT-SCRIPT-DEFINES /GIT-USER-AGENT
Makefile +16 -11
@@ -1975,20 +1975,15 @@ git.res: git.rc GIT-VERSION-FILE $(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS ifndef NO_PERL -$(SCRIPT_PERL_GEN): - +PERL_HEADER_TEMPLATE = perl/header_templates/fixed_prefix.template.pl PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ):$(perllibdir_SQ) -$(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-VERSION-FILE + +$(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE $(QUIET_GEN)$(RM) $@ $@+ && \ - INSTLIBDIR='$(perllibdir_SQ)' && \ - INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \ - INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \ sed -e '1{' \ -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ - -e ' h' \ - -e ' s=.*=use lib (split(/$(pathsep)/, $$ENV{GITPERLLIB} || "'"$$INSTLIBDIR"'"));=' \ - -e ' H' \ - -e ' x' \ + -e ' rGIT-PERL-HEADER' \ + -e ' G' \ -e '}' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ $< >$@+ && \
@@ -2002,6 +1997,16 @@ GIT-PERL-DEFINES: FORCE echo "$$FLAGS" >$@; \ fi +GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile + $(QUIET_GEN)$(RM) $@ && \ + INSTLIBDIR='$(perllibdir_SQ)' && \ + INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \ + INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \ + sed -e 's=@@PATHSEP@@=$(pathsep)=g' \ + -e 's=@@INSTLIBDIR@@='$$INSTLIBDIR'=g' \ + -e 's=@@PERLLIBDIR@@='$(perllibdir_SQ)'=g' \ + $< >$@+ && \ + mv $@+ $@ .PHONY: gitweb gitweb:
@@ -2770,7 +2775,7 @@ ifndef NO_TCLTK endif $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-BUILD-OPTIONS $(RM) GIT-USER-AGENT GIT-PREFIX - $(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PYTHON-VARS + $(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS .PHONY: all install profile-clean clean strip .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
perl/header_templates/fixed_prefix.template.pl new file +1 -0
@@ -0,0 +1 @@ +use lib (split(/@@PATHSEP@@/, $ENV{GITPERLLIB} || '@@INSTLIBDIR@@'));
Signature · 1 line
2.15.0.chromium12
Re: [PATCH v6 1/3] Makefile: generate Perl header from template file
Quoted 8 lines · Dan Jacques
Currently, the generated Perl script headers are emitted by commands in the
Makefile. This mechanism restricts options to introduce alternative header content, needed by Perl runtime prefix support, and obscures the origin of the Perl script header.Change the
Makefileto generate a header by processing a template file and move the header content into the "perl/" subdirectory. The processed generated will now be stored in the "GIT-PERL-HEADER" file. This allows
"processed generated"?
Quoted 4 lines
the content of the Perl header to be controlled by changing the path of the template in the
Makefile.Signed-off-by Dan Jacques <[email protected]>
PATCH v6 2/3 Makefile: add Perl runtime prefix support
In reply to Dan JacquesAdd a new Makefile flag, RUNTIME_PREFIX_PERL, which, when enabled, configures Perl scripts to locate the Git installation's Perl support libraries by resolving against the script's path, rather than hard-coding that path at build-time.
RUNTIME_PREFIX_PERL requires that system paths are expressed relative to a common installation directory, and uses that relationship to locate support files based on the known starting point of the script being executed, much like RUNTIME_PREFIX does for the Git binary.
This change enables Git's Perl scripts to work when their Git installation is relocated or moved to another system.
Thanks-to: Ævar Arnfjörð Bjarmason <[email protected]>
Thanks-to: Johannes Schindelin <[email protected]>
--- Makefile | 67 +++++++++++++++++++++++- perl/Git/I18N.pm | 2 +- perl/header_templates/runtime_prefix.template.pl | 40 ++++++++++++++ 3 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 perl/header_templates/runtime_prefix.template.pl
Makefile +66 -1
@@ -434,6 +434,13 @@ all:: # # When cross-compiling, define HOST_CPU as the canonical name of the CPU on # which the built Git will run (for instance "x86_64"). +# +# Define RUNTIME_PREFIX to configure Git to resolve its ancillary tooling and +# support files relative to the location of the runtime binary, rather than +# hard-coding them into the binary. Git installations built with RUNTIME_PREFIX +# can be moved to arbitrary filesystem locations. RUNTIME_PREFIX also causes +# Perl scripts to use a modified entry point header allowing them to resolve +# support files at runtime. GIT-VERSION-FILE: FORCE @$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -471,6 +478,8 @@ ARFLAGS = rcs # mandir # infodir # htmldir +# localedir +# perllibdir # This can help installing the suite in a relocatable way. prefix = $(HOME)
@@ -492,9 +501,12 @@ lib = lib # DESTDIR = pathsep = : +gitexecdir_relative = $(patsubst $(prefix)/%,%,$(gitexecdir)) mandir_relative = $(patsubst $(prefix)/%,%,$(mandir)) infodir_relative = $(patsubst $(prefix)/%,%,$(infodir)) +localedir_relative = $(patsubst $(prefix)/%,%,$(localedir)) htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir)) +perllibdir_relative = $(patsubst $(prefix)/%,%,$(perllibdir)) export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir
@@ -1740,10 +1752,13 @@ mandir_relative_SQ = $(subst ','\'',$(mandir_relative)) infodir_relative_SQ = $(subst ','\'',$(infodir_relative)) perllibdir_SQ = $(subst ','\'',$(perllibdir)) localedir_SQ = $(subst ','\'',$(localedir)) +localedir_relative_SQ = $(subst ','\'',$(localedir_relative)) gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) +gitexecdir_relative_SQ = $(subst ','\'',$(gitexecdir_relative)) template_dir_SQ = $(subst ','\'',$(template_dir)) htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative)) prefix_SQ = $(subst ','\'',$(prefix)) +perllibdir_relative_SQ = $(subst ','\'',$(perllibdir_relative)) gitwebdir_SQ = $(subst ','\'',$(gitwebdir)) SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
@@ -1754,6 +1769,31 @@ TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) DIFF_SQ = $(subst ','\'',$(DIFF)) PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA)) +# RUNTIME_PREFIX's resolution logic requires resource paths to be expressed +# relative to each other and share an installation path. +# +# This is a dependnecy in: +# - Git's binary RUNTIME_PREFIX logic in (see "exec_cmd.c"). +# - The runtime prefix Perl header (see +# "perl/header_templates/runtime_prefix.template.pl"). +ifdef RUNTIME_PREFIX + +ifneq ($(filter /%,$(firstword $(gitexecdir_relative))),) +$(error RUNTIME_PREFIX requires a relative gitexecdir, not: $(gitexecdir)) +endif + +ifneq ($(filter /%,$(firstword $(localedir_relative))),) +$(error RUNTIME_PREFIX requires a relative localedir, not: $(localedir)) +endif + +ifndef NO_PERL +ifneq ($(filter /%,$(firstword $(perllibdir_relative))),) +$(error RUNTIME_PREFIX requires a relative perllibdir, not: $(perllibdir)) +endif +endif + +endif + # We must filter out any object files from $(GITLIBS), # as it is typically used like: #
@@ -1974,10 +2014,31 @@ git.res: git.rc GIT-VERSION-FILE # This makes sure we depend on the NO_PERL setting itself. $(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS +# Used for substitution in Perl modules. Disabled when using RUNTIME_PREFIX +# since the locale directory is injected. +perl_localedir_SQ = $(localedir_SQ) + ifndef NO_PERL PERL_HEADER_TEMPLATE = perl/header_templates/fixed_prefix.template.pl PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ):$(perllibdir_SQ) +PERL_DEFINES := $(PERL_PATH_SQ) $(PERLLIB_EXTRA_SQ) $(perllibdir_SQ) +PERL_DEFINES += $(RUNTIME_PREFIX) + +# Support Perl runtime prefix. In this mode, a different header is installed +# into Perl scripts. +ifdef RUNTIME_PREFIX + +PERL_HEADER_TEMPLATE = perl/header_templates/runtime_prefix.template.pl + +# Don't export a fixed $(localedir) path; it will be resolved by the Perl header +# at runtime. +perl_localedir_SQ = + +endif + +PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir) + $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE $(QUIET_GEN)$(RM) $@ $@+ && \ sed -e '1{' \
@@ -1990,6 +2051,7 @@ $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE chmod +x $@+ && \ mv $@+ $@ +PERL_DEFINES := $(subst $(space),:,$(PERL_DEFINES)) GIT-PERL-DEFINES: FORCE @FLAGS='$(PERL_DEFINES)'; \ if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
@@ -2005,6 +2067,9 @@ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile sed -e 's=@@PATHSEP@@=$(pathsep)=g' \ -e 's=@@INSTLIBDIR@@='$$INSTLIBDIR'=g' \ -e 's=@@PERLLIBDIR@@='$(perllibdir_SQ)'=g' \ + -e 's=@@PERLLIBDIR_REL@@=$(perllibdir_relative_SQ)=g' \ + -e 's=@@GITEXECDIR_REL@@=$(gitexecdir_relative_SQ)=g' \ + -e 's=@@LOCALEDIR_REL@@=$(localedir_relative_SQ)=g' \ $< >$@+ && \ mv $@+ $@
@@ -2328,7 +2393,7 @@ endif perl/build/lib/%.pm: perl/%.pm $(QUIET_GEN)mkdir -p $(dir $@) && \ - sed -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \ + sed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \ -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \ < $< > $@
perl/Git/I18N.pm +1 -1
@@ -18,7 +18,7 @@ our @EXPORT_OK = @EXPORT; sub __bootstrap_locale_messages { our $TEXTDOMAIN = 'git'; - our $TEXTDOMAINDIR = $ENV{GIT_TEXTDOMAINDIR} || '@@LOCALEDIR@@'; + our $TEXTDOMAINDIR ||= $ENV{GIT_TEXTDOMAINDIR} || '@@LOCALEDIR@@'; require POSIX; POSIX->import(qw(setlocale));
perl/header_templates/runtime_prefix.template.pl new file +40 -0
@@ -0,0 +1,40 @@ +# BEGIN RUNTIME_PREFIX generated code. +# +# This finds our Git::* libraries relative to the script's runtime path. +sub __git_system_path { + my ($relpath) = @_; + my $gitexecdir_relative = '@@GITEXECDIR_REL@@'; + + # GIT_EXEC_PATH is supplied by `git` or the test suite. + my $exec_path = $ENV{GIT_EXEC_PATH}; + if ($exec_path eq "") { + # This can happen if this script is being directly invoked instead of run + # by "git". + require FindBin; + $exec_path = $FindBin::Bin; + } + + # Trim off the relative gitexecdir path to get the system path. + (my $prefix = $exec_path) =~ s=${gitexecdir_relative}$==; + + require File::Spec; + return File::Spec->catdir($prefix, $relpath); +} + +BEGIN { + use lib split /@@PATHSEP@@/, + ( + $ENV{GITPERLLIB} || + do { + my $perllibdir = __git_system_path('@@PERLLIBDIR_REL@@'); + (-e $perllibdir) || die("Invalid system path ($relpath): $path"); + $perllibdir; + } + ); + + # Export the system locale directory to the I18N module. The locale directory + # is only installed if NO_GETTEXT is set. + $Git::I18N::TEXTDOMAINDIR = __git_system_path('@@LOCALEDIR_REL@@'); +} + +# END RUNTIME_PREFIX generated code.
Signature · 1 line
2.15.0.chromium12
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
Makefile TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) · line 1775
Quoted 4 lines · Dan Jacques
Makefile +4
-0+# RUNTIME_PREFIX's resolution logic requires resource paths to be expressed +# relative to each other and share an installation path. +# +# This is a dependnecy in:
dependency?
Makefile TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) · line 1783
Quoted 8 lines
Makefile +8
-0+# - Git's binary RUNTIME_PREFIX logic in (see "exec_cmd.c"). +# - The runtime prefix Perl header (see +# "perl/header_templates/runtime_prefix.template.pl"). +ifdef RUNTIME_PREFIX + +ifneq ($(filter /%,$(firstword $(gitexecdir_relative))),) +$(error RUNTIME_PREFIX requires a relative gitexecdir, not: $(gitexecdir)) +endif
I see Dscho is CC'ed so I won't worry about "is there a more portable test than 'the path begins with a slash' to see if a path is relative, or is this good enough even for Windows in the context of this patch?". It won't be a show-stopper issue as long as we do not error out with false positive, though ;-).
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
Quoted 1 line · Junio C Hamano
Quoted 1 line
+# RUNTIME_PREFIX's resolution logic requires resource paths to be
expressed
Quoted 5 lines
Makefile TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) · line 1775
Quoted 3 lines
Makefile +3
-0+# relative to each other and share an installation path. +# +# This is a dependnecy in:dependency?
Oops, this is the second typo that has been pointed out. I'll release one last series after a small review period with these fixed.
Quoted 7 lines
Makefile TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
Quoted 7 lines
Makefile +7
-0+# - Git's binary RUNTIME_PREFIX logic in (see "exec_cmd.c"). +# - The runtime prefix Perl header (see +# "perl/header_templates/runtime_prefix.template.pl"). +ifdef RUNTIME_PREFIX + +ifneq ($(filter /%,$(firstword $(gitexecdir_relative))),) +$(error RUNTIME_PREFIX requires a relative gitexecdir, not:
$(gitexecdir))
Quoted 7 lines
Quoted 1 line
+endif
I see Dscho is CC'ed so I won't worry about "is there a more portable test than 'the path begins with a slash' to see if a path is relative, or is this good enough even for Windows in the context of this patch?". It won't be a show-stopper issue as long as we do not error out with false positive, though ;-).
OK sounds good! There are other places in the Makefile that use this method for this purpose, so hopefully the worst-case is that this is no more broken than they are.
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
In reply to Dan JacquesOn Mon, Mar 19 2018, Dan Jacques jotted:
Makefile lib = lib · line 509
Quoted 6 lines
Makefile +3
-0+gitexecdir_relative = $(patsubst $(prefix)/%,%,$(gitexecdir)) mandir_relative = $(patsubst $(prefix)/%,%,$(mandir)) infodir_relative = $(patsubst $(prefix)/%,%,$(infodir)) +localedir_relative = $(patsubst $(prefix)/%,%,$(localedir)) htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir)) +perllibdir_relative = $(patsubst $(prefix)/%,%,$(perllibdir))
I stole a small part of this for my a4d79b99a0 ("Makefile: add a gitexecdir_relative variable", 2018-03-13) patch now sitting in next, if you do this:
diff --git a/Makefile b/Makefile
index 101a98a783..033a55505e 100644
--- a/Makefile
+++ b/Makefile
@@ -501,9 +501,9 @@ lib = lib
# DESTDIR =
pathsep = :
-gitexecdir_relative = $(patsubst $(prefix)/%,%,$(gitexecdir))
mandir_relative = $(patsubst $(prefix)/%,%,$(mandir))
infodir_relative = $(patsubst $(prefix)/%,%,$(infodir))
+gitexecdir_relative = $(patsubst $(prefix)/%,%,$(gitexecdir))
localedir_relative = $(patsubst $(prefix)/%,%,$(localedir))
htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))
perllibdir_relative = $(patsubst $(prefix)/%,%,$(perllibdir))The merge conflict becomes a tad easier to deal with, also makes sense to have gitexecdir after infodir since that's the order we're listing these in just a few lines earlier, and this is otherwise (mostly) consistent.
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
Quoted 4 lines · Ævar Arnfjörð Bjarmason
The merge conflict becomes a tad easier to deal with, also makes sense to have gitexecdir after infodir since that's the order we're listing these in just a few lines earlier, and this is otherwise (mostly) consistent.
Got it, I'll update my patch set to include this in v7, which I'll post after a little more time for comment on v6. Thanks!
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
Quoted 4 lines
Quoted 4 lines
The merge conflict becomes a tad easier to deal with, also makes sense to have gitexecdir after infodir since that's the order we're listing these in just a few lines earlier, and this is otherwise (mostly) consistent.
Actually as a quick follow-up question: for these patch sets, is it best for me to have them based off of "master", "next", or a different branch?
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
Quoted 7 lines · Daniel Jacques
Quoted 4 lines
Quoted 4 lines
The merge conflict becomes a tad easier to deal with, also makes sense to have gitexecdir after infodir since that's the order we're listing these in just a few lines earlier, and this is otherwise (mostly) consistent.
Actually as a quick follow-up question: for these patch sets, is it best for me to have them based off of "master", "next", or a different branch?
When you are cooperating with somebody else, e.g. in this case you are planning your changes to work well with the ab/install-symlinks topic, there are three choices, I think.
(1) Build your topic on 'master'. From time to time (and especially before sending it out to the list), do a trial merge of your topic to 'master', 'next' and 'pu' to see how badly it interacts with the other topic.
If the conflicts are not too bad, and if it makes sense for your topic to graduate without the other topic being in 'master', then this is the preferrable approach.
(2) Build your topic on top of the other's topic. When the other branch gets updated (either by rerolling if it is not yet on 'next', or by adding a follow up commit), you may need to rebase before sending an update.
As long as you can live without new stuff added to 'master' since the other's topic forked from 'master', this is probably the second best option. It definitely is worse than (1) as you'd need to rebase on top of other's work, which will become impossible once your topic hits 'next'.
(3) Make a merge of the other's topic into 'master', and then build your topic on top of the result. Keep the updates from the other's topic to the minimum once you start working on your topic to simplify the task to update your topic. From time to time, do a trial merge to 'master', 'next' and 'pu' to ensure you are compatible with the updates made to the other's topic since you forked from them.
As long as the other's topic is already fairly stable, and if you need to depend on new stuff added to 'master' since the other's topic forked from 'master', this is a workable approach.
I suspect that (1) is fine in this case. As to the reordering of gitexecdir_relative thing Ævar mentioned, I agree that such a change is good because the order of the lines in the result makes more sense.
Thanks.
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
In reply to Dan JacquesOn Mon, Mar 19 2018, Dan Jacques jotted:
Quoted 5 lines
perl/header_templates/runtime_prefix.template.pl new file +5
-0+# BEGIN RUNTIME_PREFIX generated code. +# +# This finds our Git::* libraries relative to the script's runtime path. +sub __git_system_path { + my ($relpath) = @_;
perl/header_templates/runtime_prefix.template.pl line 15
Quoted 10 lines
perl/header_templates/runtime_prefix.template.pl new file +10
-0+ my $gitexecdir_relative = '@@GITEXECDIR_REL@@'; + + # GIT_EXEC_PATH is supplied by `git` or the test suite. + my $exec_path = $ENV{GIT_EXEC_PATH}; + if ($exec_path eq "") { + # This can happen if this script is being directly invoked instead of run + # by "git". + require FindBin; + $exec_path = $FindBin::Bin; + }
I think it would be more idiomatic and more paranoid (we'll catch bugs) to do:
my $exec_path;
if (exists $ENV{GIT_EXEC_PATH}) {
$exec_path = $ENV{GIT_EXEC_PATH};
} else {
[...]
}I.e. we're interested if we got passed GIT_EXEC_PATH, so let's see if it exists in the env hash, and then use it as-is. If we have some bug where it's an empty string we'd like to know, presumably...
perl/header_templates/runtime_prefix.template.pl line 18
Quoted 3 lines
perl/header_templates/runtime_prefix.template.pl new file +3
-0+ + # Trim off the relative gitexecdir path to get the system path. + (my $prefix = $exec_path) =~ s=${gitexecdir_relative}$==;
The path could contain regex metacharacters, so let's quote those via:
(my $prefix = $exec_path) =~ s/\Q$gitexecdir_relative\E$//;
This also nicely gets us rid of the more verbose ${} form, which makes esnse when we're doing ${foo}$ instead of the arguably less readbale $foo$, but when it's \Q$foo\E$ it's clear what's going on.
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
Quoted 10 lines · Ævar Arnfjörð Bjarmason
I think it would be more idiomatic and more paranoid (we'll catch bugs) to do:
my $exec_path; if (exists $ENV{GIT_EXEC_PATH}) { $exec_path = $ENV{GIT_EXEC_PATH}; } else { [...] }
Quoted 3 lines
I.e. we're interested if we got passed
GIT_EXEC_PATH, so let's see if it exists in the env hash, and then use it as-is. If we have some bug where it's an empty string we'd like to know, presumably...
Good idea, done.
Quoted 11 lines
perl/header_templates/runtime_prefix.template.pl line 18
Quoted 3 lines
perl/header_templates/runtime_prefix.template.pl new file +3
-0+ + # Trim off the relative gitexecdir path to get the system path. + (my $prefix = $exec_path) =~ s=${gitexecdir_relative}$==;The path could contain regex metacharacters, so let's quote those via:
(my $prefix = $exec_path) =~ s/\Q$gitexecdir_relative\E$//;This also nicely gets us rid of the more verbose ${} form, which makes esnse when we're doing ${foo}$ instead of the arguably less readbale $foo$, but when it's \Q$foo\E$ it's clear what's going on.
Ah cool - makes sense. I'm not strong with Perl, so I wasn't aware that this was an option, but I agree it's cleaner. Done.
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
In reply to Dan JacquesQuoted 6 lines · Dan Jacques
Add a new
Makefileflag,RUNTIME_PREFIX_PERL, which, when enabled, configures Perl scripts to locate the Git installation's Perl support libraries by resolving against the script's path, rather than hard-coding that path at build-time.
RUNTIME_PREFIX_PERLrequires that system paths are expressed relative to
This commit message mentions RUNTIME_PREFIX_PERL twice, but there is no use of RUNTIME_PREFIX_PERL in the actual diffs (patches 1-3/3). Should it be s/_PERL//? Your cover letter hints as much under "Changes in v6 from v5". And "Add a new Makefile flag ..." would need some more rewriting since this patch rather expands the scope of the existing flag?
Quoted 3 lines
a common installation directory, and uses that relationship to locate support files based on the known starting point of the script being executed, much like
RUNTIME_PREFIXdoes for the Git binary.
With s/_PERL//, this part above reads a bit odd. Would this be s/RUNTIME_PREFIX/it/?
Martin
Re: [PATCH v6 2/3] Makefile: add Perl runtime prefix support
Quoted 6 lines · Martin Ågren
This commit message mentions
RUNTIME_PREFIX_PERLtwice, but there is no use ofRUNTIME_PREFIX_PERLin the actual diffs (patches 1-3/3). Should it be s/_PERL//? Your cover letter hints as much under "Changes in v6 from v5". And "Add a newMakefileflag ..." would need some more rewriting since this patch rather expands the scope of the existing flag?
Thanks for pointing this out - the two were separate flags in my original patch set because I
wanted to minimize the scope of impact; however, I have since received advice and buy-in
on converging them and RUNTIME_PREFIX_PERL functionality was merged underneath
of RUNTIME_PREFIX in this latest patch set.
I'll update the commit message!
PATCH v6 3/3 exec_cmd: RUNTIME_PREFIX on some POSIX systems
In reply to Dan JacquesEnable Git to resolve its own binary location using a variety of OS-specific and generic methods, including:
- procfs via "/proc/self/exe" (Linux)
- _NSGetExecutablePath (Darwin)
- KERN_PROC_PATHNAME sysctl on BSDs.
- argv0, if absolute (all, including Windows).
This is used to enable RUNTIME_PREFIX support for non-Windows systems, notably Linux and Darwin. When configured with RUNTIME_PREFIX, Git will do a best-effort resolution of its executable path and automatically use this as its "exec_path" for relative helper and data lookups, unless explicitly overridden.
Small incidental formatting cleanup of "exec_cmd.c".
Thanks-to: Robbie Iannucci <[email protected]>
Thanks-to: Junio C Hamano <[email protected]>
--- Makefile | 26 +++++- cache.h | 1 + common-main.c | 4 +- config.mak.uname | 7 ++ exec_cmd.c | 241 ++++++++++++++++++++++++++++++++++++++++++------- exec_cmd.h | 4 +- gettext.c | 8 +- git.c | 2 +- t/t0061-run-command.sh | 2 +- 9 files changed, 254 insertions(+), 41 deletions(-)
Makefile +25 -1
@@ -418,6 +418,16 @@ all:: # # Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function. # +# Define HAVE_BSD_KERN_PROC_SYSCTL if your platform supports the KERN_PROC BSD +# sysctl function. +# +# Define PROCFS_EXECUTABLE_PATH if your platform mounts a "procfs" filesystem +# capable of resolving the path of the current executable. If defined, this +# must be the canonical path for the "procfs" current executable path. +# +# Define HAVE_NS_GET_EXECUTABLE_PATH if your platform supports calling +# _NSGetExecutablePath to retrieve the path of the running executable. +# # Define HAVE_GETDELIM if your system has the getdelim() function. # # Define PAGER_ENV to a SP separated VAR=VAL pairs to define
@@ -1664,10 +1674,23 @@ ifdef HAVE_BSD_SYSCTL BASIC_CFLAGS += -DHAVE_BSD_SYSCTL endif +ifdef HAVE_BSD_KERN_PROC_SYSCTL + BASIC_CFLAGS += -DHAVE_BSD_KERN_PROC_SYSCTL +endif + ifdef HAVE_GETDELIM BASIC_CFLAGS += -DHAVE_GETDELIM endif +ifneq ($(PROCFS_EXECUTABLE_PATH),) + procfs_executable_path_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH)) + BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(procfs_executable_path_SQ)"' +endif + +ifdef HAVE_NS_GET_EXECUTABLE_PATH + BASIC_CFLAGS += -DHAVE_NS_GET_EXECUTABLE_PATH +endif + ifeq ($(TCLTK_PATH),) NO_TCLTK = NoThanks endif
@@ -2216,6 +2239,7 @@ endif exec_cmd.sp exec_cmd.s exec_cmd.o: GIT-PREFIX exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \ '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \ + '-DGIT_LOCALE_PATH="$(localedir_relative_SQ)"' \ '-DBINDIR="$(bindir_relative_SQ)"' \ '-DPREFIX="$(prefix_SQ)"'
@@ -2233,7 +2257,7 @@ attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \ gettext.sp gettext.s gettext.o: GIT-PREFIX gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \ - -DGIT_LOCALE_PATH='"$(localedir_SQ)"' + -DGIT_LOCALE_PATH='"$(localedir_relative_SQ)"' http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \ -DCURL_DISABLE_TYPECHECK
cache.h +1 -0
@@ -428,6 +428,7 @@ static inline enum object_type object_type(unsigned int mode)#define GIT_ICASE_PATHSPECS_ENVIRONMENT "GIT_ICASE_PATHSPECS"#define GIT_QUARANTINE_ENVIRONMENT "GIT_QUARANTINE_PATH"#define GIT_OPTIONAL_LOCKS_ENVIRONMENT "GIT_OPTIONAL_LOCKS" +#define GIT_TEXT_DOMAIN_DIR_ENVIRONMENT "GIT_TEXTDOMAINDIR"/* * Environment variable used in handshaking the wire protocol.
common-main.c +2 -2
@@ -32,12 +32,12 @@ int main(int argc, const char **argv)*/ sanitize_stdfds (); +git_resolve_executable_dir (argv[0 ]); +git_setup_gettext ();attr_start (); -git_extract_argv0_path (argv[0 ]); -restore_sigpipe_to_default ();return cmd_main (argc, argv);
config.mak.uname +7 -0
@@ -37,6 +37,7 @@ ifeq ($(uname_S),Linux) HAVE_GETDELIM = YesPlease SANE_TEXT_GREP=-a FREAD_READS_DIRECTORIES = UnfortunatelyYes + PROCFS_EXECUTABLE_PATH = /proc/self/exe endif ifeq ($(uname_S),GNU/kFreeBSD) HAVE_ALLOCA_H = YesPlease
@@ -111,6 +112,7 @@ ifeq ($(uname_S),Darwin) BASIC_CFLAGS += -DPROTECT_HFS_DEFAULT=1 HAVE_BSD_SYSCTL = YesPlease FREAD_READS_DIRECTORIES = UnfortunatelyYes + HAVE_NS_GET_EXECUTABLE_PATH = YesPlease endif ifeq ($(uname_S),SunOS) NEEDS_SOCKET = YesPlease
@@ -205,6 +207,7 @@ ifeq ($(uname_S),FreeBSD) HAVE_PATHS_H = YesPlease GMTIME_UNRELIABLE_ERRORS = UnfortunatelyYes HAVE_BSD_SYSCTL = YesPlease + HAVE_BSD_KERN_PROC_SYSCTL = YesPlease PAGER_ENV = LESS=FRX LV=-c MORE=FRX FREAD_READS_DIRECTORIES = UnfortunatelyYes endif
@@ -217,6 +220,8 @@ ifeq ($(uname_S),OpenBSD) BASIC_LDFLAGS += -L/usr/local/lib HAVE_PATHS_H = YesPlease HAVE_BSD_SYSCTL = YesPlease + HAVE_BSD_KERN_PROC_SYSCTL = YesPlease + PROCFS_EXECUTABLE_PATH = /proc/curproc/file endif ifeq ($(uname_S),MirBSD) NO_STRCASESTR = YesPlease
@@ -235,6 +240,8 @@ ifeq ($(uname_S),NetBSD) USE_ST_TIMESPEC = YesPlease HAVE_PATHS_H = YesPlease HAVE_BSD_SYSCTL = YesPlease + HAVE_BSD_KERN_PROC_SYSCTL = YesPlease + PROCFS_EXECUTABLE_PATH = /proc/curproc/exe endif ifeq ($(uname_S),AIX) DEFAULT_PAGER = more
exec_cmd.c +210 -31
320 lines not on this page · raw message
exec_cmd.h +2 -2
@@ -3,8 +3,8 @@struct argv_array ; -extern void git_set_argv_exec_path (const char *exec_path); -extern void git_extract_argv0_path (const char *path); +extern void git_set_exec_path (const char *exec_path); +extern void git_resolve_executable_dir (const char *path);extern const char *git_exec_path (void );extern void setup_path (void );extern const char **prepare_git_cmd (struct argv_array *out,const char **argv);
gettext.c +5 -3
@@ -2,7 +2,8 @@* Copyright (c) 2010 Ævar Arnfjörð Bjarmason */ -#include "git-compat-util.h" +#include "cache.h" +#include "exec_cmd.h" #include "gettext.h" #include "strbuf.h" #include "utf8.h"
@@ -157,10 +158,11 @@ static void init_gettext_charset(const char *domain)void git_setup_gettext (void ) { -const char *podir =getenv ("GIT_TEXTDOMAINDIR" ); +const char *podir =getenv (GIT_TEXT_DOMAIN_DIR_ENVIRONMENT );if (!podir) - podir =GIT_LOCALE_PATH ; + podir =system_path (GIT_LOCALE_PATH ); +bindtextdomain ("git" , podir);setlocale (LC_MESSAGES ,"" );setlocale (LC_TIME ,"" );
git.c +1 -1
@@ -65,7 +65,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)*/ if (skip_prefix (cmd,"--exec-path" , &cmd)) {if (*cmd =='=' ) -git_set_argv_exec_path (cmd +1 ); +git_set_exec_path (cmd +1 );else {puts (git_exec_path ());exit (0 );
t/t0061-run-command.sh +1 -1
@@ -145,7 +145,7 @@ test_trace () { expect="$1" shift GIT_TRACE=1 test-run-command "$@" run-command true 2>&1 >/dev/null | \ - sed 's/.* run_command: //' >actual && + sed -e 's/.* run_command: //' -e '/trace: .*/d' >actual && echo "$expect true" >expect && test_cmp expect actual }
Signature · 1 line
2.15.0.chromium12
Re: [PATCH v6 3/3] exec_cmd: RUNTIME_PREFIX on some POSIX systems
Quoted 14 lines · Dan Jacques
Enable Git to resolve its own binary location using a variety of OS-specific and generic methods, including:
- procfs via "
/proc/self/exe" (Linux)
-_NSGetExecutablePath(Darwin)
-KERN_PROC_PATHNAMEsysctl on BSDs.
- argv0, if absolute (all, including Windows).This is used to enable
RUNTIME_PREFIXsupport for non-Windows systems, notably Linux and Darwin. When configured withRUNTIME_PREFIX, Git will do a best-effort resolution of its executable path and automatically use this as its "exec_path" for relative helper and data lookups, unless explicitly overridden.
Quoted 6 lines
Small incidental formatting cleanup of "
exec_cmd.c".Signed-off-by Dan Jacques <[email protected]>Thanks-to: Robbie Iannucci <[email protected]>
Thanks-to: Junio C Hamano <[email protected]>
---
Look for these misspelled words:
sysetems
applicaton
authoratative
Quoted 8 lines
Makefile +0
-0@@ -418,6 +418,16 @@ all:: # # Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function. #
Makefile all:: · line 430
Quoted 10 lines
Makefile +10
-0+# Define HAVE_BSD_KERN_PROC_SYSCTL if your platform supports the KERN_PROC BSD +# sysctl function. +# +# Define PROCFS_EXECUTABLE_PATH if your platform mounts a "procfs" filesystem +# capable of resolving the path of the current executable. If defined, this +# must be the canonical path for the "procfs" current executable path. +# +# Define HAVE_NS_GET_EXECUTABLE_PATH if your platform supports calling +# _NSGetExecutablePath to retrieve the path of the running executable. +#
Sounds sensible.
Quoted 22 lines
Makefile +10
-5+/** + * Path to the current Git executable. Resolved on startup by + * 'git_resolve_executable_dir'. + */ +static const char *executable_dirname; static const char *system_prefix(void) { static const char *prefix; - assert(argv0_path); - assert(is_absolute_path(argv0_path)); + assert(executable_dirname); + assert(is_absolute_path(executable_dirname)); if (!prefix && - !(prefix = strip_path_suffix(argv0_path, GIT_EXEC_PATH)) && - !(prefix = strip_path_suffix(argv0_path, BINDIR)) && - !(prefix = strip_path_suffix(argv0_path, "git"))) { + !(prefix = strip_path_suffix(executable_dirname, GIT_EXEC_PATH)) && + !(prefix = strip_path_suffix(executable_dirname, BINDIR)) && + !(prefix = strip_path_suffix(executable_dirname, "git"))) {
Makefile all::
Quoted 10 lines
Makefile +3
-2prefix = PREFIX; trace_printf("RUNTIME_PREFIX requested, " - "but prefix computation failed. " - "Using static fallback '%s'.\n", prefix); + "but prefix computation failed. " + "Using static fallback '%s'.\n", + prefix); } return prefix; }
OK. An essentially no-op change but with the name better suited in the extended context---we used to only care about argv0 but that was an implementation detail of "where did our binary come from". Nice.
Re: [PATCH v6 3/3] exec_cmd: RUNTIME_PREFIX on some POSIX systems
Quoted 1 line · Junio C Hamano
Look for these misspelled words:
Oh boy ... thanks, and done.
Quoted 3 lines
OK. An essentially no-op change but with the name better suited in the extended context---we used to only care about argv0 but that was an implementation detail of "where did our binary come from". Nice.
Yes, exactly. Plus I think some other patches that I've seen circulating around here recently use it in this new capacity, so the name update is appropriate.
Re: [PATCH v6 3/3] exec_cmd: RUNTIME_PREFIX on some POSIX systems
In reply to Dan JacquesOn Mon, Mar 19 2018, Dan Jacques jotted:
Quoted 6 lines
#
# DefineHAVE_BSD_SYSCTLif your platform has a BSD-compatible sysctl function. #Makefile +3
-0+# Define HAVE_BSD_KERN_PROC_SYSCTL if your platform supports the KERN_PROC BSD +# sysctl function. +#
Makefile all:: · line 433
Quoted 10 lines
Makefile +7
-0+# Define PROCFS_EXECUTABLE_PATH if your platform mounts a "procfs" filesystem +# capable of resolving the path of the current executable. If defined, this +# must be the canonical path for the "procfs" current executable path. +# +# Define HAVE_NS_GET_EXECUTABLE_PATH if your platform supports calling +# _NSGetExecutablePath to retrieve the path of the running executable. +# # Define HAVE_GETDELIM if your system has the getdelim() function. # # Define PAGER_ENV to a SP separated VAR=VAL pairs to define
This is fine in isolation, but the sum total of the series ends up being:
diff --git a/Makefile b/Makefile
index 96f6138f63..c23d4d10f0 100644
--- a/Makefile
+++ b/Makefile
@@ -425,6 +425,16 @@ all::
#
# Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function. #
+# Define HAVE_BSD_KERN_PROC_SYSCTL if your platform supports the KERN_PROC BSD +# sysctl function.
+#
+# Define PROCFS_EXECUTABLE_PATH if your platform mounts a "procfs" filesystem +# capable of resolving the path of the current executable. If defined, this +# must be the canonical path for the "procfs" current executable path. +#
+# Define HAVE_NS_GET_EXECUTABLE_PATH if your platform supports calling +# _NSGetExecutablePath to retrieve the path of the running executable. +#
# Define HAVE_GETDELIM if your system has the getdelim() function. #
# Define PAGER_ENV to a SP separated VAR=VAL pairs to define
@@ -441,6 +451,13 @@ all::
#
# When cross-compiling, define HOST_CPU as the canonical name of the CPU on # which the built Git will run (for instance "x86_64").
+#
+# Define RUNTIME_PREFIX to configure Git to resolve its ancillary tooling and +# support files relative to the location of the runtime binary, rather than +# hard-coding them into the binary. Git installations built with RUNTIME_PREFIX +# can be moved to arbitrary filesystem locations. RUNTIME_PREFIX also causes +# Perl scripts to use a modified entry point header allowing them to resolve +# support files at runtime.
I wonder if it wouldn't be a lot more understandable if these were noted together, i.e. let's first document RUNTIME_PREFIX, then for all the other ones say below that:
# When using RUNTIME_PREFIX, define HAVE_BSD[...]
Or something like that. We can always drop the "When using RUNTIME_PREFIX, " bit later if it ends up benig used for other stuff, but for now it's helpful to note that you don't need to care about these if you're not using RUNTIME_PREFIX.
exec_cmd.c line 55
Quoted 5 lines
exec_cmd.c +3
-2-"but prefix computation failed. " - "Using static fallback '%s'.\n", prefix); +"but prefix computation failed. " +"Using static fallback '%s'.\n" , + prefix);
Whitespace changed mixed in with the actual change.
Re: [PATCH v6 3/3] exec_cmd: RUNTIME_PREFIX on some POSIX systems
Quoted 3 lines · Ævar Arnfjörð Bjarmason
I wonder if it wouldn't be a lot more understandable if these were noted together, i.e. let's first document
RUNTIME_PREFIX, then for all the other ones say below that:
Sounds good to me, done.
Quoted 1 line
Whitespace changed mixed in with the actual change.
Oops, automatic "clang-format" slipped in there. I've reverted this part.
Thanks for reviewing!
Quoted 8 lines · Dan Jacques
This patch set expands support for the
RUNTIME_PREFIXconfiguration flag, currently only used on Windows builds, to include Linux, Darwin, and FreeBSD. When Git is built withRUNTIME_PREFIXenabled, it resolves its ancillary paths relative to the runtime location of its executable rather than hard-coding them at compile-time, allowing a Git installation to be deployed to a path other than the one in which it was built/installed.
Quoted 7 lines
Note that
RUNTIME_PREFIXis not currently used outside of Windows. This patch set should not have an impact on default Git builds.I'm dusting this back off now that avarab@'s Perl
Makefilesimplification patch set has landed. It's been a few months, so I'm a bit rusty, but I think that I've incorporated all of the feedback. Please take a look and let me know what you think!
Yay. Thanks for rebooting the effort.
On Mon, Mar 19 2018, Dan Jacques jotted:
Quoted 4 lines
I'm dusting this back off now that avarab@'s Perl
Makefilesimplification patch set has landed. It's been a few months, so I'm a bit rusty, but I think that I've incorporated all of the feedback. Please take a look and let me know what you think!
Thanks a lot, sans the tiny nits I noted in individual patch review (and stuff noted by others) these all look good to me.
Also it would be great if you could test it for your use-case with the next branch and define my new INSTALL_SYMLINKS to check that it doesn't ruin anything for you, it shouldn't since I made it use relative symlinks, but better to make sure (maybe I missed some edge case, and we're largely modifying code in similar places).