Re: *more* relocatable perl
Darren Duncan <[email protected]> Sat, 18 Jul 2026 13:28:42 -0700
| Newsgroups | gmane.comp.lang.perl.perl5.porters |
|---|---|
| Message-ID | <[email protected]> |
To me, a "relocatable" application is one that works like a typical MacOS GUI
application such that you can say download or produce a binary tarball,
untar/etc it into any folder on the computer, optionally further move it to any
other folder on the computer at any time (when it isn't running), and be able to
run it from there and it would just work with full functionality, full stop. As
long as the user knows where the "main program" is and invokes that, it can find
all of its other pieces and dependencies relative to its own location implicitly
without having to be fed any extra parameters and without any recompilation. --
Darren Duncan
On 2026-07-18 12:47 p.m., 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"
>
> 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.
>