Skip to content

RUNTIME_PREFIX relocatable Git

Dan Jacques git 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest5 patches 2 repliesIn review
  2. v73 patches 7 repliesSuperseded
  3. v63 patches 17 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v5 posting 2/23 patches9 repliesSuperseded
v5 posting 1/20 of 3 patches0 repliesSuperseded
v44 patches22 repliesSuperseded
v34 patches7 repliesSuperseded

Changes in v8 from v7 from the cover letter

- Add Johannes's Windows patch series to the end (see v7 thread).
- Fix more typos and formatting nits.
- Rebased on top of "master".

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Makefile: generate Perl header from template file.gitignore Makefile perl/header_templates/fixed_prefix.template.pl+18 -110 replies
2/5Makefile: add Perl runtime prefix supportMakefile perl/Git/I18N.pm perl/header_templates/runtime_prefix.template.pl+107 -20 replies
3/5exec_cmd: RUNTIME_PREFIX on some POSIX systemsMakefile cache.h common-main.c +6 more+253 -390 replies
4/5exec_cmd: provide a new-style RUNTIME_PREFIX helper for WindowsMakefile exec_cmd.c+30 -00 replies
5/5mingw/msvc: use the new-style RUNTIME_PREFIX helpercompat/mingw.c config.mak.uname+4 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.

Read the v8 thread

Cover letter [PATCH v8 0/5] RUNTIME_PREFIX relocatable Git

This is a minor update based on comments from the v6 series. I'm hoping this set is good to go!

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.

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]/
v5: https://public-inbox.org/git/[email protected]/
v6: https://public-inbox.org/git/[email protected]/
v7: https://public-inbox.org/git/[email protected]/

Changes in v8 from v7:

- Add Johannes's Windows patch series to the end (see v7 thread).
- Fix more typos and formatting nits.
- Rebased on top of "master".

=== 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 = YesPlease
RUNTIME_PREFIX_PERL = YesPlease
gitexecdir = libexec/git-core
template_dir = share/git-core/templates
sysconfdir = etc

## (END config.mak)

=== Revision History ===

Changes in v7 from v6:

- Change Perl header based on avarab@'s suggestion.
- Fix typos in commit messages and comments.

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.

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

Johannes Schindelin (2):
exec_cmd: provide a new-style RUNTIME_PREFIX helper for Windows mingw/msvc: use the new-style RUNTIME_PREFIX helper

 .gitignore                                       |   1 +
 Makefile                                         | 128 +++++++++--
 cache.h                                          |   1 +
 common-main.c                                    |   4 +-
 compat/mingw.c                                   |   5 +-
 config.mak.uname                                 |   9 +
 exec_cmd.c                                       | 258 ++++++++++++++++++++---
 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 |  42 ++++
 t/t0061-run-command.sh                           |   2 +-
 14 files changed, 412 insertions(+), 55 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