xmake-io / xmake

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

XMake uses a truncated path for its cache when using vsxmake2019 #1132

Closed SirLynix closed 3 years ago

SirLynix commented 3 years ago

Describe the bug

Okay it's a bit weird.

I have a project in C:\Projets\Burgwar\BurgWar on my computer, and I noticed that sometimes a C:\Projets\Burgwar\BurgW appeared, with a .xmake folder in it.

I investigated and it seems to occur when using vsxmake generator.

Expected behavior

That xmake uses the right full path.

Related Environment

Please provide compiling and running environment information:

Additional context

To reproduce (on Windows):

PS C:\Projets\Tests\xmake-build>
PS C:\Projets\Tests\xmake-build> xmake create -t console -l c++ test_path
PS C:\Projets\Tests\xmake-build> cd .\test_path\
PS C:\Projets\Tests\xmake-build\test_path> xmake project -k vsxmake2019

Opens the visual studio solution and use it to build.

In my case a C:\Projets\Tests\xmake-build\test_pat folder appeared.

I added a

        print(config.directory())

in xmake/core/project/project.lua which shows this in Visual Studio to confirm:

1>$xmake config -P . -y -p windows -m debug -a x64 -o "build"
1>checking for Microsoft Visual Studio (x64) version ... 2019
1>C:\Projets\Tests\xmake-build\test_pat\.xmake\windows\x64

Notice the missing h.

Edit: it seems to come from the XMAKE_CONFIGDIR env, when enabling diagnosis informations in vsxmake I get this:

1>    _XmakeEnv: 
1>      
1>      chcp 65001 > NUL
1>      pushd C:\Projets\Tests\xmake-build\test_path\
1>      set XMAKE_CONFIGDIR=C:\Projets\Tests\xmake-build\test_pat
1>      set XMAKE_PROGRAM_DIR=C:\Program Files\xmake
1>      set XMAKE_SKIP_HISTORY=1
1>      set XMAKE_IN_VSTUDIO=1
waruqi commented 3 years ago

I have fixed it on dev branch.

SirLynix commented 3 years ago

Seems good. Thank you!

AntoineJT commented 3 years ago

I still have the bug, even with the latest xmake version, following a xmake update -s, and an updated VS2019.

D:\GitHub\chip8-emulator>xmake --version
xmake v2.3.9+202011250023, A cross-platform build utility based on Lua
Copyright (C) 2015-present Ruki Wang, tboox.org, xmake.io
                         _
    __  ___ __  __  __ _| | ______
    \ \/ / |  \/  |/ _  | |/ / __ \
     >  <  | \__/ | /_| |   <  ___/
    /_/\_\_|_|  |_|\__ \|_|\_\____|
                         by ruki, xmake.io

    ��  Manual: https://xmake.io/#/getting_started
    ��  Donate: https://xmake.io/#/sponsor

image image image

waruqi commented 3 years ago

You can download latest package and try it again from ci. https://github.com/xmake-io/xmake/suites/1692663518/artifacts/31789098