Skip Menu |

This queue is for tickets about the JSON-MaybeXS CPAN distribution.

Report information
The Basics
Id: 110807
Status: resolved
Priority: 0/
Queue: JSON-MaybeXS

People
Owner: Nobody in particular
Requestors: MIK [...] cpan.org
Cc: DBOOK [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Troubles JSON::MaybeXS / Cpanel::JSON::XS (HP-UX)
Hi, I am currently dealing with some troubles when trying to install JSON-MaybeXS-1.003005 on a HP-UX box (HP-UX B.11.23 PA-RISC). Situation: * I have perl v5.8.3 (which is not important here) * I have local::lib + cpanm installed * I have ExtUtils-MakeMaker-7.10 (could be important) * I run: "cpanm JSON::MaybeXS -v" The trouble is that Cpanel::JSON::XS fails to install on HP-UX (which is obviously not your fault). Although I would expect that Cpanel::JSON::XS is an optional dependency of JSON::MaybeXS (so it is not necessary to be installed) it seems that JSON::MaybeXS for some reason unconditionally requires Cpanel::JSON::XS and "cpanm JSON::MaybeXS -v" always fails. My expectation is that JSON::MaybeXS will use JSON::PP (which installs fine on the HP-UX box in question) when Cpanel::JSON::XS is not installed and/or fails to install. -- Karel
On 2015-12-31 00:49:24, MIK wrote: Show quoted text
> Hi, > > I am currently dealing with some troubles when trying to install JSON- > MaybeXS-1.003005 on a HP-UX box (HP-UX B.11.23 PA-RISC). > > Situation: > * I have perl v5.8.3 (which is not important here) > * I have local::lib + cpanm installed > * I have ExtUtils-MakeMaker-7.10 (could be important) > * I run: "cpanm JSON::MaybeXS -v" > > The trouble is that Cpanel::JSON::XS fails to install on HP-UX (which > is obviously not your fault). > > Although I would expect that Cpanel::JSON::XS is an optional > dependency of JSON::MaybeXS (so it is not necessary to be installed) > it seems that JSON::MaybeXS for some reason unconditionally requires > Cpanel::JSON::XS and "cpanm JSON::MaybeXS -v" always fails. > > My expectation is that JSON::MaybeXS will use JSON::PP (which installs > fine on the HP-UX box in question) when Cpanel::JSON::XS is not > installed and/or fails to install. >
Cpanel::JSON::XS is in the 'recommends' section of the prereqs, which your client may be configured to install as well. can you provide the build log?
Yes, Cpanel::JSON::XS seems to be in the 'recommends' section, however there is some "magic" in Makefile.PL which puts it in PREREQ_PM. See https://metacpan.org/source/ETHER/JSON-MaybeXS-1.003005/Makefile.PL#L99 Build log attached
Subject: JSON-MaybeXS-failure.txt

Message body is not shown because it is too large.

On 2015-12-31 00:49:24, MIK wrote: Show quoted text
> My expectation is that JSON::MaybeXS will use JSON::PP (which installs > fine on the HP-UX box in question) when Cpanel::JSON::XS is not > installed and/or fails to install.
Unfortunately, the toolchain is not able to do that (attempt to install X, but if X fails, fall back to Y) -- the prereqs are determined in advance and cannot be changed after attempting to install them. You can however work around the problem in this particular case, either by installing JSON::XS (assuming it doesn't have the same compilation difficulties as Cpanel::JSON::XS), or by signalling that you don't want the XS component installed, with the PUREPERL_ONLY argument: perl Makefile.PL PUREPERL_ONLY=1
Subject: Re: [rt.cpan.org #110807] Troubles JSON::MaybeXS / Cpanel::JSON::XS (HP-UX)
Date: Sat, 2 Jan 2016 15:21:06 +0100
To: bug-JSON-MaybeXS [...] rt.cpan.org
From: Karel Miko <miko [...] dcit.cz>
Show quoted text
> Unfortunately, the toolchain is not able to do that (attempt to > install X, but if X fails, fall back to Y) -- the prereqs are > determined in advance and cannot be changed after attempting to install
them. That is true. But in my opinion it is not Makefile.PL's business to do this kind of "detection" it should be left to CPAN client (like "cpanm") to decide. In other words I think that JSON::MaybeXS should only declare proper: "recommends" and/or "suggests" items in Makefile.PL and meta.(yml|json) and that's all. Based on these "recommends"/"suggests" values CPAN client should decide what modules it will try to install and want installation failure can be ignored because they are only optional dependencies. Show quoted text
> You can however work around the problem in this particular case, > either by installing JSON::XS (assuming it doesn't have the same > compilation difficulties as Cpanel::JSON::XS), or by signalling that > you don't want the XS component installed, with the PUREPERL_ONLY
argument: Show quoted text
> > perl Makefile.PL PUREPERL_ONLY=1
Thanks for the workaround, it works. But it is a good workaround for JSON::MaybeXS users not for an author of module depending on JSON::MaybeXS. In my case I am an author of 'CryptX' module and I used to use dependency on 'JSON' module. Couple of months ago I got a pull request that it might be a good idea to switch to 'JSON::MaybeXS' as it will use faster JSOM implementations when available. So I have switched 'CryptX' to 'JSON::MaybeXS' as according the documentation it looked good and worked on "common" platforms I use (Windows/Linux). Later, there was a user who wanted to install my 'CryptX' on a HP-UX * so he ran 'cpanm CryptX' * JSON::MaybeXS was not installed so CPAN client started the installation¨ * now MaybeXS's Makefile.PL decided that it will forcefully require Cpanel::JSON::XS * Cpanel::JSON::XS was not available so CPAN client started the installation * unfortunately Cpanel::JSON::XS does not pass tests on HP-UX so it failed * so JSON::MaybeXS installation failed as well * so CryptX instalation had not even started as prereqs were not satisfied * so bad luck If you look at the scenario above from my point of view (as an author of CryptX) being dependant on JSON::MaybeXS is more or less the same as being dependant on Cpanel::JSON::XS (which I do not want). For sure I can easily switch CryptX back to JSON or JSON::PP and avoid JSON::MaybeXS. I only want you to know that despite the fact that the idea behind JSON::MaybeXS is good is has some caveats and does not always work well. -- Karel
On Sat Jan 02 09:21:28 2016, miko@dcit.cz wrote: Show quoted text
> > Unfortunately, the toolchain is not able to do that (attempt to > > install X, but if X fails, fall back to Y) -- the prereqs are > > determined in advance and cannot be changed after attempting to install
> them. > > That is true. But in my opinion it is not Makefile.PL's business to do > this kind of "detection" it should be left to CPAN client (like "cpanm") > to decide. > > In other words I think that JSON::MaybeXS should only declare proper: > "recommends" and/or "suggests" items in Makefile.PL and meta.(yml|json) > and that's all. Based on these "recommends"/"suggests" values CPAN client > should decide what modules it will try to install and want installation > failure can be ignored because they are only optional dependencies. >
Unfortunately it is not that simple. If CPAN clients implemented "recommends" and "suggests" correctly in general, a "recommends Cpanel::JSON::XS" would be the most correct approach. But this is not the case. Most CPAN clients ignore both recommends and suggests by default, and CPAN.pm still considers failing to install recommends as a failure to install prerequisites, which means it is ill-advised to enable it there usually. cpanm with --with-recommends is mostly sensible, but it's still not the default, so a "recommends" can't be relied upon even in that case. JSON::MaybeXS simply *needs* to try to install Cpanel::JSON::XS first in order to be useful (but if it fails to install, this should not be a failure, you are correct), and the current "recommends" infrastructure is not capable of supporting that properly.
Subject: Re: [rt.cpan.org #110807] Troubles JSON::MaybeXS / Cpanel::JSON::XS (HP-UX)
Date: Wed, 23 Mar 2016 21:14:47 +0100
To: bug-JSON-MaybeXS [...] rt.cpan.org
From: Karel Miko <miko [...] dcit.cz>
Show quoted text
> JSON::MaybeXS simply *needs* to try to install Cpanel::JSON::XS first
The reality is: JSON::MaybeXS **requires** to install Cpanel::JSON::XS first and if Cpanel::JSON::XS fails JSON::MaybeXS fails as well Feel free to close/postpone/reject this ticket as I have "fixed" this issue by removing dependency on JSON::MaybeXS Regards Karel
On 2016-03-23 13:15:02, miko@dcit.cz wrote: Show quoted text
> > JSON::MaybeXS simply *needs* to try to install Cpanel::JSON::XS first
> > The reality is: > > JSON::MaybeXS **requires** to install Cpanel::JSON::XS first and if > Cpanel::JSON::XS fails JSON::MaybeXS fails as well > > Feel free to close/postpone/reject this ticket as I have "fixed" this > issue by removing dependency on JSON::MaybeXS
One other thing you can do is do the installation in "pure perl only" mode -- e.g. "cpanm <your module> --pureperl", which will cause JSON::MaybeXS to *not* add Cpanel::JSON::XS as a dependency. Also, definitely please report this issue to Cpanel::JSON::XS, as its author is quite responsive.
Subject: Re: [rt.cpan.org #110807] Troubles JSON::MaybeXS / Cpanel::JSON::XS (HP-UX)
Date: Thu, 24 Mar 2016 00:26:34 +0100
To: bug-JSON-MaybeXS [...] rt.cpan.org
From: Karel Miko <miko [...] dcit.cz>
Show quoted text
> Also, definitely please report this issue to Cpanel::JSON::XS, as > its author is quite responsive.
I have created a github issue the same day as I have created this RT: https://github.com/rurban/Cpanel-JSON-XS/issues/56 -- Karel
I don't think there's anything more we can do at this level -- cpan clients don't currently have a fallback mechanism to handle the case where optional prereqs fail their tests. Hopefully Cpanel::JSON::XS will resolve the HPUX issue soon.
looks like maybe this issue should be closed https://github.com/rurban/Cpanel-JSON-XS/issues/56 On Mon Oct 03 14:56:54 2016, ETHER wrote: Show quoted text
> I don't think there's anything more we can do at this level -- cpan > clients don't currently have a fallback mechanism to handle the case > where optional prereqs fail their tests. Hopefully Cpanel::JSON::XS > will resolve the HPUX issue soon.