raku-community-modules / LWP-Simple

LWP::Simple quick & dirty implementation for Rakudo
http://www.streppone.it/cosimo/blog/tag/LWP::Simple/
Artistic License 2.0
7 stars 9 forks source link

test fail on moar-2017.07: Cannot do 'print' on a handle in binary mode #17

Closed zakame closed 7 years ago

zakame commented 7 years ago
θ61° [zakame:~] % rakudobrew version    
moar-2017.07         
θ60° [zakame:~] % perl6 -v
This is Rakudo version 2017.07 built on MoarVM version 2017.07
implementing Perl 6.c.
θ60° [zakame:~] % zef install LWP::Simple
===> Searching for: LWP::Simple
===> Testing: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
Cannot do 'print' on a handle in binary mode
  in method getstore at /home/zakame/.zef/store/perl6-lwp-simple.git/01b3edfeb4027ecc51d549356449c68620845dbd/lib/LWP/Simple.pm (LWP::Simple) line 354
  in block <unit> at t/getstore.t line 17
  ...
zoffixznet commented 7 years ago

You need to upgrade your URI module or if that fails, try nuking ~/.zef and installing again.

This issue was resolved awhile back.

zakame commented 7 years ago

@zoffixznet hmm doesn't seem to have any new upgrades for URI:

θ80° [zakame:~] 2s % zef install URI        
All candidates are currently installed
No reason to proceed. Use --force-install to continue anyway
θ97° [zakame:~] 2s % zef install --force-install URI
===> Searching for: URI
===> Updated cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan.json
===> Updated p6c mirror: http://ecosystem-api.p6c.org/projects.json
===> Testing: URI:ver('0.1.4')
===> Testing [OK] for URI:ver('0.1.4')
===> Installing: URI:ver('0.1.4')
θ97° [zakame:~] 35s % zef install LWP::Simple        
===> Searching for: LWP::Simple
===> Testing: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
Cannot do 'print' on a handle in binary mode
  in method getstore at /home/zakame/.zef/store/perl6-lwp-simple.git/01b3edfeb4027ecc51d549356449c68620845dbd/lib/LWP/Simple.pm (LWP::Simple) line 354
  in block <unit> at t/getstore.t line 17

===> Testing [FAIL]: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
Aborting due to test failure: LWP::Simple:ver('0.090'):auth('Cosimo Streppone') (use --force-test to override)
  in code  at /home/zakame/.rakudobrew/moar-2017.07/install/share/perl6/site/sources/D8DA75990175D86E5B61B6B9E506E25253D1BFAB (Zef::Client) line 373
  in method test at /home/zakame/.rakudobrew/moar-2017.07/install/share/perl6/site/sources/D8DA75990175D86E5B61B6B9E506E25253D1BFAB (Zef::Client) line 351
  in code  at /home/zakame/.rakudobrew/moar-2017.07/install/share/perl6/site/sources/D8DA75990175D86E5B61B6B9E506E25253D1BFAB (Zef::Client) line 528
  in sub  at /home/zakame/.rakudobrew/moar-2017.07/install/share/perl6/site/sources/D8DA75990175D86E5B61B6B9E506E25253D1BFAB (Zef::Client) line 525
  in method install at /home/zakame/.rakudobrew/moar-2017.07/install/share/perl6/site/sources/D8DA75990175D86E5B61B6B9E506E25253D1BFAB (Zef::Client) line 631
  in sub MAIN at /home/zakame/.rakudobrew/moar-2017.07/install/share/perl6/site/sources/6F39CCA374659C093503FF4C13A983A1D0F01561 (Zef::CLI) line 152
  in block <unit> at /home/zakame/.rakudobrew/moar-2017.07/install/share/perl6/site/resources/91912DE126EF74B0DBCD199E9980588404D45304 line 1
  in sub MAIN at /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef line 2
  in block <unit> at /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef line 2

θ97° [zakame:~] 1m17s 1 % zef upgrade URI                
===> Searching for: URI
The following distributions are already at their latest versions: URI:ver('0.1.4')
θ97° [zakame:~] 23s 255 % 
zoffixznet commented 7 years ago

It's installing LWP::Simpler 0.090, but current version is 0.092.

Maybe needs a zef update first? I thought it did it automatically now tho.

There was a person having similar issue as you and their issue was outdated modules. The problems don't exist on latest version: https://irclog.perlgeek.de/perl6-dev/2017-07-12#i_14861971

zakame commented 7 years ago

Seems like zef likes a tagged release? This repo only has 0.090 as latest.

I did zef update prior to above, and now again. Still no dice:

