Skip Menu |

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

Report information
The Basics
Id: 131456
Status: open
Priority: 0/
Queue: JSON-Path

People
Owner: Nobody in particular
Requestors: christoph.burgmer [...] gmail.com
Cc:
AdminCc:

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



Subject: Non deterministic result for $..* on scalar value
Date: Tue, 14 Jan 2020 08:31:42 +0100
To: bug-JSON-Path [...] rt.cpan.org
From: Christoph Burgmer <christoph.burgmer [...] gmail.com>
It seems a recent bump in Alpine 3.11 from 3.10 has changed the Perl version from This is perl 5, version 28, subversion 2 (v5.28.2) to This is perl 5, version 30, subversion 1 (v5.30.1) and also changed the response from JSON::Path for the edge case of $..* run on a document of the number 42 from an error response to the result of an empty array. However on OS X with the same newer Perl version the previous error response can still be seen: $ echo 42 | perl main.pl '$..*' Unable to decode 42 as JSON: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at build/lib/perl5/JSON/Path/Evaluator.pm line 81, <STDIN> line 1. at build/lib/perl5/JSON/Path/Evaluator.pm line 79. $ perl --version This is perl 5, version 30, subversion 1 (v5.30.1) built for darwin-thread-multi-2level [...] $ uname -s Darwin vs. $ docker run --rm -it -v "$(pwd):/mydir" alpine:3.11 sh / # apk add perl fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz (1/2) Installing libbz2 (1.0.8-r1) (2/2) Installing perl (5.30.1-r0) Executing busybox-1.31.1-r8.trigger OK: 42 MiB in 16 packages / # cd mydir/ /mydir # echo 42 | perl main.pl '$..*' [] /mydir # perl --version This is perl 5, version 30, subversion 1 (v5.30.1) built for x86_64-linux-thread-multi [...] This currently makes it hard to reproduce the same results for the json-path-comparison across the Docker and native build (at least on OS X). I would be grateful for any pointers into why the behaviour would be different. Script is here: https://github.com/cburgmer/json-path-comparison/blob/master/implementations/Perl_JSON-Path/main.pl For completeness, I'm tracking this issue on the other side under https://github.com/cburgmer/json-path-comparison/issues/24.
Subject: Re: [rt.cpan.org #131456] Non deterministic result for $..* on scalar value
Date: Tue, 14 Jan 2020 12:13:26 -0600
To: bug-JSON-Path [...] rt.cpan.org
From: Kit Peters <popefelix [...] gmail.com>
So if I'm reading this correctly, the behaviour you're talking about is essentially that one system treats the string "42" (minus quotes) as valid JSON, and the other does not, even though the Perl versions are identical. My reply will assume that to be the case. Perl does not natively decode/encode JSON. Instead JSON support is provided by a number of third party modules. In the case of JSON::Path, the JSON encoder used is JSON::MaybeXS (https://metacpan.org/pod/JSON::MaybeXS). Per the documentation, this will use Cpanel::JSON::XS if available, fall back to JSON::XS if the former is not available, and finally fall back to JSON::PP. So JSON on two different systems could be handled by any of these three modules. Furthermore, until the introduction of ECMA-404 in 2014, "42" was *not* valid JSON. See https://www.mattlunn.me.uk/blog/2014/01/what-is-the-minimum-valid-json/ for more discussion on this topic. I'm a bit surprised, though, that the system Perl on OSX is so old. Let's investigate this further. On both systems, execute the following in Bash and send me the results: for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD -e "print qq{$MOD \$$MOD::VERSION\n}" ; done On Tue, Jan 14, 2020 at 1:32 AM Christoph Burgmer via RT < bug-JSON-Path@rt.cpan.org> wrote: Show quoted text
> Tue Jan 14 02:32:04 2020: Request 131456 was acted upon. > Transaction: Ticket created by christoph.burgmer@gmail.com > Queue: JSON-Path > Subject: Non deterministic result for $..* on scalar value > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: christoph.burgmer@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > It seems a recent bump in Alpine 3.11 from 3.10 has changed the Perl > version from > This is perl 5, version 28, subversion 2 (v5.28.2) > to > This is perl 5, version 30, subversion 1 (v5.30.1) > and also changed the response from JSON::Path for the edge case of $..* run > on a document of the number 42 from an error response to the result of an > empty array. > > However on OS X with the same newer Perl version the previous error > response can still be seen: > > $ echo 42 | perl main.pl '$..*' > Unable to decode 42 as JSON: malformed JSON string, neither tag, array, > object, number, string or atom, at character offset 0 (before "(end of > string)") at build/lib/perl5/JSON/Path/Evaluator.pm line 81, <STDIN> line > 1. > at build/lib/perl5/JSON/Path/Evaluator.pm line 79. > $ perl --version > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > darwin-thread-multi-2level > [...] > $ uname -s > Darwin > > > vs. > > > $ docker run --rm -it -v "$(pwd):/mydir" alpine:3.11 sh > / # apk add perl > fetch > http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz > fetch > http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz > (1/2 > <http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz(1/2>) > Installing libbz2 (1.0.8-r1) > (2/2) Installing perl (5.30.1-r0) > Executing busybox-1.31.1-r8.trigger > OK: 42 MiB in 16 packages > / # cd mydir/ > /mydir # echo 42 | perl main.pl '$..*' > [] > /mydir # perl --version > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > x86_64-linux-thread-multi > [...] > > > This currently makes it hard to reproduce the same results for the > json-path-comparison across the Docker and native build (at least on OS X). > I would be grateful for any pointers into why the behaviour would be > different. > > Script is here: > > https://github.com/cburgmer/json-path-comparison/blob/master/implementations/Perl_JSON-Path/main.pl > > For completeness, I'm tracking this issue on the other side under > https://github.com/cburgmer/json-path-comparison/issues/24. > >
-- Kit Peters, W0KEH GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 ED1D Hello to any and all NSA, DEA, or other government or non-government agents reading this email. Tell me about your life; I'll tell you about mine.
Subject: Re: [rt.cpan.org #131456] Non deterministic result for $..* on scalar value
Date: Wed, 15 Jan 2020 00:27:41 +0100
To: bug-JSON-Path [...] rt.cpan.org
From: Christoph Burgmer <christoph.burgmer [...] gmail.com>
Thanks, I did not know about the different standards of JSON. That explains the recent painful experience with Objective C. Output for your query on OS X: $ for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD -e "print qq{$MOD \$$MOD::VERSION\n}" ; done Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the Cpanel::JSON::XS module) (@INC contains: /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.30.1). BEGIN failed--compilation aborted. Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS module) (@INC contains: /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.30.1). BEGIN failed--compilation aborted. JSON::PP 4.02 Alpine $ docker run --rm -it alpine:3.11 sh / # apk add perl [...] / # for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD -e "print qq{$MOD \$$MOD::VERSION\n}" ; done Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the Cpanel::JSON::XS module) (@INC contains: /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl). BEGIN failed--compilation aborted. Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS module) (@INC contains: /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl). BEGIN failed--compilation aborted. JSON::PP 4.02 Am Di., 14. Jan. 2020 um 19:13 Uhr schrieb Kit Peters via RT < bug-JSON-Path@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > So if I'm reading this correctly, the behaviour you're talking about is > essentially that one system treats the string "42" (minus quotes) as valid > JSON, and the other does not, even though the Perl versions are identical. > My reply will assume that to be the case. > > Perl does not natively decode/encode JSON. Instead JSON support is provided > by a number of third party modules. In the case of JSON::Path, the JSON > encoder used is JSON::MaybeXS (https://metacpan.org/pod/JSON::MaybeXS). > Per > the documentation, this will use Cpanel::JSON::XS if available, fall back > to JSON::XS if the former is not available, and finally fall back to > JSON::PP. So JSON on two different systems could be handled by any of these > three modules. Furthermore, until the introduction of ECMA-404 in 2014, > "42" was *not* valid JSON. See > https://www.mattlunn.me.uk/blog/2014/01/what-is-the-minimum-valid-json/ > for > more discussion on this topic. > > I'm a bit surprised, though, that the system Perl on OSX is so old. Let's > investigate this further. On both systems, execute the following in Bash > and send me the results: > > for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD -e > "print qq{$MOD \$$MOD::VERSION\n}" ; done > > > On Tue, Jan 14, 2020 at 1:32 AM Christoph Burgmer via RT < > bug-JSON-Path@rt.cpan.org> wrote: >
> > Tue Jan 14 02:32:04 2020: Request 131456 was acted upon. > > Transaction: Ticket created by christoph.burgmer@gmail.com > > Queue: JSON-Path > > Subject: Non deterministic result for $..* on scalar value > > Broken in: (no value) > > Severity: (no value) > > Owner: Nobody > > Requestors: christoph.burgmer@gmail.com > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > > > It seems a recent bump in Alpine 3.11 from 3.10 has changed the Perl > > version from > > This is perl 5, version 28, subversion 2 (v5.28.2) > > to > > This is perl 5, version 30, subversion 1 (v5.30.1) > > and also changed the response from JSON::Path for the edge case of $..*
> run
> > on a document of the number 42 from an error response to the result of an > > empty array. > > > > However on OS X with the same newer Perl version the previous error > > response can still be seen: > > > > $ echo 42 | perl main.pl '$..*' > > Unable to decode 42 as JSON: malformed JSON string, neither tag, array, > > object, number, string or atom, at character offset 0 (before "(end of > > string)") at build/lib/perl5/JSON/Path/Evaluator.pm line 81, <STDIN> line > > 1. > > at build/lib/perl5/JSON/Path/Evaluator.pm line 79. > > $ perl --version > > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > > darwin-thread-multi-2level > > [...] > > $ uname -s > > Darwin > > > > > > vs. > > > > > > $ docker run --rm -it -v "$(pwd):/mydir" alpine:3.11 sh > > / # apk add perl > > fetch > > http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz > > fetch > >
> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
> > (1/2 > > <
> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz(1/2
> >) > > Installing libbz2 (1.0.8-r1) > > (2/2) Installing perl (5.30.1-r0) > > Executing busybox-1.31.1-r8.trigger > > OK: 42 MiB in 16 packages > > / # cd mydir/ > > /mydir # echo 42 | perl main.pl '$..*' > > [] > > /mydir # perl --version > > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > > x86_64-linux-thread-multi > > [...] > > > > > > This currently makes it hard to reproduce the same results for the > > json-path-comparison across the Docker and native build (at least on OS
> X).
> > I would be grateful for any pointers into why the behaviour would be > > different. > > > > Script is here: > > > >
> https://github.com/cburgmer/json-path-comparison/blob/master/implementations/Perl_JSON-Path/main.pl
> > > > For completeness, I'm tracking this issue on the other side under > > https://github.com/cburgmer/json-path-comparison/issues/24. > > > >
> > -- > Kit Peters, W0KEH > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 > ED1D > Hello to any and all NSA, DEA, or other government or non-government agents > reading this email. Tell me about your life; I'll tell you about mine. > >
Subject: Re: [rt.cpan.org #131456] Non deterministic result for $..* on scalar value
Date: Tue, 14 Jan 2020 17:39:33 -0600
To: bug-JSON-Path [...] rt.cpan.org
From: Kit Peters <popefelix [...] gmail.com>
Curiouser and curiouser... (i.e. "Das war unerwartet") Both systems are using the same version of JSON::PP. I can't imagine why one system would treat "42" as valid and another would not; it should be the same code on both. On Tue, Jan 14, 2020 at 5:28 PM Christoph Burgmer via RT < bug-JSON-Path@rt.cpan.org> wrote: Show quoted text
> Queue: JSON-Path > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > Thanks, I did not know about the different standards of JSON. That explains > the recent painful experience with Objective C. > > Output for your query on OS X: > > $ for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD -e > "print qq{$MOD \$$MOD::VERSION\n}" ; done > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the > Cpanel::JSON::XS module) (@INC contains: > > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level > /usr/local/lib/perl5/site_perl/5.30.1). > BEGIN failed--compilation aborted. > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS > module) (@INC contains: > > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level > /usr/local/lib/perl5/site_perl/5.30.1). > BEGIN failed--compilation aborted. > JSON::PP 4.02 > > Alpine > > $ docker run --rm -it alpine:3.11 sh > / # apk add perl > [...] > / # for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD -e > "print qq{$MOD \$$MOD::VERSION\n}" ; done > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the > Cpanel::JSON::XS module) (@INC contains: /usr/local/lib/perl5/site_perl > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl > /usr/share/perl5/core_perl). > BEGIN failed--compilation aborted. > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS > module) (@INC contains: /usr/local/lib/perl5/site_perl > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl > /usr/share/perl5/core_perl). > BEGIN failed--compilation aborted. > JSON::PP 4.02 > > Am Di., 14. Jan. 2020 um 19:13 Uhr schrieb Kit Peters via RT < > bug-JSON-Path@rt.cpan.org>: >
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > So if I'm reading this correctly, the behaviour you're talking about is > > essentially that one system treats the string "42" (minus quotes) as
> valid
> > JSON, and the other does not, even though the Perl versions are
> identical.
> > My reply will assume that to be the case. > > > > Perl does not natively decode/encode JSON. Instead JSON support is
> provided
> > by a number of third party modules. In the case of JSON::Path, the JSON > > encoder used is JSON::MaybeXS (https://metacpan.org/pod/JSON::MaybeXS). > > Per > > the documentation, this will use Cpanel::JSON::XS if available, fall back > > to JSON::XS if the former is not available, and finally fall back to > > JSON::PP. So JSON on two different systems could be handled by any of
> these
> > three modules. Furthermore, until the introduction of ECMA-404 in 2014, > > "42" was *not* valid JSON. See > > https://www.mattlunn.me.uk/blog/2014/01/what-is-the-minimum-valid-json/ > > for > > more discussion on this topic. > > > > I'm a bit surprised, though, that the system Perl on OSX is so old. Let's > > investigate this further. On both systems, execute the following in Bash > > and send me the results: > > > > for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD -e > > "print qq{$MOD \$$MOD::VERSION\n}" ; done > > > > > > On Tue, Jan 14, 2020 at 1:32 AM Christoph Burgmer via RT < > > bug-JSON-Path@rt.cpan.org> wrote: > >
> > > Tue Jan 14 02:32:04 2020: Request 131456 was acted upon. > > > Transaction: Ticket created by christoph.burgmer@gmail.com > > > Queue: JSON-Path > > > Subject: Non deterministic result for $..* on scalar value > > > Broken in: (no value) > > > Severity: (no value) > > > Owner: Nobody > > > Requestors: christoph.burgmer@gmail.com > > > Status: new > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > > > > > > It seems a recent bump in Alpine 3.11 from 3.10 has changed the Perl > > > version from > > > This is perl 5, version 28, subversion 2 (v5.28.2) > > > to > > > This is perl 5, version 30, subversion 1 (v5.30.1) > > > and also changed the response from JSON::Path for the edge case of $..*
> > run
> > > on a document of the number 42 from an error response to the result of
> an
> > > empty array. > > > > > > However on OS X with the same newer Perl version the previous error > > > response can still be seen: > > > > > > $ echo 42 | perl main.pl '$..*' > > > Unable to decode 42 as JSON: malformed JSON string, neither tag, array, > > > object, number, string or atom, at character offset 0 (before "(end of > > > string)") at build/lib/perl5/JSON/Path/Evaluator.pm line 81, <STDIN>
> line
> > > 1. > > > at build/lib/perl5/JSON/Path/Evaluator.pm line 79. > > > $ perl --version > > > > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > > > darwin-thread-multi-2level > > > [...] > > > $ uname -s > > > Darwin > > > > > > > > > vs. > > > > > > > > > $ docker run --rm -it -v "$(pwd):/mydir" alpine:3.11 sh > > > / # apk add perl > > > fetch > > > http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz > > > fetch > > >
> >
> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
> > > (1/2 > > > <
> >
> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz(1/2
> > >) > > > Installing libbz2 (1.0.8-r1) > > > (2/2) Installing perl (5.30.1-r0) > > > Executing busybox-1.31.1-r8.trigger > > > OK: 42 MiB in 16 packages > > > / # cd mydir/ > > > /mydir # echo 42 | perl main.pl '$..*' > > > [] > > > /mydir # perl --version > > > > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > > > x86_64-linux-thread-multi > > > [...] > > > > > > > > > This currently makes it hard to reproduce the same results for the > > > json-path-comparison across the Docker and native build (at least on OS
> > X).
> > > I would be grateful for any pointers into why the behaviour would be > > > different. > > > > > > Script is here: > > > > > >
> >
> https://github.com/cburgmer/json-path-comparison/blob/master/implementations/Perl_JSON-Path/main.pl
> > > > > > For completeness, I'm tracking this issue on the other side under > > > https://github.com/cburgmer/json-path-comparison/issues/24. > > > > > >
> > > > -- > > Kit Peters, W0KEH > > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 > > ED1D > > Hello to any and all NSA, DEA, or other government or non-government
> agents
> > reading this email. Tell me about your life; I'll tell you about mine. > > > >
> >
-- Kit Peters, W0KEH GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 ED1D Hello to any and all NSA, DEA, or other government or non-government agents reading this email. Tell me about your life; I'll tell you about mine.
Subject: Re: [rt.cpan.org #131456] Non deterministic result for $..* on scalar value
Date: Wed, 15 Jan 2020 00:56:53 +0100
To: bug-JSON-Path [...] rt.cpan.org
From: Christoph Burgmer <christoph.burgmer [...] gmail.com>
Sorry, I'm not sure I'm setting @INC right. I'm installing the dependencies via a custom target path cpanm -nL ./build JSON and setting use lib qw(./build/lib/perl5/); Not sure this helps: $ diff -r implementations/Perl_JSON-Path/build implementations/Perl_JSON-Path/build_alpine diff -r implementations/Perl_JSON-Path/build/.ninja_log implementations/Perl_JSON-Path/build_alpine/.ninja_log 2,3c2,3 < 0 208 1579045735497619436 implementations/Perl_JSON-Path/build/cpanm 510b975a90dcad89 < 208 16364 1579045751659110162 implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 --- Show quoted text
> 5 804 1579045273000000000 implementations/Perl_JSON-Path/build/cpanm
510b975a90dcad89 Show quoted text
> 805 17022 1579045289000000000
implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 Only in implementations/Perl_JSON-Path/build: bin Only in implementations/Perl_JSON-Path/build/lib/perl5: darwin-thread-multi-2level Only in implementations/Perl_JSON-Path/build_alpine/lib/perl5: x86_64-linux-thread-multi $ ls implementations/Perl_JSON-Path/build/bin cpanel_json_xs Am Mi., 15. Jan. 2020 um 00:40 Uhr schrieb Kit Peters via RT < bug-JSON-Path@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > Curiouser and curiouser... (i.e. "Das war unerwartet") Both systems are > using the same version of JSON::PP. I can't imagine why one system would > treat "42" as valid and another would not; it should be the same code on > both. > > On Tue, Jan 14, 2020 at 5:28 PM Christoph Burgmer via RT < > bug-JSON-Path@rt.cpan.org> wrote: >
> > Queue: JSON-Path > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > Thanks, I did not know about the different standards of JSON. That
> explains
> > the recent painful experience with Objective C. > > > > Output for your query on OS X: > > > > $ for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD -e > > "print qq{$MOD \$$MOD::VERSION\n}" ; done > > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the > > Cpanel::JSON::XS module) (@INC contains: > > > >
> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
> > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 > > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level > > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 > > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level > > /usr/local/lib/perl5/site_perl/5.30.1). > > BEGIN failed--compilation aborted. > > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS > > module) (@INC contains: > > > >
> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
> > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 > > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level > > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 > > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level > > /usr/local/lib/perl5/site_perl/5.30.1). > > BEGIN failed--compilation aborted. > > JSON::PP 4.02 > > > > Alpine > > > > $ docker run --rm -it alpine:3.11 sh > > / # apk add perl > > [...] > > / # for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD
> -e
> > "print qq{$MOD \$$MOD::VERSION\n}" ; done > > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the > > Cpanel::JSON::XS module) (@INC contains: /usr/local/lib/perl5/site_perl > > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl > > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl > > /usr/share/perl5/core_perl). > > BEGIN failed--compilation aborted. > > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS > > module) (@INC contains: /usr/local/lib/perl5/site_perl > > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl > > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl > > /usr/share/perl5/core_perl). > > BEGIN failed--compilation aborted. > > JSON::PP 4.02 > > > > Am Di., 14. Jan. 2020 um 19:13 Uhr schrieb Kit Peters via RT < > > bug-JSON-Path@rt.cpan.org>: > >
> > > <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > > > So if I'm reading this correctly, the behaviour you're talking about is > > > essentially that one system treats the string "42" (minus quotes) as
> > valid
> > > JSON, and the other does not, even though the Perl versions are
> > identical.
> > > My reply will assume that to be the case. > > > > > > Perl does not natively decode/encode JSON. Instead JSON support is
> > provided
> > > by a number of third party modules. In the case of JSON::Path, the JSON > > > encoder used is JSON::MaybeXS (https://metacpan.org/pod/JSON::MaybeXS
> ).
> > > Per > > > the documentation, this will use Cpanel::JSON::XS if available, fall
> back
> > > to JSON::XS if the former is not available, and finally fall back to > > > JSON::PP. So JSON on two different systems could be handled by any of
> > these
> > > three modules. Furthermore, until the introduction of ECMA-404 in 2014, > > > "42" was *not* valid JSON. See > > >
> https://www.mattlunn.me.uk/blog/2014/01/what-is-the-minimum-valid-json/
> > > for > > > more discussion on this topic. > > > > > > I'm a bit surprised, though, that the system Perl on OSX is so old.
> Let's
> > > investigate this further. On both systems, execute the following in
> Bash
> > > and send me the results: > > > > > > for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD -e > > > "print qq{$MOD \$$MOD::VERSION\n}" ; done > > > > > > > > > On Tue, Jan 14, 2020 at 1:32 AM Christoph Burgmer via RT < > > > bug-JSON-Path@rt.cpan.org> wrote: > > >
> > > > Tue Jan 14 02:32:04 2020: Request 131456 was acted upon. > > > > Transaction: Ticket created by christoph.burgmer@gmail.com > > > > Queue: JSON-Path > > > > Subject: Non deterministic result for $..* on scalar value > > > > Broken in: (no value) > > > > Severity: (no value) > > > > Owner: Nobody > > > > Requestors: christoph.burgmer@gmail.com > > > > Status: new > > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > > > > > > > > > It seems a recent bump in Alpine 3.11 from 3.10 has changed the Perl > > > > version from > > > > This is perl 5, version 28, subversion 2 (v5.28.2) > > > > to > > > > This is perl 5, version 30, subversion 1 (v5.30.1) > > > > and also changed the response from JSON::Path for the edge case of
> $..*
> > > run
> > > > on a document of the number 42 from an error response to the result
> of
> > an
> > > > empty array. > > > > > > > > However on OS X with the same newer Perl version the previous error > > > > response can still be seen: > > > > > > > > $ echo 42 | perl main.pl '$..*' > > > > Unable to decode 42 as JSON: malformed JSON string, neither tag,
> array,
> > > > object, number, string or atom, at character offset 0 (before "(end
> of
> > > > string)") at build/lib/perl5/JSON/Path/Evaluator.pm line 81, <STDIN>
> > line
> > > > 1. > > > > at build/lib/perl5/JSON/Path/Evaluator.pm line 79. > > > > $ perl --version > > > > > > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > > > > darwin-thread-multi-2level > > > > [...] > > > > $ uname -s > > > > Darwin > > > > > > > > > > > > vs. > > > > > > > > > > > > $ docker run --rm -it -v "$(pwd):/mydir" alpine:3.11 sh > > > > / # apk add perl > > > > fetch > > > >
> http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
> > > > fetch > > > >
> > >
> >
> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
> > > > (1/2 > > > > <
> > >
> >
> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz(1/2
> > > >) > > > > Installing libbz2 (1.0.8-r1) > > > > (2/2) Installing perl (5.30.1-r0) > > > > Executing busybox-1.31.1-r8.trigger > > > > OK: 42 MiB in 16 packages > > > > / # cd mydir/ > > > > /mydir # echo 42 | perl main.pl '$..*' > > > > [] > > > > /mydir # perl --version > > > > > > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > > > > x86_64-linux-thread-multi > > > > [...] > > > > > > > > > > > > This currently makes it hard to reproduce the same results for the > > > > json-path-comparison across the Docker and native build (at least on
> OS
> > > X).
> > > > I would be grateful for any pointers into why the behaviour would be > > > > different. > > > > > > > > Script is here: > > > > > > > >
> > >
> >
> https://github.com/cburgmer/json-path-comparison/blob/master/implementations/Perl_JSON-Path/main.pl
> > > > > > > > For completeness, I'm tracking this issue on the other side under > > > > https://github.com/cburgmer/json-path-comparison/issues/24. > > > > > > > >
> > > > > > -- > > > Kit Peters, W0KEH > > > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 > > > ED1D > > > Hello to any and all NSA, DEA, or other government or non-government
> > agents
> > > reading this email. Tell me about your life; I'll tell you about mine. > > > > > >
> > > >
> > -- > Kit Peters, W0KEH > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 > ED1D > Hello to any and all NSA, DEA, or other government or non-government agents > reading this email. Tell me about your life; I'll tell you about mine. > >

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #131456] Non deterministic result for $..* on scalar value
Date: Tue, 14 Jan 2020 17:59:21 -0600
To: bug-JSON-Path [...] rt.cpan.org
From: Kit Peters <popefelix [...] gmail.com>
No, not really. I've got to run out, but when I get back I'll see if I can work out a little script for you to run in both environments that might shed some light on things. On Tue, Jan 14, 2020, 17:57 Christoph Burgmer via RT < bug-JSON-Path@rt.cpan.org> wrote: Show quoted text
> Queue: JSON-Path > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > Sorry, I'm not sure I'm setting @INC right. I'm installing the dependencies > via a custom target path > cpanm -nL ./build JSON > and setting > use lib qw(./build/lib/perl5/); > > Not sure this helps: > > $ diff -r implementations/Perl_JSON-Path/build > implementations/Perl_JSON-Path/build_alpine > diff -r implementations/Perl_JSON-Path/build/.ninja_log > implementations/Perl_JSON-Path/build_alpine/.ninja_log > 2,3c2,3 > < 0 208 1579045735497619436 implementations/Perl_JSON-Path/build/cpanm > 510b975a90dcad89 > < 208 16364 1579045751659110162 > implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 > ---
> > 5 804 1579045273000000000 implementations/Perl_JSON-Path/build/cpanm
> 510b975a90dcad89
> > 805 17022 1579045289000000000
> implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 > Only in implementations/Perl_JSON-Path/build: bin > Only in implementations/Perl_JSON-Path/build/lib/perl5: > darwin-thread-multi-2level > Only in implementations/Perl_JSON-Path/build_alpine/lib/perl5: > x86_64-linux-thread-multi > $ ls implementations/Perl_JSON-Path/build/bin > cpanel_json_xs > > > > Am Mi., 15. Jan. 2020 um 00:40 Uhr schrieb Kit Peters via RT < > bug-JSON-Path@rt.cpan.org>: >
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > Curiouser and curiouser... (i.e. "Das war unerwartet") Both systems are > > using the same version of JSON::PP. I can't imagine why one system would > > treat "42" as valid and another would not; it should be the same code on > > both. > > > > On Tue, Jan 14, 2020 at 5:28 PM Christoph Burgmer via RT < > > bug-JSON-Path@rt.cpan.org> wrote: > >
> > > Queue: JSON-Path > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > > > Thanks, I did not know about the different standards of JSON. That
> > explains
> > > the recent painful experience with Objective C. > > > > > > Output for your query on OS X: > > > > > > $ for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD
> -e
> > > "print qq{$MOD \$$MOD::VERSION\n}" ; done > > > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the > > > Cpanel::JSON::XS module) (@INC contains: > > > > > >
> >
> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
> > > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 > > >
> /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level
> > > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 > > > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level > > > /usr/local/lib/perl5/site_perl/5.30.1). > > > BEGIN failed--compilation aborted. > > > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS > > > module) (@INC contains: > > > > > >
> >
> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
> > > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 > > >
> /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level
> > > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 > > > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level > > > /usr/local/lib/perl5/site_perl/5.30.1). > > > BEGIN failed--compilation aborted. > > > JSON::PP 4.02 > > > > > > Alpine > > > > > > $ docker run --rm -it alpine:3.11 sh > > > / # apk add perl > > > [...] > > > / # for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl
> -M$MOD
> > -e
> > > "print qq{$MOD \$$MOD::VERSION\n}" ; done > > > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the > > > Cpanel::JSON::XS module) (@INC contains: /usr/local/lib/perl5/site_perl > > > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl > > > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl > > > /usr/share/perl5/core_perl). > > > BEGIN failed--compilation aborted. > > > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS > > > module) (@INC contains: /usr/local/lib/perl5/site_perl > > > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl > > > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl > > > /usr/share/perl5/core_perl). > > > BEGIN failed--compilation aborted. > > > JSON::PP 4.02 > > > > > > Am Di., 14. Jan. 2020 um 19:13 Uhr schrieb Kit Peters via RT < > > > bug-JSON-Path@rt.cpan.org>: > > >
> > > > <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > > > > > So if I'm reading this correctly, the behaviour you're talking about
> is
> > > > essentially that one system treats the string "42" (minus quotes) as
> > > valid
> > > > JSON, and the other does not, even though the Perl versions are
> > > identical.
> > > > My reply will assume that to be the case. > > > > > > > > Perl does not natively decode/encode JSON. Instead JSON support is
> > > provided
> > > > by a number of third party modules. In the case of JSON::Path, the
> JSON
> > > > encoder used is JSON::MaybeXS (
> https://metacpan.org/pod/JSON::MaybeXS
> > ).
> > > > Per > > > > the documentation, this will use Cpanel::JSON::XS if available, fall
> > back
> > > > to JSON::XS if the former is not available, and finally fall back to > > > > JSON::PP. So JSON on two different systems could be handled by any of
> > > these
> > > > three modules. Furthermore, until the introduction of ECMA-404 in
> 2014,
> > > > "42" was *not* valid JSON. See > > > >
> > https://www.mattlunn.me.uk/blog/2014/01/what-is-the-minimum-valid-json/
> > > > for > > > > more discussion on this topic. > > > > > > > > I'm a bit surprised, though, that the system Perl on OSX is so old.
> > Let's
> > > > investigate this further. On both systems, execute the following in
> > Bash
> > > > and send me the results: > > > > > > > > for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD
> -e
> > > > "print qq{$MOD \$$MOD::VERSION\n}" ; done > > > > > > > > > > > > On Tue, Jan 14, 2020 at 1:32 AM Christoph Burgmer via RT < > > > > bug-JSON-Path@rt.cpan.org> wrote: > > > >
> > > > > Tue Jan 14 02:32:04 2020: Request 131456 was acted upon. > > > > > Transaction: Ticket created by christoph.burgmer@gmail.com > > > > > Queue: JSON-Path > > > > > Subject: Non deterministic result for $..* on scalar value > > > > > Broken in: (no value) > > > > > Severity: (no value) > > > > > Owner: Nobody > > > > > Requestors: christoph.burgmer@gmail.com > > > > > Status: new > > > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > > > > > > > > > > > > > > > > It seems a recent bump in Alpine 3.11 from 3.10 has changed the
> Perl
> > > > > version from > > > > > This is perl 5, version 28, subversion 2 (v5.28.2) > > > > > to > > > > > This is perl 5, version 30, subversion 1 (v5.30.1) > > > > > and also changed the response from JSON::Path for the edge case of
> > $..*
> > > > run
> > > > > on a document of the number 42 from an error response to the result
> > of
> > > an
> > > > > empty array. > > > > > > > > > > However on OS X with the same newer Perl version the previous error > > > > > response can still be seen: > > > > > > > > > > $ echo 42 | perl main.pl '$..*' > > > > > Unable to decode 42 as JSON: malformed JSON string, neither tag,
> > array,
> > > > > object, number, string or atom, at character offset 0 (before "(end
> > of
> > > > > string)") at build/lib/perl5/JSON/Path/Evaluator.pm line 81,
> <STDIN>
> > > line
> > > > > 1. > > > > > at build/lib/perl5/JSON/Path/Evaluator.pm line 79. > > > > > $ perl --version > > > > > > > > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > > > > > darwin-thread-multi-2level > > > > > [...] > > > > > $ uname -s > > > > > Darwin > > > > > > > > > > > > > > > vs. > > > > > > > > > > > > > > > $ docker run --rm -it -v "$(pwd):/mydir" alpine:3.11 sh > > > > > / # apk add perl > > > > > fetch > > > > >
> > http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
> > > > > fetch > > > > >
> > > >
> > >
> >
> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
> > > > > (1/2 > > > > > <
> > > >
> > >
> >
> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz(1/2
> > > > >) > > > > > Installing libbz2 (1.0.8-r1) > > > > > (2/2) Installing perl (5.30.1-r0) > > > > > Executing busybox-1.31.1-r8.trigger > > > > > OK: 42 MiB in 16 packages > > > > > / # cd mydir/ > > > > > /mydir # echo 42 | perl main.pl '$..*' > > > > > [] > > > > > /mydir # perl --version > > > > > > > > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for > > > > > x86_64-linux-thread-multi > > > > > [...] > > > > > > > > > > > > > > > This currently makes it hard to reproduce the same results for the > > > > > json-path-comparison across the Docker and native build (at least
> on
> > OS
> > > > X).
> > > > > I would be grateful for any pointers into why the behaviour would
> be
> > > > > different. > > > > > > > > > > Script is here: > > > > > > > > > >
> > > >
> > >
> >
> https://github.com/cburgmer/json-path-comparison/blob/master/implementations/Perl_JSON-Path/main.pl
> > > > > > > > > > For completeness, I'm tracking this issue on the other side under > > > > > https://github.com/cburgmer/json-path-comparison/issues/24. > > > > > > > > > >
> > > > > > > > -- > > > > Kit Peters, W0KEH > > > > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74
> 7F56
> > > > ED1D > > > > Hello to any and all NSA, DEA, or other government or non-government
> > > agents
> > > > reading this email. Tell me about your life; I'll tell you about
> mine.
> > > > > > > >
> > > > > >
> > > > -- > > Kit Peters, W0KEH > > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 > > ED1D > > Hello to any and all NSA, DEA, or other government or non-government
> agents
> > reading this email. Tell me about your life; I'll tell you about mine. > > > >
> >

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #131456] Non deterministic result for $..* on scalar value
Date: Wed, 15 Jan 2020 01:03:27 +0100
To: bug-JSON-Path [...] rt.cpan.org
From: Christoph Burgmer <christoph.burgmer [...] gmail.com>
Got it right this time. OS X $ for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -I ./build/lib/perl5/ -M$MOD -e "print qq{$MOD \$$MOD::VERSION\n}" ; done Cpanel::JSON::XS 4.18 Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS module) (@INC contains: ./build/lib/perl5//darwin-thread-multi-2level ./build/lib/perl5/ /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.30.1). BEGIN failed--compilation aborted. JSON::PP 4.02 Alpine: $ for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -I ./build/lib/perl5/ -M$MOD -e "print qq{$MOD \$$MOD::VERSION\n}" ; done Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the Cpanel::JSON::XS module) (@INC contains: ./build/lib/perl5/ /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl). BEGIN failed--compilation aborted. Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS module) (@INC contains: ./build/lib/perl5/ /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl). BEGIN failed--compilation aborted. JSON::PP 4.02 So the "more correct" solution is only the fallback? Can/should I change this? I tried forcing Cpanel::JSON::XS on Alpine and it fails missing header files. Am Mi., 15. Jan. 2020 um 00:56 Uhr schrieb Christoph Burgmer < christoph.burgmer@gmail.com>: Show quoted text
> Sorry, I'm not sure I'm setting @INC right. I'm installing the > dependencies via a custom target path > cpanm -nL ./build JSON > and setting > use lib qw(./build/lib/perl5/); > > Not sure this helps: > > $ diff -r implementations/Perl_JSON-Path/build > implementations/Perl_JSON-Path/build_alpine > diff -r implementations/Perl_JSON-Path/build/.ninja_log > implementations/Perl_JSON-Path/build_alpine/.ninja_log > 2,3c2,3 > < 0 208 1579045735497619436 implementations/Perl_JSON-Path/build/cpanm > 510b975a90dcad89 > < 208 16364 1579045751659110162 > implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 > ---
> > 5 804 1579045273000000000 implementations/Perl_JSON-Path/build/cpanm
> 510b975a90dcad89
> > 805 17022 1579045289000000000
> implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 > Only in implementations/Perl_JSON-Path/build: bin > Only in implementations/Perl_JSON-Path/build/lib/perl5: > darwin-thread-multi-2level > Only in implementations/Perl_JSON-Path/build_alpine/lib/perl5: > x86_64-linux-thread-multi > $ ls implementations/Perl_JSON-Path/build/bin > cpanel_json_xs > > > > Am Mi., 15. Jan. 2020 um 00:40 Uhr schrieb Kit Peters via RT < > bug-JSON-Path@rt.cpan.org>: >
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >> >> Curiouser and curiouser... (i.e. "Das war unerwartet") Both systems are >> using the same version of JSON::PP. I can't imagine why one system would >> treat "42" as valid and another would not; it should be the same code on >> both. >> >> On Tue, Jan 14, 2020 at 5:28 PM Christoph Burgmer via RT < >> bug-JSON-Path@rt.cpan.org> wrote: >>
>> > Queue: JSON-Path >> > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >> > >> > Thanks, I did not know about the different standards of JSON. That
>> explains
>> > the recent painful experience with Objective C. >> > >> > Output for your query on OS X: >> > >> > $ for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD
>> -e
>> > "print qq{$MOD \$$MOD::VERSION\n}" ; done >> > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the >> > Cpanel::JSON::XS module) (@INC contains: >> > >> >
>> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 >> >
>> /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level
>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 >> > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level >> > /usr/local/lib/perl5/site_perl/5.30.1). >> > BEGIN failed--compilation aborted. >> > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS >> > module) (@INC contains: >> > >> >
>> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 >> >
>> /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level
>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 >> > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level >> > /usr/local/lib/perl5/site_perl/5.30.1). >> > BEGIN failed--compilation aborted. >> > JSON::PP 4.02 >> > >> > Alpine >> > >> > $ docker run --rm -it alpine:3.11 sh >> > / # apk add perl >> > [...] >> > / # for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl
>> -M$MOD -e
>> > "print qq{$MOD \$$MOD::VERSION\n}" ; done >> > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the >> > Cpanel::JSON::XS module) (@INC contains: /usr/local/lib/perl5/site_perl >> > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl >> > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl >> > /usr/share/perl5/core_perl). >> > BEGIN failed--compilation aborted. >> > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS >> > module) (@INC contains: /usr/local/lib/perl5/site_perl >> > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl >> > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl >> > /usr/share/perl5/core_perl). >> > BEGIN failed--compilation aborted. >> > JSON::PP 4.02 >> > >> > Am Di., 14. Jan. 2020 um 19:13 Uhr schrieb Kit Peters via RT < >> > bug-JSON-Path@rt.cpan.org>: >> >
>> > > <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >> > > >> > > So if I'm reading this correctly, the behaviour you're talking about
>> is
>> > > essentially that one system treats the string "42" (minus quotes) as
>> > valid
>> > > JSON, and the other does not, even though the Perl versions are
>> > identical.
>> > > My reply will assume that to be the case. >> > > >> > > Perl does not natively decode/encode JSON. Instead JSON support is
>> > provided
>> > > by a number of third party modules. In the case of JSON::Path, the
>> JSON
>> > > encoder used is JSON::MaybeXS (https://metacpan.org/pod/JSON::MaybeXS
>> ).
>> > > Per >> > > the documentation, this will use Cpanel::JSON::XS if available, fall
>> back
>> > > to JSON::XS if the former is not available, and finally fall back to >> > > JSON::PP. So JSON on two different systems could be handled by any of
>> > these
>> > > three modules. Furthermore, until the introduction of ECMA-404 in
>> 2014,
>> > > "42" was *not* valid JSON. See >> > >
>> https://www.mattlunn.me.uk/blog/2014/01/what-is-the-minimum-valid-json/
>> > > for >> > > more discussion on this topic. >> > > >> > > I'm a bit surprised, though, that the system Perl on OSX is so old.
>> Let's
>> > > investigate this further. On both systems, execute the following in
>> Bash
>> > > and send me the results: >> > > >> > > for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD
>> -e
>> > > "print qq{$MOD \$$MOD::VERSION\n}" ; done >> > > >> > > >> > > On Tue, Jan 14, 2020 at 1:32 AM Christoph Burgmer via RT < >> > > bug-JSON-Path@rt.cpan.org> wrote: >> > >
>> > > > Tue Jan 14 02:32:04 2020: Request 131456 was acted upon. >> > > > Transaction: Ticket created by christoph.burgmer@gmail.com >> > > > Queue: JSON-Path >> > > > Subject: Non deterministic result for $..* on scalar value >> > > > Broken in: (no value) >> > > > Severity: (no value) >> > > > Owner: Nobody >> > > > Requestors: christoph.burgmer@gmail.com >> > > > Status: new >> > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >> > > > >> > > > >> > > > It seems a recent bump in Alpine 3.11 from 3.10 has changed the Perl >> > > > version from >> > > > This is perl 5, version 28, subversion 2 (v5.28.2) >> > > > to >> > > > This is perl 5, version 30, subversion 1 (v5.30.1) >> > > > and also changed the response from JSON::Path for the edge case of
>> $..*
>> > > run
>> > > > on a document of the number 42 from an error response to the result
>> of
>> > an
>> > > > empty array. >> > > > >> > > > However on OS X with the same newer Perl version the previous error >> > > > response can still be seen: >> > > > >> > > > $ echo 42 | perl main.pl '$..*' >> > > > Unable to decode 42 as JSON: malformed JSON string, neither tag,
>> array,
>> > > > object, number, string or atom, at character offset 0 (before "(end
>> of
>> > > > string)") at build/lib/perl5/JSON/Path/Evaluator.pm line 81, <STDIN>
>> > line
>> > > > 1. >> > > > at build/lib/perl5/JSON/Path/Evaluator.pm line 79. >> > > > $ perl --version >> > > > >> > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for >> > > > darwin-thread-multi-2level >> > > > [...] >> > > > $ uname -s >> > > > Darwin >> > > > >> > > > >> > > > vs. >> > > > >> > > > >> > > > $ docker run --rm -it -v "$(pwd):/mydir" alpine:3.11 sh >> > > > / # apk add perl >> > > > fetch >> > > >
>> http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
>> > > > fetch >> > > >
>> > >
>> >
>> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
>> > > > (1/2 >> > > > <
>> > >
>> >
>> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz(1/2
>> > > >) >> > > > Installing libbz2 (1.0.8-r1) >> > > > (2/2) Installing perl (5.30.1-r0) >> > > > Executing busybox-1.31.1-r8.trigger >> > > > OK: 42 MiB in 16 packages >> > > > / # cd mydir/ >> > > > /mydir # echo 42 | perl main.pl '$..*' >> > > > [] >> > > > /mydir # perl --version >> > > > >> > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for >> > > > x86_64-linux-thread-multi >> > > > [...] >> > > > >> > > > >> > > > This currently makes it hard to reproduce the same results for the >> > > > json-path-comparison across the Docker and native build (at least
>> on OS
>> > > X).
>> > > > I would be grateful for any pointers into why the behaviour would be >> > > > different. >> > > > >> > > > Script is here: >> > > > >> > > >
>> > >
>> >
>> https://github.com/cburgmer/json-path-comparison/blob/master/implementations/Perl_JSON-Path/main.pl
>> > > > >> > > > For completeness, I'm tracking this issue on the other side under >> > > > https://github.com/cburgmer/json-path-comparison/issues/24. >> > > > >> > > >
>> > > >> > > -- >> > > Kit Peters, W0KEH >> > > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74
>> 7F56
>> > > ED1D >> > > Hello to any and all NSA, DEA, or other government or non-government
>> > agents
>> > > reading this email. Tell me about your life; I'll tell you about
>> mine.
>> > > >> > >
>> > >> >
>> >> -- >> Kit Peters, W0KEH >> GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 >> ED1D >> Hello to any and all NSA, DEA, or other government or non-government >> agents >> reading this email. Tell me about your life; I'll tell you about mine. >> >>

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #131456] Non deterministic result for $..* on scalar value
Date: Wed, 15 Jan 2020 01:08:49 +0100
To: bug-JSON-Path [...] rt.cpan.org
From: Christoph Burgmer <christoph.burgmer [...] gmail.com>
Show quoted text
> I tried forcing Cpanel::JSON::XS on Alpine and it fails missing header > files. >
To answer at least one of my own questions: Adding perl-dev as a dependency to Alpine aligns the installations on the Cpanel::JSON::XS and makes JSON-Path fail similarly on both. Thanks for calling the underlying issue out. Obviously I'd prefer showcasing the proper response from JSON-Path on this, so this is only one step better. Let me know if I have options here please. Show quoted text
> > Am Mi., 15. Jan. 2020 um 00:56 Uhr schrieb Christoph Burgmer < > christoph.burgmer@gmail.com>: >
>> Sorry, I'm not sure I'm setting @INC right. I'm installing the >> dependencies via a custom target path >> cpanm -nL ./build JSON >> and setting >> use lib qw(./build/lib/perl5/); >> >> Not sure this helps: >> >> $ diff -r implementations/Perl_JSON-Path/build >> implementations/Perl_JSON-Path/build_alpine >> diff -r implementations/Perl_JSON-Path/build/.ninja_log >> implementations/Perl_JSON-Path/build_alpine/.ninja_log >> 2,3c2,3 >> < 0 208 1579045735497619436 implementations/Perl_JSON-Path/build/cpanm >> 510b975a90dcad89 >> < 208 16364 1579045751659110162 >> implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 >> ---
>> > 5 804 1579045273000000000 implementations/Perl_JSON-Path/build/cpanm
>> 510b975a90dcad89
>> > 805 17022 1579045289000000000
>> implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 >> Only in implementations/Perl_JSON-Path/build: bin >> Only in implementations/Perl_JSON-Path/build/lib/perl5: >> darwin-thread-multi-2level >> Only in implementations/Perl_JSON-Path/build_alpine/lib/perl5: >> x86_64-linux-thread-multi >> $ ls implementations/Perl_JSON-Path/build/bin >> cpanel_json_xs >> >> >> >> Am Mi., 15. Jan. 2020 um 00:40 Uhr schrieb Kit Peters via RT < >> bug-JSON-Path@rt.cpan.org>: >>
>>> <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >>> >>> Curiouser and curiouser... (i.e. "Das war unerwartet") Both systems are >>> using the same version of JSON::PP. I can't imagine why one system would >>> treat "42" as valid and another would not; it should be the same code on >>> both. >>> >>> On Tue, Jan 14, 2020 at 5:28 PM Christoph Burgmer via RT < >>> bug-JSON-Path@rt.cpan.org> wrote: >>>
>>> > Queue: JSON-Path >>> > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >>> > >>> > Thanks, I did not know about the different standards of JSON. That
>>> explains
>>> > the recent painful experience with Objective C. >>> > >>> > Output for your query on OS X: >>> > >>> > $ for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD
>>> -e
>>> > "print qq{$MOD \$$MOD::VERSION\n}" ; done >>> > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the >>> > Cpanel::JSON::XS module) (@INC contains: >>> > >>> >
>>> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
>>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 >>> >
>>> /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level
>>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 >>> > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level >>> > /usr/local/lib/perl5/site_perl/5.30.1). >>> > BEGIN failed--compilation aborted. >>> > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS >>> > module) (@INC contains: >>> > >>> >
>>> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
>>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 >>> >
>>> /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level
>>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 >>> > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level >>> > /usr/local/lib/perl5/site_perl/5.30.1). >>> > BEGIN failed--compilation aborted. >>> > JSON::PP 4.02 >>> > >>> > Alpine >>> > >>> > $ docker run --rm -it alpine:3.11 sh >>> > / # apk add perl >>> > [...] >>> > / # for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl
>>> -M$MOD -e
>>> > "print qq{$MOD \$$MOD::VERSION\n}" ; done >>> > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the >>> > Cpanel::JSON::XS module) (@INC contains: /usr/local/lib/perl5/site_perl >>> > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl >>> > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl >>> > /usr/share/perl5/core_perl). >>> > BEGIN failed--compilation aborted. >>> > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS >>> > module) (@INC contains: /usr/local/lib/perl5/site_perl >>> > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl >>> > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl >>> > /usr/share/perl5/core_perl). >>> > BEGIN failed--compilation aborted. >>> > JSON::PP 4.02 >>> > >>> > Am Di., 14. Jan. 2020 um 19:13 Uhr schrieb Kit Peters via RT < >>> > bug-JSON-Path@rt.cpan.org>: >>> >
>>> > > <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >>> > > >>> > > So if I'm reading this correctly, the behaviour you're talking about
>>> is
>>> > > essentially that one system treats the string "42" (minus quotes) as
>>> > valid
>>> > > JSON, and the other does not, even though the Perl versions are
>>> > identical.
>>> > > My reply will assume that to be the case. >>> > > >>> > > Perl does not natively decode/encode JSON. Instead JSON support is
>>> > provided
>>> > > by a number of third party modules. In the case of JSON::Path, the
>>> JSON
>>> > > encoder used is JSON::MaybeXS (
>>> https://metacpan.org/pod/JSON::MaybeXS).
>>> > > Per >>> > > the documentation, this will use Cpanel::JSON::XS if available, fall
>>> back
>>> > > to JSON::XS if the former is not available, and finally fall back to >>> > > JSON::PP. So JSON on two different systems could be handled by any of
>>> > these
>>> > > three modules. Furthermore, until the introduction of ECMA-404 in
>>> 2014,
>>> > > "42" was *not* valid JSON. See >>> > >
>>> https://www.mattlunn.me.uk/blog/2014/01/what-is-the-minimum-valid-json/
>>> > > for >>> > > more discussion on this topic. >>> > > >>> > > I'm a bit surprised, though, that the system Perl on OSX is so old.
>>> Let's
>>> > > investigate this further. On both systems, execute the following in
>>> Bash
>>> > > and send me the results: >>> > > >>> > > for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl -M$MOD
>>> -e
>>> > > "print qq{$MOD \$$MOD::VERSION\n}" ; done >>> > > >>> > > >>> > > On Tue, Jan 14, 2020 at 1:32 AM Christoph Burgmer via RT < >>> > > bug-JSON-Path@rt.cpan.org> wrote: >>> > >
>>> > > > Tue Jan 14 02:32:04 2020: Request 131456 was acted upon. >>> > > > Transaction: Ticket created by christoph.burgmer@gmail.com >>> > > > Queue: JSON-Path >>> > > > Subject: Non deterministic result for $..* on scalar value >>> > > > Broken in: (no value) >>> > > > Severity: (no value) >>> > > > Owner: Nobody >>> > > > Requestors: christoph.burgmer@gmail.com >>> > > > Status: new >>> > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >>> > > > >>> > > > >>> > > > It seems a recent bump in Alpine 3.11 from 3.10 has changed the
>>> Perl
>>> > > > version from >>> > > > This is perl 5, version 28, subversion 2 (v5.28.2) >>> > > > to >>> > > > This is perl 5, version 30, subversion 1 (v5.30.1) >>> > > > and also changed the response from JSON::Path for the edge case of
>>> $..*
>>> > > run
>>> > > > on a document of the number 42 from an error response to the
>>> result of
>>> > an
>>> > > > empty array. >>> > > > >>> > > > However on OS X with the same newer Perl version the previous error >>> > > > response can still be seen: >>> > > > >>> > > > $ echo 42 | perl main.pl '$..*' >>> > > > Unable to decode 42 as JSON: malformed JSON string, neither tag,
>>> array,
>>> > > > object, number, string or atom, at character offset 0 (before
>>> "(end of
>>> > > > string)") at build/lib/perl5/JSON/Path/Evaluator.pm line 81,
>>> <STDIN>
>>> > line
>>> > > > 1. >>> > > > at build/lib/perl5/JSON/Path/Evaluator.pm line 79. >>> > > > $ perl --version >>> > > > >>> > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for >>> > > > darwin-thread-multi-2level >>> > > > [...] >>> > > > $ uname -s >>> > > > Darwin >>> > > > >>> > > > >>> > > > vs. >>> > > > >>> > > > >>> > > > $ docker run --rm -it -v "$(pwd):/mydir" alpine:3.11 sh >>> > > > / # apk add perl >>> > > > fetch >>> > > >
>>> http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
>>> > > > fetch >>> > > >
>>> > >
>>> >
>>> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
>>> > > > (1/2 >>> > > > <
>>> > >
>>> >
>>> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz(1/2
>>> > > >) >>> > > > Installing libbz2 (1.0.8-r1) >>> > > > (2/2) Installing perl (5.30.1-r0) >>> > > > Executing busybox-1.31.1-r8.trigger >>> > > > OK: 42 MiB in 16 packages >>> > > > / # cd mydir/ >>> > > > /mydir # echo 42 | perl main.pl '$..*' >>> > > > [] >>> > > > /mydir # perl --version >>> > > > >>> > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for >>> > > > x86_64-linux-thread-multi >>> > > > [...] >>> > > > >>> > > > >>> > > > This currently makes it hard to reproduce the same results for the >>> > > > json-path-comparison across the Docker and native build (at least
>>> on OS
>>> > > X).
>>> > > > I would be grateful for any pointers into why the behaviour would
>>> be
>>> > > > different. >>> > > > >>> > > > Script is here: >>> > > > >>> > > >
>>> > >
>>> >
>>> https://github.com/cburgmer/json-path-comparison/blob/master/implementations/Perl_JSON-Path/main.pl
>>> > > > >>> > > > For completeness, I'm tracking this issue on the other side under >>> > > > https://github.com/cburgmer/json-path-comparison/issues/24. >>> > > > >>> > > >
>>> > > >>> > > -- >>> > > Kit Peters, W0KEH >>> > > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74
>>> 7F56
>>> > > ED1D >>> > > Hello to any and all NSA, DEA, or other government or non-government
>>> > agents
>>> > > reading this email. Tell me about your life; I'll tell you about
>>> mine.
>>> > > >>> > >
>>> > >>> >
>>> >>> -- >>> Kit Peters, W0KEH >>> GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 >>> ED1D >>> Hello to any and all NSA, DEA, or other government or non-government >>> agents >>> reading this email. Tell me about your life; I'll tell you about mine. >>> >>>

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #131456] Non deterministic result for $..* on scalar value
Date: Thu, 16 Jan 2020 20:04:31 +0100
To: bug-JSON-Path [...] rt.cpan.org
From: Christoph Burgmer <christoph.burgmer [...] gmail.com>
I found a way to fix JSON:PP for now (cpanm --pureperl), and get a stable and non-error response across the different environments. I'm still not sure what's really going on here, particularly why another json decoding is happening inside the library at this stage, but I'll leave it to you to judge whether to continue to track this issue here. For me the "non-determinisim" is now solved. Thanks for your support! Am Mi., 15. Jan. 2020 um 01:08 Uhr schrieb Christoph Burgmer < christoph.burgmer@gmail.com>: Show quoted text
> >
>> I tried forcing Cpanel::JSON::XS on Alpine and it fails missing header >> files. >>
> > To answer at least one of my own questions: Adding perl-dev as a > dependency to Alpine aligns the installations on the Cpanel::JSON::XS and > makes JSON-Path fail similarly on both. > Thanks for calling the underlying issue out. > > Obviously I'd prefer showcasing the proper response from JSON-Path on > this, so this is only one step better. Let me know if I have options here > please. > > >
>> >> Am Mi., 15. Jan. 2020 um 00:56 Uhr schrieb Christoph Burgmer < >> christoph.burgmer@gmail.com>: >>
>>> Sorry, I'm not sure I'm setting @INC right. I'm installing the >>> dependencies via a custom target path >>> cpanm -nL ./build JSON >>> and setting >>> use lib qw(./build/lib/perl5/); >>> >>> Not sure this helps: >>> >>> $ diff -r implementations/Perl_JSON-Path/build >>> implementations/Perl_JSON-Path/build_alpine >>> diff -r implementations/Perl_JSON-Path/build/.ninja_log >>> implementations/Perl_JSON-Path/build_alpine/.ninja_log >>> 2,3c2,3 >>> < 0 208 1579045735497619436 implementations/Perl_JSON-Path/build/cpanm >>> 510b975a90dcad89 >>> < 208 16364 1579045751659110162 >>> implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 >>> ---
>>> > 5 804 1579045273000000000 implementations/Perl_JSON-Path/build/cpanm
>>> 510b975a90dcad89
>>> > 805 17022 1579045289000000000
>>> implementations/Perl_JSON-Path/build/cpan_installed 525f0d1d995f1bc2 >>> Only in implementations/Perl_JSON-Path/build: bin >>> Only in implementations/Perl_JSON-Path/build/lib/perl5: >>> darwin-thread-multi-2level >>> Only in implementations/Perl_JSON-Path/build_alpine/lib/perl5: >>> x86_64-linux-thread-multi >>> $ ls implementations/Perl_JSON-Path/build/bin >>> cpanel_json_xs >>> >>> >>> >>> Am Mi., 15. Jan. 2020 um 00:40 Uhr schrieb Kit Peters via RT < >>> bug-JSON-Path@rt.cpan.org>: >>>
>>>> <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >>>> >>>> Curiouser and curiouser... (i.e. "Das war unerwartet") Both systems are >>>> using the same version of JSON::PP. I can't imagine why one system would >>>> treat "42" as valid and another would not; it should be the same code on >>>> both. >>>> >>>> On Tue, Jan 14, 2020 at 5:28 PM Christoph Burgmer via RT < >>>> bug-JSON-Path@rt.cpan.org> wrote: >>>>
>>>> > Queue: JSON-Path >>>> > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >>>> > >>>> > Thanks, I did not know about the different standards of JSON. That
>>>> explains
>>>> > the recent painful experience with Objective C. >>>> > >>>> > Output for your query on OS X: >>>> > >>>> > $ for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl
>>>> -M$MOD -e
>>>> > "print qq{$MOD \$$MOD::VERSION\n}" ; done >>>> > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the >>>> > Cpanel::JSON::XS module) (@INC contains: >>>> > >>>> >
>>>> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
>>>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 >>>> >
>>>> /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level
>>>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 >>>> > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level >>>> > /usr/local/lib/perl5/site_perl/5.30.1). >>>> > BEGIN failed--compilation aborted. >>>> > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS >>>> > module) (@INC contains: >>>> > >>>> >
>>>> /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level
>>>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/site_perl/5.30.1 >>>> >
>>>> /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1/darwin-thread-multi-2level
>>>> > /usr/local/Cellar/perl/5.30.1/lib/perl5/5.30.1 >>>> > /usr/local/lib/perl5/site_perl/5.30.1/darwin-thread-multi-2level >>>> > /usr/local/lib/perl5/site_perl/5.30.1). >>>> > BEGIN failed--compilation aborted. >>>> > JSON::PP 4.02 >>>> > >>>> > Alpine >>>> > >>>> > $ docker run --rm -it alpine:3.11 sh >>>> > / # apk add perl >>>> > [...] >>>> > / # for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl
>>>> -M$MOD -e
>>>> > "print qq{$MOD \$$MOD::VERSION\n}" ; done >>>> > Can't locate Cpanel/JSON/XS.pm in @INC (you may need to install the >>>> > Cpanel::JSON::XS module) (@INC contains:
>>>> /usr/local/lib/perl5/site_perl
>>>> > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl >>>> > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl >>>> > /usr/share/perl5/core_perl). >>>> > BEGIN failed--compilation aborted. >>>> > Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS >>>> > module) (@INC contains: /usr/local/lib/perl5/site_perl >>>> > /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl >>>> > /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl >>>> > /usr/share/perl5/core_perl). >>>> > BEGIN failed--compilation aborted. >>>> > JSON::PP 4.02 >>>> > >>>> > Am Di., 14. Jan. 2020 um 19:13 Uhr schrieb Kit Peters via RT < >>>> > bug-JSON-Path@rt.cpan.org>: >>>> >
>>>> > > <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >>>> > > >>>> > > So if I'm reading this correctly, the behaviour you're talking
>>>> about is
>>>> > > essentially that one system treats the string "42" (minus quotes) as
>>>> > valid
>>>> > > JSON, and the other does not, even though the Perl versions are
>>>> > identical.
>>>> > > My reply will assume that to be the case. >>>> > > >>>> > > Perl does not natively decode/encode JSON. Instead JSON support is
>>>> > provided
>>>> > > by a number of third party modules. In the case of JSON::Path, the
>>>> JSON
>>>> > > encoder used is JSON::MaybeXS (
>>>> https://metacpan.org/pod/JSON::MaybeXS).
>>>> > > Per >>>> > > the documentation, this will use Cpanel::JSON::XS if available,
>>>> fall back
>>>> > > to JSON::XS if the former is not available, and finally fall back to >>>> > > JSON::PP. So JSON on two different systems could be handled by any
>>>> of
>>>> > these
>>>> > > three modules. Furthermore, until the introduction of ECMA-404 in
>>>> 2014,
>>>> > > "42" was *not* valid JSON. See >>>> > >
>>>> https://www.mattlunn.me.uk/blog/2014/01/what-is-the-minimum-valid-json/
>>>> > > for >>>> > > more discussion on this topic. >>>> > > >>>> > > I'm a bit surprised, though, that the system Perl on OSX is so old.
>>>> Let's
>>>> > > investigate this further. On both systems, execute the following in
>>>> Bash
>>>> > > and send me the results: >>>> > > >>>> > > for MOD in 'Cpanel::JSON::XS' 'JSON::XS' 'JSON::PP' ; do perl
>>>> -M$MOD -e
>>>> > > "print qq{$MOD \$$MOD::VERSION\n}" ; done >>>> > > >>>> > > >>>> > > On Tue, Jan 14, 2020 at 1:32 AM Christoph Burgmer via RT < >>>> > > bug-JSON-Path@rt.cpan.org> wrote: >>>> > >
>>>> > > > Tue Jan 14 02:32:04 2020: Request 131456 was acted upon. >>>> > > > Transaction: Ticket created by christoph.burgmer@gmail.com >>>> > > > Queue: JSON-Path >>>> > > > Subject: Non deterministic result for $..* on scalar value >>>> > > > Broken in: (no value) >>>> > > > Severity: (no value) >>>> > > > Owner: Nobody >>>> > > > Requestors: christoph.burgmer@gmail.com >>>> > > > Status: new >>>> > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131456 > >>>> > > > >>>> > > > >>>> > > > It seems a recent bump in Alpine 3.11 from 3.10 has changed the
>>>> Perl
>>>> > > > version from >>>> > > > This is perl 5, version 28, subversion 2 (v5.28.2) >>>> > > > to >>>> > > > This is perl 5, version 30, subversion 1 (v5.30.1) >>>> > > > and also changed the response from JSON::Path for the edge case
>>>> of $..*
>>>> > > run
>>>> > > > on a document of the number 42 from an error response to the
>>>> result of
>>>> > an
>>>> > > > empty array. >>>> > > > >>>> > > > However on OS X with the same newer Perl version the previous
>>>> error
>>>> > > > response can still be seen: >>>> > > > >>>> > > > $ echo 42 | perl main.pl '$..*' >>>> > > > Unable to decode 42 as JSON: malformed JSON string, neither tag,
>>>> array,
>>>> > > > object, number, string or atom, at character offset 0 (before
>>>> "(end of
>>>> > > > string)") at build/lib/perl5/JSON/Path/Evaluator.pm line 81,
>>>> <STDIN>
>>>> > line
>>>> > > > 1. >>>> > > > at build/lib/perl5/JSON/Path/Evaluator.pm line 79. >>>> > > > $ perl --version >>>> > > > >>>> > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for >>>> > > > darwin-thread-multi-2level >>>> > > > [...] >>>> > > > $ uname -s >>>> > > > Darwin >>>> > > > >>>> > > > >>>> > > > vs. >>>> > > > >>>> > > > >>>> > > > $ docker run --rm -it -v "$(pwd):/mydir" alpine:3.11 sh >>>> > > > / # apk add perl >>>> > > > fetch >>>> > > >
>>>> http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
>>>> > > > fetch >>>> > > >
>>>> > >
>>>> >
>>>> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
>>>> > > > (1/2 >>>> > > > <
>>>> > >
>>>> >
>>>> http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz(1/2
>>>> > > >) >>>> > > > Installing libbz2 (1.0.8-r1) >>>> > > > (2/2) Installing perl (5.30.1-r0) >>>> > > > Executing busybox-1.31.1-r8.trigger >>>> > > > OK: 42 MiB in 16 packages >>>> > > > / # cd mydir/ >>>> > > > /mydir # echo 42 | perl main.pl '$..*' >>>> > > > [] >>>> > > > /mydir # perl --version >>>> > > > >>>> > > > This is perl 5, version 30, subversion 1 (v5.30.1) built for >>>> > > > x86_64-linux-thread-multi >>>> > > > [...] >>>> > > > >>>> > > > >>>> > > > This currently makes it hard to reproduce the same results for the >>>> > > > json-path-comparison across the Docker and native build (at least
>>>> on OS
>>>> > > X).
>>>> > > > I would be grateful for any pointers into why the behaviour would
>>>> be
>>>> > > > different. >>>> > > > >>>> > > > Script is here: >>>> > > > >>>> > > >
>>>> > >
>>>> >
>>>> https://github.com/cburgmer/json-path-comparison/blob/master/implementations/Perl_JSON-Path/main.pl
>>>> > > > >>>> > > > For completeness, I'm tracking this issue on the other side under >>>> > > > https://github.com/cburgmer/json-path-comparison/issues/24. >>>> > > > >>>> > > >
>>>> > > >>>> > > -- >>>> > > Kit Peters, W0KEH >>>> > > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74
>>>> 7F56
>>>> > > ED1D >>>> > > Hello to any and all NSA, DEA, or other government or non-government
>>>> > agents
>>>> > > reading this email. Tell me about your life; I'll tell you about
>>>> mine.
>>>> > > >>>> > >
>>>> > >>>> >
>>>> >>>> -- >>>> Kit Peters, W0KEH >>>> GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 >>>> ED1D >>>> Hello to any and all NSA, DEA, or other government or non-government >>>> agents >>>> reading this email. Tell me about your life; I'll tell you about mine. >>>> >>>>

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #131456] Non deterministic result for $..* on scalar value
Date: Thu, 16 Jan 2020 13:09:28 -0600
To: bug-JSON-Path [...] rt.cpan.org
From: Kit Peters <popefelix [...] gmail.com>

Message body is not shown because it is too large.

Message body is not shown because it is too large.