devcontainers-contrib / nanolayer

45 stars 15 forks source link

GH-release does not decompress binaries that are compressed only with .gz without .tar #41

Closed AnimMouse closed 1 year ago

AnimMouse commented 1 year ago

When installing binaries using gh-release that are only compressed with .gz without .tar, it installs the .gz file without decompressing it, causing the binary not to work.

/workspaces/codespaces-blank $ sudo nanolayer install gh-release jpillora/chisel chisel
'chisel_1.8.1_checksums.txt' filtered by '(\.sig$|\.text$|\.txt$|[Cc]hecksums|sha256|\.sha1$|\.md5$)' (negative)
'chisel_1.8.1_darwin_amd64.gz' filtered by '([Mm]ac[Oo][Ss]|[Mm]ac\-[Oo][Ss]|\-osx\-|_osx_|[Dd]arwin|\.dmg)' (negative)
'chisel_1.8.1_darwin_arm64.gz' filtered by '([Aa]rm64|ARM64|-ARM)' (negative)
'chisel_1.8.1_linux_386.gz' filtered by '(i386|-386|_386)' (negative)
'chisel_1.8.1_linux_arm64.gz' filtered by '([Aa]rm64|ARM64|-ARM)' (negative)
'chisel_1.8.1_linux_armv6.gz' filtered by '([Aa][Rr][Mm]v6)' (negative)
'chisel_1.8.1_linux_armv7.gz' filtered by '([Aa][Rr][Mm]v7)' (negative)
'chisel_1.8.1_linux_ppc64.gz' filtered by '(-ppc|ppc64|PPC64|_ppc)' (negative)
'chisel_1.8.1_linux_ppc64le.gz' filtered by '(-ppc|ppc64|PPC64|_ppc)' (negative)
'chisel_1.8.1_linux_s390x.gz' filtered by '(s390x|s390)' (negative)
'chisel_1.8.1_windows_386.gz' filtered by '(i386|-386|_386)' (negative)
'chisel_1.8.1_windows_amd64.gz' filtered by '(windows|Windows|WINDOWS|win32|\-win\-|\.msi$|.msixbundle$|\.exe$)' (negative)
'chisel_1.8.1_windows_arm64.gz' filtered by '([Aa]rm64|ARM64|-ARM)' (negative)
'chisel_1.8.1_windows_armv6.gz' filtered by '([Aa][Rr][Mm]v6)' (negative)
'chisel_1.8.1_windows_armv7.gz' filtered by '([Aa][Rr][Mm]v7)' (negative)
'chisel_1.8.1_linux_mips64le_hardfloat.gz' filtered by '([Aa]md64|-x64|x64|x86[_-]64)' 
'chisel_1.8.1_linux_mips64le_softfloat.gz' filtered by '([Aa]md64|-x64|x64|x86[_-]64)' 
'chisel_1.8.1_linux_mips64_hardfloat.gz' filtered by '([Aa]md64|-x64|x64|x86[_-]64)' 
'chisel_1.8.1_linux_mips64_softfloat.gz' filtered by '([Aa]md64|-x64|x64|x86[_-]64)' 
'chisel_1.8.1_linux_mipsle_hardfloat.gz' filtered by '([Aa]md64|-x64|x64|x86[_-]64)' 
'chisel_1.8.1_linux_mipsle_softfloat.gz' filtered by '([Aa]md64|-x64|x64|x86[_-]64)' 
'chisel_1.8.1_linux_mips_hardfloat.gz' filtered by '([Aa]md64|-x64|x64|x86[_-]64)' 
'chisel_1.8.1_linux_mips_softfloat.gz' filtered by '([Aa]md64|-x64|x64|x86[_-]64)' 
'chisel_1.8.1_linux_amd64.gz' filtered by '(?i)(ubuntu)' 
'chisel_1.8.1_linux_amd64.gz' filtered by '.*static.*' 
'chisel_1.8.1_linux_amd64.gz' filtered by '(?i)(debian)' 
resolved asset: chisel_1.8.1_linux_amd64.gz
asset recognized as a binary

/workspaces/codespaces-blank $ chisel
bash: /usr/local/bin/chisel: cannot execute binary file: Exec format error

/workspaces/codespaces-blank $ sha256sum /usr/local/bin/chisel
0461e84f847489e8968b011128b6be6b001f487ae75b2a0c14ff6d4eafc9f2df  /usr/local/bin/chisel

The compressed file chisel_1.8.1_linux_amd64.gz has SHA256 of 0461e84f847489e8968b011128b6be6b001f487ae75b2a0c14ff6d4eafc9f2df.

The binary file chisel_1.8.1_linux_amd64 has SHA256 of c237f1a3f75b2759f66ec741448bb352e95e186a9a689f87c8641b44a13d878b

danielbraun89 commented 1 year ago

thanks for reporting! now works on latest version