θ97° [zakame:~] 23s 255 % zef update     
===> Updated cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan.json
===> Updated p6c mirror: http://ecosystem-api.p6c.org/projects.json
----------------------------------------------------
Content Storage                  |Distribution Count
----------------------------------------------------
Zef::Repository::Ecosystems<p6c> |859               
Zef::Repository::LocalCache      |74                
Zef::Repository::Ecosystems<cpan>|27                
----------------------------------------------------
θ97° [zakame:~] 20s % zef install LWP::Simple
===> Searching for: LWP::Simple       
===> Testing: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
...
===> Testing [FAIL]: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
...
zoffixznet commented 7 years ago

What about zef --/cache install LWP::Simple ?

zakame commented 7 years ago

Doesn't seem like my zef knows that:

θ89° [zakame:~] % zef --/cache install LWP::Simple
Usage:
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--force|--force-fetch] fetch '[<identities> ...]' -- Download specific distributions
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--force|--force-test] test '[<paths> ...]' -- Run tests
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--force|--force-build] build '[<paths> ...]' -- Run Build.pm
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--depends] [--test-depends] [--build-depends] [--test] [--fetch] [--build] [--force] [--force-resolve] [--force-fetch] [--force-extract] [--force-build] [--force-test] [--force-install] [--dry] [--update] [--upgrade] [--deps-only] [--serial] [--exclude=<Any>] [--to|--install-to=<Any>] install '[<wants> ...]' -- Install
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--from|--uninstall-from=<Any>] uninstall '[<identities> ...]' -- Uninstall
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--wrap=<Int>] search '[<terms> ...]' -- Get a list of possible distribution candidates for the given terms
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--max=<Int>] [-i|--installed] list '[<at> ...]' -- A list of available modules from enabled repositories
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--to|--install-to=<Any>] upgrade '[<identities> ...]' -- Upgrade installed distributions (BETA)
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--depends] [--test-depends] [--build-depends] rdepends <identity> -- View reverse dependencies of a distribution
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--sha1] locate <identity> -- Lookup locally installed distributions by short-name, name-path, or sha1 id
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--wrap=<Int>] info <identity> -- Detailed distribution information
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--open] browse <identity> <url-type> -- Browse a distribution's available support urls (homepage, bugtracker, source)
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef look <identity> -- Download a single module and change into its directory
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--depends] [--test-depends] [--build-depends] [--test] [--fetch] [--build] [--force] [--force-resolve] [--force-fetch] [--force-extract] [--force-build] [--force-test] [--force-install] [--update] [--upgrade] [--deps-only] [--exclude=<Any>] [--to|--install-to=<Any>] smoke -- Smoke test
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef update '[<names> ...]' -- Update package indexes
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [--confirm] nuke '[<names> ...]' -- Nuke module installations (site, home) and repositories from config (RootDir, StoreDir, TempDir)
  /home/zakame/.rakudobrew/bin/../moar-2017.07/install/share/perl6/site/bin/zef [-h|--help]
θ88° [zakame:~] 2 % zef upgrade zef                 
===> Searching for: zef
The following distributions are already at their latest versions: zef:ver('0.1.25'):auth('github:ugexe')
zoffixznet commented 7 years ago

Ooops. It's --/cached not --/cache..... zef --/cached install LWP::Simple

zakame commented 7 years ago

Sorry no dice:

θ95° [zakame:~] 20s 255 % zef --/cached install LWP::Simple 
===> Searching for: LWP::Simple
===> Testing: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
Cannot do 'print' on a handle in binary mode
  in method getstore at /home/zakame/.zef/store/perl6-lwp-simple.git/01b3edfeb4027ecc51d549356449c68620845dbd/lib/LWP/Simple.pm (LWP::Simple) line 354
  in block <unit> at t/getstore.t line 17

===> Testing [FAIL]: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
zoffixznet commented 7 years ago

@ugexe do you have any ideas why zef is evidently refusing to fetch latest LWP::Simple, which is version 0.092? Does it do tagged releases only if it spots some tags?

zakame commented 7 years ago

@zoffixznet running with --debug shows that zef actually does get 0.092, but because of https://github.com/perl6/perl6-lwp-simple/blob/master/lib/LWP/Simple.pm#L9 it thinks we're installing 0.090:

