list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <>
To: Dan Jacques <>
Subject: Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support
Date: Mon, 08 Jan 2018 10:41:16 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, Jan 08 2018, Dan Jacques jotted:

Thanks, applied this on top of next and it works for me, i.e. install to
/tmp/git and move to /tmp/git2 = works for me. Comments below.

> Enabling RUNTIME_PREFIX_PERL overrides the system-specific Perl script
> installation path generated by MakeMaker to force installation into a
> platform-neutral location, "<prefix>/share/perl5".

Not generated by MakeMaker anymore :)

From 3/3 (not not send 2 e-mails):

>+# it. This is intentionally separate from RUNTIME_PREFIX so that notably Windows
>+# can hard-code Perl library paths while still enabling RUNTIME_PREFIX
>+# resolution.

Maybe we covered this in previous submissions, but refresh my memory,
why is the *_PERL define still needed? Reading this explanation doesn't
make sense to me, but I'm probably missing something.

If we have a system where we have some perl library paths on the system
we want to use, then they'll still be in @INC after our 'use lib'-ing,
so we'll find libraries there.

The only reason I can think of for doing this for C and not for Perl
would be if you for some reason want to have a git in /tmp/git but then
use a different version of the from some system install, but I
can't imagine why.

Or there's another option...

> +	# GIT_EXEC_PATH is supplied by `git` or the test suite. Otherwise, resolve
> +	# against the runtime path of this script.
> +	require FindBin;
> +	require File::Spec;
> +	(my $prefix = $ENV{GIT_EXEC_PATH} || $FindBin::Bin) =~ s=${gitexecdir_relative}$==;

So why are we falling back on $FindBin::Bin? Just so you can do
e.g. /tmp/git2/libexec/git-core/git-svn like you can do
/tmp/git2/libexec/git-core/git-status, i.e. will this never be false if
invoked via "git"?

I don't mind it, just wondering if I'm missing something and we need to
use the fallback path in some "normal" codepath.

> +	return File::Spec->catdir($prefix, $relpath);

I think you initially got some version of this from me (or not), so this
is probably my fault, but reading this again I think this would be
better as just:

    return $prefix . '@@PATHSEP@@' . $relpath;

I.e. right after this we split on @@PATHSEP@@, and that clearly works
(as opposed to using File::Spec->splitpath) since we've used it

Better just to use the same idiom on both ends to not leave the reader
wondering why we can split paths one way, but need to join them another

  reply	other threads:[~2018-01-08  9:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08  3:02 [PATCH v5 0/3] RUNTIME_PREFIX relocatable Git Dan Jacques
2018-01-08  3:02 ` [PATCH v5 1/3] Makefile: generate Perl header from template file Dan Jacques
2018-01-08  3:02 ` [PATCH v5 2/3] Makefile: add Perl runtime prefix support Dan Jacques
2018-01-08  9:41   ` Ævar Arnfjörð Bjarmason [this message]
2018-01-08 19:18     ` Dan Jacques
2018-01-08 20:00       ` Ævar Arnfjörð Bjarmason
2018-01-08 20:27       ` Johannes Schindelin
2018-01-08 21:54         ` Junio C Hamano
2018-01-08 22:05         ` Dan Jacques
2018-01-08 22:16           ` Ævar Arnfjörð Bjarmason
2018-01-08 22:18             ` Dan Jacques
2018-01-08 20:24     ` Johannes Schindelin
2018-01-08  3:02 ` [PATCH v5 3/3] exec_cmd: RUNTIME_PREFIX on some POSIX systems Dan Jacques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH v5 2/3] Makefile: add Perl runtime prefix support' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ \
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for project(s) associated with this inbox:

AGPL code for this site: git clone