Thu Sep 03 03:43:05 2009: Request 49387 was acted upon.
Transaction: Correspondence added by SMUELLER
Queue: File-ShareDir-PAR
Subject: Should File::ShareDir::PAR build-require PAR?
Broken in: 0.05
Severity: (no value)
Owner: Nobody
Requestors: [email protected]
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=49387 >
Hi Alex,
I'll include a full copy of your bug report here since I only just added
the PAR mailing list as CC.
On Wed Sep 02 22:50:23 2009, http://alexpeters.net/ wrote:
> Hello Steffen,
>
> I am working on code that we intend to deploy in two styles:
>
> 1. as a standard installation (/usr/share/perl5, etc.)
> 2. as a stand-alone PAR
>
> Since this code uses shared files, File::ShareDir::PAR seems to be a
> perfect tool to accommodate for both cases.
>
> My understanding is that File::ShareDir::PAR intends to be a drop-in
> replacement for File::ShareDir--that is, if one is not operating under
> PAR, File::ShareDir::PAR delegates to File::ShareDir.
>
> To me, this suggests that File::ShareDir::PAR should be able to operate
> independently of PAR. However, File::ShareDir::PAR lists PAR as a build
> dependency.
>
> I understand that when File::ShareDir::PAR actually needs to call PAR,
> it requires a minimum PAR version. Therefore, I think I understand why
> PAR is listed as a build dependency: you want to ensure that
> File::ShareDir::PAR does not attempt to operate with an outdated version
> of PAR.
>
> However, since my code uses File::ShareDir::PAR even when PAR is not in
> use, PAR becomes a dependency for installations where it will never be
> required.
>
> To work around this, I am continuing to use File::ShareDir and
> dynamically requiring File::ShareDir::PAR when I detect that PAR is in
> use. Consequently, I am also doing the PAR version checking myself.
>
> In order to Debian-package File::ShareDir::PAR for internal deployment,
> I am also manually removing the PAR dependency. This feels like an
> incorrect way to solve the problem, but it is necessary for me to ensure
> that a Debian-packaged standard installation of my code does not depend
> on libpar-perl.
>
> To cut to the chase: given my use case, do you feel that it could be
> appropriate to change PAR from a required build dependency to a
> conditional dynamic runtime dependency? This would make
> File::ShareDir::PAR a true drop-in replacement for File::ShareDir, since
> it would work as expected without a PAR installation.
>
> I don't know whether the attached modification of _par_in_use would be
> sufficient, but your consideration and feedback would be much
> appreciated. :)
>
> Best wishes from Melbourne, Australia.
>
> --Alex Peters
I can see where you're coming from and I'd be willing to apply the
patch, but it'll take at least a modification of the test suite to skip
the PAR-related tests if PAR couldn't be loaded. If you could also
provide that, I'll apply both patches and cut a release.
Thanks for feeding your improvements back upstream!
Best regards,
Steffen