cljsjs / boot-cljsjs

Helper tasks to aid the packaging of JS dependencies for Clojurescript projects
66 stars 22 forks source link

Incorrect handling of tgz archives #49

Closed pbzdyl closed 6 years ago

pbzdyl commented 6 years ago

It looks that (at least some) tgz archives are not decompressed correctly (see cljsjs/packages#1342).

decompress flag in download task or standalone decompress task just ungzips just files into a single tar file without untaring it.

pbzdyl commented 6 years ago

It looks that it's broken by #45. When I revert it then decompressing or tgz files work correctly.

Deraen commented 6 years ago

Hmhm, looking into this. Tgz file should support marks, so it should work... hm

pbzdyl commented 6 years ago

I checked that TarArchiveInputStream doesn't support marks. I think commons-compress doesn't support detection if an archiver is needed or not (in case of gzip files with only one files only CompressorInputStream should be used without wrapping it into ArchiveInputStream). I guess we would need to make a best guess based on the file extension and fallback to explicit configuration (e.g. don't use archiver at all if it's not configured with :archive-format.

Deraen commented 6 years ago

Yeah perhaps .markSupported is wrong thing to check here. Removing that fixes this, I'll check some other use cases.

pbzdyl commented 6 years ago

Removing it fixes tar.gz case but breaks gz files with a single file inside.

Deraen commented 6 years ago

https://github.com/cljsjs/boot-cljsjs/commit/6aac3cf299c7acd22a1b49a6d6639d0f6262ef42

Checking if stream is ArchiveInputStream fixes single gz files.

Deraen commented 6 years ago

Fix released, new firebase should be deployed in a moment.

pbzdyl commented 6 years ago

👍 I have tested 0.8.1 version locally and it works! Thank you!