xmake-io / xmake

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

some files/Path error from executing xmake, in win10 subsystem (WSL) #512

Closed jason-fan closed 5 years ago

jason-fan commented 5 years ago

在win10的子系统(wsl.exe)下,执行xmake出现dos风格的文件及路径 ls -l total 12 -rwxrwxrwx 1 ubuntu ubuntu 521 Jul 26 14:21 'D:\cworks\cpp.xmake\vscode-build.log' drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 18 20:52 asio drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 19 20:05 build drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 26 10:21 'd:\cworks\cpp.xmake' drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 15 09:36 lua53 drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 24 09:49 modules drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 22 20:17 ravi drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 15 17:19 sol2 -rwxrwxrwx 1 ubuntu ubuntu 1522 Jul 26 14:15 xmake.lua

虽然可以编译通过,但有可能造成某些文件没有正确生成

waruqi commented 5 years ago

你执行xmake -v 贴下详细的编译输出,我看下

jason-fan commented 5 years ago

xmake -v configure { arch = x86_64 ccache = true mode = release ndk_stdcxx = true plat = linux kind = static buildir = build clean = true host = linux }

=============== Build test release ================= checking for the gcc ... /usr/bin/gcc checking for the c++ compiler (cxx) ... gcc checking for the ccache ... /usr/bin/ccache checking for the /usr/bin/gcc ... ok checking for the flags (-O3) ... ok [ 0%]: ccache compiling.release fullpath.cpp /usr/bin/ccache /usr/bin/gcc -c -fvisibility=hidden -O3 -m64 -I/usr/local/include -I/usr/include -o build/.objs/test/linux/x86_64/release/./fullpath.cpp.o fullpath.cpp checking for the flags (-MMD -MF) ... ok checking for the g++ ... /usr/bin/g++ checking for the linker (ld) ... g++ [100%]: linking.release test /usr/bin/g++ -o build/linux/x86_64/release/test build/.objs/test/linux/x86_64/release/./fullpath.cpp.o -s -fvisibility=hidden -lpthread -ldl -lm -lreadline -m64 -L/usr/local/lib -L/usr/lib

jason-fan commented 5 years ago

ls -lt total 8 drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 30 10:20 build drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 30 10:20 d: drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 30 10:20 'd:\cworks\testcpp.xmake' -rwxrwxrwx 1 ubuntu ubuntu 1364 Jul 30 10:19 fullpath.cpp -rwxrwxrwx 1 ubuntu ubuntu 1016 Jul 30 10:18 xmake.lua

jason-fan commented 5 years ago

tree . ├── build │ └── linux │ └── x86_64 │ └── release │ └── test ├── d: │ └── cworks │ └── testcpp ├── d:\cworks\testcpp.xmake ├── fullpath.cpp └── xmake.lua

waruqi commented 5 years ago

确实有点怪,你敲下 ls -a testcpp看下,有没有 .xmake目录,感觉像是 .xmake的配置目录生成到了 d:\cworks\testcpp.xmake

你再看下 你这是不是设置过 XMAKE_CONFIGDIR环境变量。

waruqi commented 5 years ago

另外,我看到有 'D:\cworks\cpp.xmake\vscode-build.log' ,你这是vscode下调用执行xmake? 如果cmd下,直接手动执行命令 会有这个问题么? 我好确认下 是否是 xmake-vscode插件的问题

jason-fan commented 5 years ago

是在vscode的终端下执行的, settings.json "terminal.integrated.shell.windows": "c:\windows\system32\bash.exe", "terminal.external.windowsExec": "c:\windows\system32\bash.exe"

另外启动一个wsl(bash.exe),xmake -v能正常编译,不会产生这些奇怪路径,可能是你说的vscode插件的问题

waruqi commented 5 years ago

那应该是xmake-vscode插件的问题。等回头我再看看。

waruqi commented 5 years ago

我这边暂时没环境,你也可以clone下xmake-vscode源码,用vscode打开后,点击调试运行后,帮忙在你这本地环境直接调试下 xmake-vscode插件,看看是哪里的path处理有问题。。

waruqi commented 5 years ago

我尝试性修复了下xmake-vscode插件,你更新下试试

jason-fan commented 5 years ago

更新后测试,没有问题了,谢谢!