Re: *more* relocatable perl

Andrew Hewus Fresh <[email protected]> Sat, 18 Jul 2026 14:42:46 -0700
Newsgroups gmane.comp.lang.perl.perl5.porters
Message-ID <[email protected]>
On Sat, Jul 18, 2026 at 08:47:15PM +0100, Gianni Ceccarelli via perl5-porters wrote:
> (Blabos responded privately, suggesting plenv / perl-build; I may have
> not explained myself clearly enough, let me try again)
> 
> I suspect we're using different definition of "relocatable"

I agree, especially since perl-build doesn't solve this issue.  See:

https://github.com/tokuhirom/Perl-Build/pull/100

I am using a post-processing script to do this (which is based on a
what was done by skaji) at work, and it does seem to work.

https://github.com/skaji/relocatable-perl



 
> If I build a perl (by hand, with perlbrew, with perl-build, I'm pretty
> sure it doesn't make a difference) to (for example)
> `~/perl5/perlbrew/perl-5.44.0/`, then I *move* that whole directory
> tree somewhere else:
> 
>     mv ~/perl5/perlbrew/perl-5.44.0/ ~/src/myproject/perl
>     export PATH=~/src/myproject/perl/bin:$PATH
> 
> and then try to install (let's say) `Archive::Zip`, the tests will fail.
> 
> Those tests (see
> https://metacpan.org/release/PHRED/Archive-Zip-1.68/source/t/common.pm#L104
> ) use `$Config{perlpath}` to find a working perl. But since I moved it
> away from where it was initially installed, the `perl` is no longer
> there (and nothing updated `Config.pm`).
> 
> There are also distributions that use `ExtUtils::Helpers`
> `make_executable` which uses `$Config{startperl}`
> https://metacpan.org/release/LEONT/ExtUtils-Helpers-0.028/source/lib/ExtUtils/Helpers/Unix.pm#L21
> which, again, will point to the path that perl was initially installed
> to.
> 
> For my particular case, I have patched `Config.pm` so it treats those
> settings pretty much the same way as the various "libs" when
> `userelocatableinc` is enabled: the original installation prefix gets
> replaced by whatever the path to `$^X` is.
> 
> My suggestion was to incorporate that hack in the normal Configure
> process. Or maybe to tell me why it can't be done, or shouldn't be
> done.
> 
> -- 
> 	Dakkar - <Mobilis in mobile>
> 	GPG public key fingerprint = A071 E618 DD2C 5901 9574
> 	                             6FE2 40EA 9883 7519 3F88
> 	                    key id = 0x75193F88
> 

-- 
andrew

I wish life had an UNDO function.