Skip to content

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

@SirLynix

Description

@SirLynix

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:

  • xmake version: xmake v2.3.9+202011250023
  • os: Windows 10 2004
  • target platform: Windows

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions