tony-o / raku-fez

This project is for 'fez', raku's cool new shiny dist uploader & manager. If you're a module author you should definitely be using this sweet thang. ;;;;;;;;;;;;;; This project and the underlying infrastructure is supported out of my own pocket and through donations. If you'd like to donate please check here: https://www.patreon.com/oynot
Artistic License 2.0
20 stars 12 forks source link

Upload fails on OpenBSD #38

Closed andinus closed 2 years ago

andinus commented 3 years ago

I tried uploading a module after applying https://github.com/tony-o/raku-fez/issues/36#issuecomment-828699340.

Upload fails with:

andinus@hafnium ~/projects/caelum> fez upload
>>= Looking in "sdist/EriMxzV6.tar.gz" for META6.json
=<< Unable to find META6.json

META6.json is present in the file:

andinus@hafnium ~/projects/caelum/sdist> tar tvzf EriMxzV6.tar.gz
...
-rw-rw-r--  1 root     wheel          577 Apr 29 13:15 META6.json
...

checkbuild here tries extracting the archive with tar x0f: https://github.com/tony-o/raku-fez/blob/6051f281ad83d5145fb50da0fb2ec8b2dcc0b6c1/lib/Fez/CLI.rakumod#L109

andinus@hafnium ~/projects/caelum/sdist> tar x0f EriMxzV6.tar.gz META6.json
tar: input compressed with gzip; use the -z option to decompress it

Adding z should fix this:

andinus@hafnium ~/projects/caelum/sdist> tar xz0f EriMxzV6.tar.gz META6.json ; echo $?
0
tony-o commented 3 years ago

I need to test this fix on OSX and it should be good to go

tony-o commented 3 years ago

@andinus this should be fixed, pushing it right now

tony-o commented 3 years ago

No idea why this keeps getting closed.

patrickbkr commented 3 years ago

tony-o: Merging a PR or pushing a commit with the message containing "fix[es]? #some_number" triggers GitHub to automatically close the respective issue.

tony-o commented 3 years ago

The first one I understood, the second one I'm unsure

andinus commented 3 years ago

It still fails to find META6.json.

andinus@hafnium ~/projects/caelum> fez upload
>>= Looking in "sdist/NgBSEb9Z.tar.gz" for META6.json
=<< Unable to verify meta, no tar found.
>>= Upload anyway (y/N)? ^C
andinus@hafnium ~/projects/caelum> tar tvzf sdist/NgBSEb9Z.tar.gz                                                                
[...]
-rw-rw-r--  1 root     wheel          577 Apr 29 13:15 META6.json
[...]
tony-o commented 3 years ago

Looking at this it seems to an issue with openbsd's tar, @andinus i'm not as familiar with openbsd - is there a way to cat a file from the archive directly with tar?

https://unix.stackexchange.com/a/394131

tony-o commented 3 years ago

In the meantime you should be able to upload anyway and you'll get an email about what fails in that package if it can't be indexed

andinus commented 3 years ago

I don't think it is possible with bsdtar.

upload anyway works. There is gtar in ports, so we could do something like:

if bsd - run `which tar` 
  - if exits with 2 - say "gtar not found - use `upload anyway`"
  - if exits with 0 - use gtar
tony-o commented 3 years ago

Seem like a reasonable compromise to suggest a skip if BSD and no gtar found?

andinus commented 3 years ago

I would say yes. If fez checks for files before the archive creation then we're just trusting bsdtar to return correct exit code. If it returns 0, we assume files are present in the archive & skip the check.

andinus commented 3 years ago

I recall this working on OpenBSD earlier but now it exits without prompting for Upload anyway:

andinus@ ~/d/p/fornax (main)> fez upload
>>= Looking in "sdist/UUuP9ND3.tar.gz" for META6.json
=<< Unable to find META6.json

Symlinking gtar to tar fixes this.

tony-o commented 2 years ago

@andinus can you checkout the pax branch and see if this resolves the issue for you?

andinus commented 2 years ago

It works! Thanks!

...> fez upload
>>= Looking in "sdist/zQ4Xrjde.tar.gz" for META6.json
>>= meta<provides> looks OK
>>= meta<resources> looks OK
>>= orion:ver<0.2.4>:auth<zef:andinus> looks OK
>>= Hey! You did it! Your dist will be indexed shortly.
andinus commented 2 years ago

However, it does not remove "sdist/" directory, is that intended behavior?

tonyooooooo commented 2 years ago

It should remove the sdist/ dir - will test before releasing -

tony-o commented 2 years ago

Okay - pax now included with v38

andinus commented 2 years ago

Tested on OpenBSD 7.2, works!

Thank you :)