pspdev / psp-packages

https://pspdev.github.io/psp-packages/
The Unlicense
24 stars 13 forks source link

Automated builds from tar archives are not working #91

Closed sharkwouter closed 1 year ago

sharkwouter commented 1 year ago

Summary

It turns out that the file command is broken, which is used by the makepkg command. This makes makepkg think that tar.gz files are gzip archives, making it use gzip to extract it. The result is that tar files are not extracted fully, causing failures.

Details

The makepkg command uses the following file command:

file -S -bizL -- "$file"

The file variable is set to the archive name.

Here is an example in what that results in on alpine:

application/x-empty; charset=binary compressed-encoding=application/gzip; charset=binary

On Arch and Debian 12 (which use the same version of file) this results in the following with the same file:

application/x-tar; charset=binary compressed-encoding=application/gzip; charset=binary

This is not fixed on alpine edge.

Possible solutions

At the moment I see the following options:

sharkwouter commented 1 year ago

Here is how the arch package is build: https://gitlab.archlinux.org/archlinux/packaging/packages/file/-/blob/main/PKGBUILD#L33

Here is how the alpine package is build: https://git.alpinelinux.org/aports/tree/main/file/APKBUILD#n25

sharkwouter commented 1 year ago

There is a fix for it upstream in file, but it is not available in a new release yet: https://github.com/file/file/commit/1dd21dd360472d7b830825df8e40a06cdc1cbbcf

I tested this fix and it did not resolve the problem.

sharkwouter commented 1 year ago

I made an upstream issue: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15047

sharkwouter commented 1 year ago

This was resolved upstream now in Alpine 3.18. I'll test it out

sharkwouter commented 1 year ago

This has been resolved now thanks to the upstream fix.