Galzzly / extract

MIT License
0 stars 0 forks source link

Errors running on MacOS #2

Closed spatel-wd closed 2 years ago

spatel-wd commented 3 years ago

Describe the bug Binary did not run on MacOS https://github.com/Galzzly/extract/releases/download/v1.0.0/extract_1.0.0_darwin_amd64.tar.gz

To Reproduce ./extract Looking at archive extract ... Unable to process right now Looking at archive extract_1.0.0_darwin_amd64.tar.gz ... panic: archive/tar: invalid tar header goroutine 1 [running]: github.com/Galzzly/extract.Check(...) /home/liamg/go/src/github.com/Galzzly/extract/error.go:5 github.com/Galzzly/extract.Tar(0x1254ba0, 0xc0000e8000, 0x121341c, 0x2, 0x0, 0x3) /home/liamg/go/src/github.com/Galzzly/extract/extr.go:79 +0x545 github.com/Galzzly/extract.Gzip(0x1254e20, 0xc0000ae290, 0x121341c, 0x2, 0x0, 0x0) /home/liamg/go/src/github.com/Galzzly/extract/extr.go:62 +0x425 main.extr(0xc0000ac093, 0x21, 0x12134b6, 0x2, 0x121627c, 0x10) /home/liamg/go/src/github.com/Galzzly/extract/cmd/extract/main.go:96 +0x3bc main.main() /home/liamg/go/src/github.com/Galzzly/extract/cmd/extract/main.go:76 +0x629

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information): uname -a Darwin WANdiscos-MacBook-Pro-3.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64

Additional context Same issue on CentOS 7: [root@spatel02-vm4 livedata-migrator]$ extract Looking at archive apr01.tar.gz ... panic: archive/tar: invalid tar header

goroutine 1 [running]: github.com/Galzzly/extract.Check(...) /home/liamg/go/src/github.com/Galzzly/extract/error.go:5 github.com/Galzzly/extract.Tar(0x65ab60, 0xc000138840, 0x61921a, 0x2, 0x0, 0x4b9925) /home/liamg/go/src/github.com/Galzzly/extract/extr.go:79 +0x545 github.com/Galzzly/extract.Gzip(0x65ae20, 0xc0000102a8, 0x61921a, 0x2, 0x0, 0x0) /home/liamg/go/src/github.com/Galzzly/extract/extr.go:62 +0x425 main.extr(0xc0000183c3, 0xc, 0x6192b4, 0x2, 0x61c22e, 0x10) /home/liamg/go/src/github.com/Galzzly/extract/cmd/extract/main.go:96 +0x3bc main.main() /home/liamg/go/src/github.com/Galzzly/extract/cmd/extract/main.go:76 +0x629 [root@spatel02-vm4 livedata-migrator]$ uname -a Linux spatel02-vm4.bdfrem.wandisco.com 3.10.0-1062.7.1.el7.x86_64 #1 SMP Mon Dec 2 17:33:29 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux [root@spatel02-vm4 livedata-migrator]$ cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core)

On Devcon, it's the same binary as the one that you added on cs-analysis server

Galzzly commented 2 years ago

I've completely rebuilt the extract tool under version 2.0.0. I tested the extraction of the bundle that you linked to above extract_1.0.0_darwin_amd64, and this seemed to extract as expected.

$ extract -f extract_1.0.0_darwin_amd64.tar.gz -d test
extract_1.0.0_darwin_amd64.tar.gz extracted to test in 60.348214ms

Extraction complete in 60.564646ms
$  cd test
$  ls
extract_1
$  cd extract_1/
$  ls
extract  LICENSE  README.md

Version 2 can be found here