θ90° [zakame:~] 130 % zef --debug install LWP::Simple
===> Searching for: LWP::Simple
===> Found: LWP::Simple:ver('0.092'):auth('Cosimo Streppone') [via Zef::Repository::Ecosystems<p6c>]
===> Dependencies: MIME::Base64, URI, JSON::Tiny
===> Fetching: LWP::Simple
Fetching with plugin: Zef::Service::Shell::git+{<anon|88842352>}
===> Fetching [OK]: LWP::Simple:ver('0.092'):auth('Cosimo Streppone') to /home/zakame/.zef/tmp/perl6-lwp-simple.git
===> Extracting: LWP::Simple
Extracting with plugin: Zef::Service::Shell::git+{<anon|88842352>}
===> Extraction [OK]: LWP::Simple to /home/zakame/.zef/store/perl6-lwp-simple.git
===> Filtering: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
===> Filtering [OK] for LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
===> # SKIP: No Build.pm for LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
===> Testing: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
Testing with plugin: Zef::Service::Shell::prove+{<anon|88842352>}
t/000-load-module.t ............. ok
t/basic-auth.t .................. ok
t/custom-headers-and-content.t .. ok
t/get-binary-camelia.t .......... ok
t/get-chunked-6guts.t ........... ok
t/get-perl6-org.t ............... ok
t/get-unsized.t ................. ok
t/get-w3-latin1-utf8.t .......... ok
t/get-w3-redirect.t ............. ok
t/getstore.t .................... 
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 4/4 subtests 
t/issue-7.t ..................... ok
t/parse-url.t ................... ok
t/socket-sanity.t ............... ok
t/stringify-headers.t ........... ok

Test Summary Report
-------------------
t/getstore.t                  (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 4 tests but ran 0.
Files=14, Tests=53, 31 wallclock secs ( 0.06 usr  0.02 sys +  6.58 cusr  0.51 csys =  7.17 CPU)
Result: FAIL

Cannot do 'print' on a handle in binary mode
  in method getstore at /home/zakame/.zef/store/perl6-lwp-simple.git/01b3edfeb4027ecc51d549356449c68620845dbd/lib/LWP/Simple.pm (LWP::Simple) line 354
  in block <unit> at t/getstore.t line 17

===> Testing [FAIL]: LWP::Simple:ver('0.090'):auth('Cosimo Streppone')
zoffixznet commented 7 years ago

Well, other than the nuclear option of wiping everything (rm -fr ~/.perl6 ~/.zef) and installing from start, I'm out of ideas :)

I know it works on 2017.07 because I Toasted before the release and it was green. The line it reports uses URI module... maybe there's some sort of precomp issue?

zakame commented 7 years ago

Yeah, seem the nuke worked:

θ82° [zakame:~] 22m4s % rm -fr .perl6 .zef
θ84° [zakame:~] % zef --debug install LWP::Simple
===> Searching for: LWP::Simple
===> Updated cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan.json
===> Updated p6c mirror: http://ecosystem-api.p6c.org/projects.json
===> Found: LWP::Simple:ver('0.092'):auth('Cosimo Streppone') [via Zef::Repository::Ecosystems<p6c>]
===> Dependencies: MIME::Base64, URI, JSON::Tiny
===> Fetching: LWP::Simple
Fetching with plugin: Zef::Service::Shell::git+{<anon|88842352>}
===> Fetching [OK]: LWP::Simple:ver('0.092'):auth('Cosimo Streppone') to /home/zakame/.zef/tmp/perl6-lwp-simple.git
===> Extracting: LWP::Simple
Extracting with plugin: Zef::Service::Shell::git+{<anon|88842352>}
===> Extraction [OK]: LWP::Simple to /home/zakame/.zef/store/perl6-lwp-simple.git
===> Filtering: LWP::Simple:ver('0.092'):auth('Cosimo Streppone')
===> Filtering [OK] for LWP::Simple:ver('0.092'):auth('Cosimo Streppone')
===> # SKIP: No Build.pm for LWP::Simple:ver('0.092'):auth('Cosimo Streppone')
===> Testing: LWP::Simple:ver('0.092'):auth('Cosimo Streppone')
Testing with plugin: Zef::Service::Shell::prove+{<anon|88842352>}
t/000-load-module.t ............. ok
t/basic-auth.t .................. ok
t/custom-headers-and-content.t .. ok
t/delete-headers.t .............. ok
t/get-binary-camelia.t .......... ok
t/get-chunked-6guts.t ........... ok
t/get-headers.t ................. ok
t/get-perl6-org.t ............... ok
t/get-unsized.t ................. ok
t/get-w3-latin1-utf8.t .......... ok
t/get-w3-redirect.t ............. ok
t/getstore.t .................... ok
t/issue-7.t ..................... ok
t/parse-url.t ................... ok
t/socket-sanity.t ............... ok
t/stringify-headers.t ........... ok
All tests successful.
Files=16, Tests=61, 30 wallclock secs ( 0.05 usr  0.01 sys +  9.13 cusr  0.64 csys =  9.83 CPU)
Result: PASS

===> Testing [OK] for LWP::Simple:ver('0.092'):auth('Cosimo Streppone')
===> Installing: LWP::Simple:ver('0.092'):auth('Cosimo Streppone')
===> Install [OK] for LWP::Simple:ver('0.092'):auth('Cosimo Streppone')

2 bin/ scripts [lwp-download.pl lwp-get.pl] installed to:
/home/zakame/.rakudobrew/moar-2017.07/install/share/perl6/site/bin

maybe zef needs to check on precomp?