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

xpack的打包程序不能正确识别中文路径 #5279

Closed 24bit-xjkp closed 2 months ago

24bit-xjkp commented 3 months ago

Xmake 版本

v2.9.3

操作系统版本和架构

Windows 11 24H2

描述问题

-- xmake.lua
includes("@builtin/xpack")
xpack("test")
    set_formats("srczip")
    add_sourcefiles("*.txt")
    set_version("1.0")
xpack_end()

而当前目录下有两个文件english.txt中文.txt。 但打包得到的zip里只有english.txt

期待的结果

可以正确的识别中文路径,并完成打包。

工程配置

test.zip

附加信息和错误日志

xmake pack -o install -vD
packing install\test-src-1.0.zip .. 
> copy english.txt to build\.xpack\test\source\srczip\english.txt
> copy 中文.txt to build\.xpack\test\source\srczip\中文.txt
zip C:\Users\2283\Desktop\test\install\test-src-1.0.zip -9 -r -@
pack ok

看起来xmake可以正确复制带中文路径的文件,但是打包程序zip并不能打包带中文路径的文件。 我的Windows本地化环境是GBK,未验证切换为utf8后是否会解决问题。

Issues-translate-bot commented 3 months ago

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


Title: xpack's packager cannot correctly identify Chinese paths

waruqi commented 3 months ago

看起来xmake可以正确复制带中文路径的文件,但是打包程序zip并不能打包带中文路径的文件。

那不应该是 zip 的问题么。。

Issues-translate-bot commented 3 months ago

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


It seems that xmake can correctly copy files with Chinese paths, but the packaging program zip cannot package files with Chinese paths.

Shouldn't that be a problem with zip? .

24bit-xjkp commented 3 months ago

看起来xmake可以正确复制带中文路径的文件,但是打包程序zip并不能打包带中文路径的文件。

那不应该是 zip 的问题么。。

但如果它是通过add_targets引入的,又能正常打包了,所以也不确定是不是完全是zip导致的。比如这样

-- xmake.lua
includes("@builtin/xpack")
target("中文")
    add_files("a.cpp")
target_end()

xpack("test")
    set_formats("zip")
    add_targets("中文")
    set_version("1.0")
xpack_end()

生成的压缩包里又有中文.exe

Issues-translate-bot commented 3 months ago

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


It seems that xmake can correctly copy files with Chinese paths, but the packaging program zip cannot package files with Chinese paths.

Shouldn't that be a problem with zip? .

But if it is introduced through add_targets, it can be packaged normally, so I am not sure whether it is completely caused by zip. Like this

--xmake.lua
includes("@builtin/xpack")
target("Chinese")
    add_files("a.cpp")
target_end()

xpack("test")
    set_formats("zip")
    add_targets("Chinese")
    set_version("1.0")
xpack_end()

There is another Chinese.exe in the generated compressed package.

waruqi commented 2 months ago

这不在的么,好好的

image
24bit-xjkp commented 2 months ago

这不在的么,好好的

image

image

但我这里确实只有english.txt,如果不能复现就关了吧

Issues-translate-bot commented 2 months ago

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


这不在的么,好好的

image

image

但我这里确实只有english.txt,如果不能复现就关了吧