xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.87k stars 776 forks source link

Improve extract tarball package on windows. #5538

Closed star-hengxing closed 1 month ago

star-hengxing commented 1 month ago

Is your feature request related to a problem? Please describe.

7z extract tarball: package.tar.gz -> package.gz -> src Use tar: package.tar.gz -> src

Describe the solution you'd like

Use busybox tar ... https://frippery.org/busybox

Describe alternatives you've considered

No response

Additional context

No response

waruqi commented 1 month ago

Does it support to extract 7z/bz2/xz?

waruqi commented 1 month ago

看了下,除了 7z 其他的基本都支持,不过 xmake-repo 有些包是 7z 的。。不然倒是可以将 7z 替换成这个。。安装包还小点

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


After looking at it, except for 7z, everything else is basically supported, but some xmake-repo packages are for 7z. . Otherwise, you can replace 7z with this one. . The installation package is a bit smaller

star-hengxing commented 1 month ago

现在上规模的大型库,解压两次实在太慢。反正只给 Windows 用,多带一个工具感觉没啥问题。 而且如果用户使用 scoop 安装这个包,scoop 会自动创建好 tar shim ,命令行可以直接用。所以看下 xmake 解压缩模块怎么支持就行。

waruqi commented 1 month ago

我是想做减法,目前塞了 7z.exe 和 curl.exe 。。我都想去掉。。我看 busybox 里有 wget ,要是它还是支持 7z ,我都可以把前两都去了,只塞 busybox。

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Nowadays, for large-scale libraries, decompressing them twice is too slow. Anyway, it’s only for Windows, so it doesn’t feel like a problem to bring an extra tool. And if the user uses scoop to install this package, scoop will automatically create the tar shim, which can be used directly from the command line. So just look at how the xmake decompression module supports it.

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


I want to do subtraction, and currently I have 7z.exe and curl.exe stuck. . I want to get rid of them all. . I see wget is included in busybox. If it still supports 7z, I can remove the first two and only add busybox.

waruqi commented 1 month ago

而且塞 busybox 还不好塞。。

  1. x86 下打包 busybox.exe
  2. win7 x64 得打包 busybox64.exe
  3. win10 x64 以上得打包 busybox64u.exe
  4. win arm64 得用 busybox64a.exe

而且 arm 版本的二进制似乎会很慢

A binary for 64-bit Windows on ARM systems is provided as busybox64a.exe. It's 669,696 bytes in size. Take care to download this binary for Windows on ARM: binaries for other architectures will run, slowly and imperfectly, as emulations.

另外,这个走的也是 mingw64 编译的,估计也不会太快。

waruqi commented 1 month ago

我看 win10 以上好像自带 tar 么。。tar.gz/zip 本身就能解,可以优先用。。不过需要过滤掉 msys2 下的 tar

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


I think win10 or above seems to come with tar. . tar.gz/zip can be solved by itself and can be used first. . But you need to filter out the tar under msys2

waruqi commented 1 month ago
  1. win tar 能解压 .tar.gz, .tar. zip
  2. msys2 不能解压 .zip,但是能解压 .tar .tar.gz, tar.bz2 ..

所以 优先尝试用 tar 去解压 tar.gz 应该还是可以的。。你试试

https://github.com/xmake-io/xmake/pull/5540

star-hengxing commented 1 month ago

https://github.com/xmake-io/xmake/pull/5540

不行,看 log 好像都没去 find tar

waruqi commented 1 month ago

再试试

star-hengxing commented 1 month ago

成功用 tar 解压了,但用 xmake l scripts\test.lua --shallow -v 解压时会打印目录文件路径刷屏

waruqi commented 1 month ago

再试试

star-hengxing commented 1 month ago

完美了。

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


try again

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Successfully decompressed with tar, but when decompressing with xmake l scripts\test.lua --shallow -v, the print directory file path will be flushed.

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


try again

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Perfect.