jonathanstowe / json-marshal Goto Github PK
View Code? Open in Web Editor NEWMake JSON from an Object (the opposite of JSON::Unmarshal)
License: Artistic License 2.0
Make JSON from an Object (the opposite of JSON::Unmarshal)
License: Artistic License 2.0
Ran zef install Test::META
and these messages scrolled by in the output:
===> Testing: JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t ........ ok
t/020-marshal.t .... ok
t/030-trait.t ...... ok
t/040-json-name.t .. ok
t/050-skip-null.t .. ok
t/060-array.t ...... ok
All tests successful.
Files=6, Tests=28, 6 wallclock secs ( 0.03 usr 0.00 sys + 4.92 cusr 0.22 csys = 5.17 CPU)
Result: PASS
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/020-marshal.t, line 27
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/030-trait.t, lines 19,36
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/040-json-name.t, line 23
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/050-skip-null.t, lines 18,32
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/060-array.t, line 18
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
===> Testing [OK] for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Testing: JSON::Unmarshal:ver('0.05')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/any.t ........ ok
t/basic.t ...... ok
t/json-name.t .. ok
t/trait.t ...... ok
t/types.t ...... ok
All tests successful.
Files=5, Tests=49, 6 wallclock secs ( 0.03 usr 0.01 sys + 5.63 cusr 0.21 csys = 5.88 CPU)
Result: PASS
I'm on
This is Rakudo version 2016.04-200-gad82657 built on MoarVM version 2016.04-134-g9879233
implementing Perl 6.c.
Here's the entire output of the installation, if you need it:
zoffix@VirtualBox:~/CPANPRC/Terminal-Width$ zef install Test::META
===> Searching for: Test::META
===> Found: Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Dependencies: Test, META6
===> Searching for missing dependencies: META6
===> Found dependencies: META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Dependencies: JSON::Class, Test
===> Searching for missing dependencies: JSON::Class
===> Found dependencies: JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Dependencies: JSON::Marshal, JSON::Unmarshal, Test
===> Searching for missing dependencies: JSON::Marshal, JSON::Unmarshal
===> Found dependencies: JSON::Unmarshal:ver('0.05'), JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Dependencies: JSON::Fast, JSON::Name, Test
===> Searching for missing dependencies: JSON::Name
===> Found dependencies: JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Dependencies: Test
===> Fetching: Test::META
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: Test::META to /home/zoffix/.zef/tmp/Test-META.git
===> Extracting: Test::META
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: Test::META to /home/zoffix/.zef/store/Test-META.git/162b8afb8de7f27456edffd978f422dab3b48e3c
===> Fetching: META6
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: META6 to /home/zoffix/.zef/tmp/META6.git
===> Extracting: META6
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: META6 to /home/zoffix/.zef/store/META6.git/31f5de4dd441985d7a684609a06269836dd93ed2
===> Fetching: JSON::Class
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: JSON::Class to /home/zoffix/.zef/tmp/JSON-Class.git
===> Extracting: JSON::Class
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: JSON::Class to /home/zoffix/.zef/store/JSON-Class.git/12a3de83bf68c21755c4e63a28af3a2ff2e7c009
===> Fetching: JSON::Unmarshal
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: JSON::Unmarshal to /home/zoffix/.zef/tmp/JSON-Unmarshal.git
===> Extracting: JSON::Unmarshal
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: JSON::Unmarshal to /home/zoffix/.zef/store/JSON-Unmarshal.git/97e3115683e82f44947506c172f73064126e2529
===> Fetching: JSON::Marshal
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: JSON::Marshal to /home/zoffix/.zef/tmp/JSON-Marshal.git
===> Extracting: JSON::Marshal
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: JSON::Marshal to /home/zoffix/.zef/store/JSON-Marshal.git/9ba165ebae50dd2d8bf9ffa5cd6c56eb1fabe998
===> Fetching: JSON::Name
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: JSON::Name to /home/zoffix/.zef/tmp/JSON-Name.git
===> Extracting: JSON::Name
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: JSON::Name to /home/zoffix/.zef/store/JSON-Name.git/888a6cb7b9e711d6b6f30cdc95c8f6a1a787ab03
===> Filtering: Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Filtering [OK] for Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Filtering: META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Filtering [OK] for META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Filtering: JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Filtering [OK] for JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Filtering: JSON::Unmarshal:ver('0.05')
===> Filtering [OK] for JSON::Unmarshal:ver('0.05')
===> Filtering: JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Filtering [OK] for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Filtering: JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Filtering [OK] for JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for JSON::Unmarshal:ver('0.05')
===> # SKIP: No Build.pm for JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for META6:ver('0.0.9'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Testing: JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t .... ok
t/020-trait.t .. ok
All tests successful.
Files=2, Tests=4, 1 wallclock secs ( 0.02 usr 0.00 sys + 1.30 cusr 0.04 csys = 1.36 CPU)
Result: PASS
===> Testing [OK] for JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Testing: JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t ........ ok
t/020-marshal.t .... ok
t/030-trait.t ...... ok
t/040-json-name.t .. ok
t/050-skip-null.t .. ok
t/060-array.t ...... ok
All tests successful.
Files=6, Tests=28, 6 wallclock secs ( 0.03 usr 0.00 sys + 4.92 cusr 0.22 csys = 5.17 CPU)
Result: PASS
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/020-marshal.t, line 27
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/030-trait.t, lines 19,36
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/040-json-name.t, line 23
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/050-skip-null.t, lines 18,32
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/060-array.t, line 18
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
===> Testing [OK] for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Testing: JSON::Unmarshal:ver('0.05')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/any.t ........ ok
t/basic.t ...... ok
t/json-name.t .. ok
t/trait.t ...... ok
t/types.t ...... ok
All tests successful.
Files=5, Tests=49, 6 wallclock secs ( 0.03 usr 0.01 sys + 5.63 cusr 0.21 csys = 5.88 CPU)
Result: PASS
===> Testing [OK] for JSON::Unmarshal:ver('0.05')
===> Testing: JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t ........ ok
t/030-roundtrip.t .. ok
t/040-traits.t ..... ok
t/050-array.t ...... ok
All tests successful.
Files=4, Tests=26, 7 wallclock secs ( 0.03 usr 0.00 sys + 6.28 cusr 0.24 csys = 6.55 CPU)
Result: PASS
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/040-traits.t, line 18
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
===> Testing [OK] for JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Testing: META6:ver('0.0.9'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t .......... ok
t/015-constructor.t .. ok
t/020-basic.t ........ ok
t/030-versions.t ..... ok
t/040-projects.t ..... ok
All tests successful.
Files=5, Tests=40, 22 wallclock secs ( 0.02 usr 0.01 sys + 20.64 cusr 0.52 csys = 21.19 CPU)
Result: PASS
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
t/020-basic.t, line 25
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
===> Testing [OK] for META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Testing: Test::META:ver('0.0.6'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t ........ ok
t/020-internals.t .. ok
t/030-my-meta.t .... ok
All tests successful.
Files=3, Tests=21, 12 wallclock secs ( 0.02 usr 0.00 sys + 10.77 cusr 0.26 csys = 11.05 CPU)
Result: PASS
===> Testing [OK] for Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Installing: JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Install [OK] for JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Installing: JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Install [OK] for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Installing: JSON::Unmarshal:ver('0.05')
===> Install [OK] for JSON::Unmarshal:ver('0.05')
===> Installing: JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Install [OK] for JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Installing: META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Install [OK] for META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Installing: Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Install [OK] for Test::META:ver('0.0.6'):auth('github:jonathanstowe')
zoffix@VirtualBox:~/CPANPRC/Terminal-Width$
Please revert d3cf700. It causing a lot of failures and breaking future Test::META usage in my modules.
I have been driving myself crazy trying to find a module that I can use with nested objects specifically classes. Your module is pretty close however I do not want to set the properties to null to skip the values I do not want.
It would be great if I could write a TO_JSON method or so to that returns a structure that will be marshaled by your module. Or, just use "json-skip" on attributes we don't want included in the final JSON document.
Something like:
class Something {
has Str $.foo;
has Str $.bar is json-skip;
}
or
class Something{
has Str $.foo;
has Str $.bar;
method TO_JSON {
return {
foo => $.foo
}
}
}
Especially for when :pretty is used?
Trying to zef install Math::Matrix
pulls in JSON::Marshal:ver<0.0.23+>
as a dependency.
This fails tests JSON-Marshal-0.0.23/t/040-json-name.t:7
and JSON-Marshal-0.0.23/t/140-opt-in.t:7
with P6M Merging GLOBAL symbols failed: duplicate definition of symbol Name
.
Any help much appreciated!
:)
===> Testing: JSON::Marshal:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0>
[JSON::Marshal] ===SORRY!=== Error while compiling ~/.zef/tmp/JSON-Marshal-0.0.23.tar.gz/JSON-Marshal-0.0.23/t/040-json-name.t
[JSON::Marshal] P6M Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Marshal] at ~/.zef/tmp/JSON-Marshal-0.0.23.tar.gz/JSON-Marshal-0.0.23/t/040-json-name.t:7
[JSON::Marshal] ===SORRY!=== Error while compiling ~/.zef/tmp/JSON-Marshal-0.0.23.tar.gz/JSON-Marshal-0.0.23/t/140-opt-in.t
[JSON::Marshal] P6M Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Marshal] at ~/.zef/tmp/JSON-Marshal-0.0.23.tar.gz/JSON-Marshal-0.0.23/t/140-opt-in.t:7
===> Testing [FAIL]: JSON::Marshal:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0>
Aborting due to test failure: JSON::Marshal:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0> (use --force-test to override)
It could be interesting to have something to tell marshal/unmarshal to automaticly convert kebab case to undercase (or even for CamelCase too maybe?)
I'm trying to install a package that depends on JSON-Marshal, but I'm having an error:
❯ zef install JSON::Marshal
===> Searching for: JSON::Marshal
===> Searching for missing dependencies: JSON::Name:ver<0.0.6+>, JSON::OptIn
===> Testing: JSON::OptIn:ver<0.0.2>:auth<zef:jonathanstowe>
===> Testing [OK] for JSON::OptIn:ver<0.0.2>:auth<zef:jonathanstowe>
===> Testing: JSON::Name:ver<0.0.7>:auth<zef:jonathanstowe>:api<1.0>
===> Testing [OK] for JSON::Name:ver<0.0.7>:auth<zef:jonathanstowe>:api<1.0>
===> Testing: JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0>
[JSON::OptIn] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t
[JSON::Name] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t
[JSON::Marshal] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t
[JSON::OptIn] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Name] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Marshal] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::OptIn] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t:7
[JSON::Name] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t:7
[JSON::Marshal] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t:7
[JSON::OptIn] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t
[JSON::Name] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t
[JSON::Marshal] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t
[JSON::OptIn] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Name] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Marshal] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::OptIn] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t:7
[JSON::Name] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t:7
[JSON::Marshal] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t:7
===> Testing [FAIL]: JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0>
Aborting due to test failure: JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0> (use --force-test to override)
I'm new to Raku, don't know how to further debug this issue.
Hello. I am not really sure if it is a JSON::Marshal problem, because lately there were some commits related to it to zef(notably ugexe/zef@bf75d24 and ugexe/zef@0ed9aab), so I am ready to re-post this issue to zef
repository, just don't sure what the correct behavior must be.
On fresh rakudo and newly-built zef after installing of JSON::Marshal
:
➜ 1 git:(master) zef --installed list
===> Found via /home/sena/.rakudobrew/moar-nom/install/share/perl6
CORE:ver('6.c'):auth('perl')
===> Found via /home/sena/.rakudobrew/moar-nom/install/share/perl6/site
JSON::Fast:ver('0.9.1') # === Here it is, nice and clear;
JSON::Marshal:ver('0.0.11'):auth('github:jonathanstowe') # === And the last version is here too.
OpenSSL:ver('0.1.11'):auth('github:sergot')
zef:ver('0.1.25'):auth('github:ugexe')
JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
➜ 1 git:(master) perl6
To exit type 'exit' or '^D'
> use JSON::Marshal;
===SORRY!===
Could not find JSON::Fast:ver<0.4..*> at line 60 in: # === Bang!
/home/sena/.perl6
/home/sena/.rakudobrew/moar-nom/install/share/perl6/site
/home/sena/.rakudobrew/moar-nom/install/share/perl6/vendor
/home/sena/.rakudobrew/moar-nom/install/share/perl6
CompUnit::Repository::AbsolutePath<65633296>
CompUnit::Repository::NQP<52007704>
CompUnit::Repository::Perl5<52007744>
in any statement_control at /home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm line 1
>
Hi! Seems JSON-Marshal installation does not load JSON::Fast:
[task run: task.bash - tasks/multi-versions]
[dump code: task.bash]
[1] set -e
[2]
[3] eval "$(~/.rakubrew/bin/rakubrew init Bash)"
[4] rakubrew download moar-$version
[5] rakubrew switch moar-$version
[6]
[7] which raku
[8] raku --version
[9]
[10] cd source/
[11]
[12] zef install . --deps-only --test-depends --/test
[13]
[14] /usr/bin/time -o "${cache_root_dir}/${version}_time" \
[15] zef test . && touch "${cache_root_dir}/${version}_ok"
[16]
[task stdout]
21:36:11 :: Downloading https://rakudo.org/dl/rakudo/rakudo-moar-2022.07-01-linux-x86_64-gcc.tar.gz
21:36:11 :: Extracting
21:36:12 :: Done, moar-2022.07 installed
21:36:13 :: Switching to moar-2022.07
21:36:13 :: /home/worker/.rakubrew/versions/moar-2022.07/bin/raku
21:36:13 :: Welcome to Rakudo™ v2022.07.
21:36:13 :: Implementing the Raku® Programming Language v6.d.
21:36:13 :: Built on MoarVM version 2022.07.
21:36:47 :: ===> Searching for missing dependencies: AttrX::Mooish, Test::Async, Test::META, Test::When
21:37:07 :: ===> Searching for missing dependencies: META6:ver<0.0.24+>, URI, License::SPDX
21:37:07 :: ===> Searching for missing dependencies: JSON::Class:ver<0.0.15+>, JSON::Name, JSON::Class:ver<0.0.14+>
21:37:07 :: ===> Searching for missing dependencies: JSON::Marshal:ver<0.0.23+>, JSON::Unmarshal:ver<0.08+>, JSON::OptIn
21:37:07 :: ===> Installing: JSON::OptIn:ver<0.0.2>:auth<zef:jonathanstowe>
21:37:07 :: ===> Installing: JSON::Name:ver<0.0.7>:auth<zef:jonathanstowe>:api<1.0>
21:37:07 :: ===> Installing: JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0>
21:37:07 :: ===> Install [FAIL] for JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0>: ===SORRY!=== Error while compiling /var/.sparrowdo/env/main/.sparrowdo/source/site#sources/DADA798BF2352A7EF1A131ACE8CB36C2AE6BF63B (JSON::Marshal)
21:37:07 :: Could not find JSON::Fast:ver<0.16+> in:
21:37:07 :: /home/worker/.rakubrew/versions/moar-2022.07/share/perl6/site
21:37:07 :: /home/worker/.rakubrew/versions/moar-2022.07/share/perl6/vendor
21:37:07 :: /home/worker/.rakubrew/versions/moar-2022.07/share/perl6/core
21:37:07 :: CompUnit::Repository::AbsolutePath<92469008>
21:37:07 :: CompUnit::Repository::NQP<80995336>
21:37:07 :: CompUnit::Repository::Perl5<80995376>
21:37:07 :: at /var/.sparrowdo/env/main/.sparrowdo/source/site#sources/DADA798BF2352A7EF1A131ACE8CB36C2AE6BF63B (JSON::Marshal):108
Full log - https://ci.sparrowhub.io/report/1651
Still not sure, b/c this dependency is declared in META6.json
Builtin (undefined) types are serialized as null. This works well, and allows round-trip conversion with JSON::Class:
> marshal(Int);
null
> marshal(Str);
null
Custom classes should be serialized the same way. Instead, they're serialized the same way as a defined class, and this either causes round-trip conversion failure, or an exception, depending on whether the class has members:
> class C { }
> marshal(C);
{
}
> class D { has $.i; }
> marshal(D)
Cannot look up attributes in a D type object
in block at D:\rakudo-2017.12\share\perl6\site\sources\0D5D5ABC9DC9B8DB1F75571789AD2F8F5FD3487A (JSON::Marshal) line 143
in sub _marshal at D:\rakudo-2017.12\share\perl6\site\sources\0D5D5ABC9DC9B8DB1F75571789AD2F8F5FD3487A (JSON::Marshal) line 132
in sub marshal at D:\rakudo-2017.12\share\perl6\site\sources\0D5D5ABC9DC9B8DB1F75571789AD2F8F5FD3487A (JSON::Marshal) line 172
in block <unit> at <unknown file> line 1
ubuntu@ip-172-31-47-63:~/dev/futs/scripts$ panda install JSON::Marshal
==> Fetching JSON::Marshal
==> Building JSON::Marshal
==> Testing JSON::Marshal
t/010-use.t ........ ok
t/020-marshal.t .... ok
t/030-trait.t ...... ok
t/040-json-name.t .. ok
t/050-skip-null.t .. ok
t/060-array.t ...... ok
All tests successful.
Files=6, Tests=28, 4 wallclock secs ( 0.02 usr 0.01 sys + 3.75 cusr 0.26 csys = 4.04 CPU)
Result: PASS
==> Installing JSON::Marshal
JSON::Marshal:ver<0.0.10>:authgithub:jonathanstowe:api<> already installed
in block at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/85367160D11E565B2D089507C79BC309215430D6 (Panda::Installer) line 61
in sub indir at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/24811C576EF8F85E7672B26955C802BB2FC94675 (Panda::Common) line 20
in method install at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/85367160D11E565B2D089507C79BC309215430D6 (Panda::Installer) line 42
in method install at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A (Panda) line 161
in method resolve at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A (Panda) line 234
in sub MAIN at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 line 18
in block at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 line 151
Actually thrown at:
in method install at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/85367160D11E565B2D089507C79BC309215430D6 (Panda::Installer) line 44
in method install at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A (Panda) line 161
in method resolve at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A (Panda) line 234
in sub MAIN at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 line 18
in block at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 line 151
ubuntu@ip-172-31-47-63:/dev/futs/scripts$ perl6 get_data.pl/dev/futs/scripts$ perl6 get_data.pl
Segmentation fault (core dumped)
ubuntu@ip-172-31-47-63:
Segmentation fault (core dumped)
ubuntu@ip-172-31-47-63:~/dev/futs/scripts$ perl6 get_data.pl
Segmentation fault (core dumped)
THE CODE IS:
use v6;
use JSON::Marshal;
my &infix:<++> = &infix:<~>;
subset IdentStr of Str where /^<.ident>$/;
subset Gênero of Str where * eq "Homem"|"Mulher";
class Técnico does JSON::Class {
my $.identidade = "Técnico";
has $.nome;
has Gênero $.gênero;
has Int $.idade;
has Rat $.rate;
}
my Str @técnicos = marshal( Técnico.new( nome => "Marcelo Oliveira", gênero => "Homem", idade => 54, rate => 3.88 ) ),
marshal( Técnico.new( nome => "Levir Culpi", gênero => "Homem", idade => 52, rate => 4.12 ) );
sub ef8a4da32a-get-json {
say @técnicos;
}
ef8a4da32a-get-json;
Trying to update to latest version with raku from latest master:
===> Testing: JSON::Marshal:ver<0.0.21>:auth<github:jonathanstowe>:api<1.0>
[JSON::Marshal] # Failed test 'marshalled JSON is compact'
[JSON::Marshal] # at t/120-pretty.t line 37
[JSON::Marshal] # expected: "\{\"bool\":true,\"int\":42,\"str-array\":[\"one\",\"two\",\"three\"],\"string\":\"string\"}"
[JSON::Marshal] # got: "\{\"bool\": true,\"int\": 42,\"str-array\": [\"one\",\"two\",\"three\"],\"string\": \"string\"}"
[JSON::Marshal] # You failed 1 test of 4
===> Testing [FAIL]: JSON::Marshal:ver<0.0.21>:auth<github:jonathanstowe>:api<1.0>
Aborting due to test failure: JSON::Marshal:ver<0.0.21>:auth<github:jonathanstowe>:api<1.0> (use --force-test to override)
Regards!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.