Skip to content

WSL2 all_tests.exe fails #146

@Nickrader

Description

@Nickrader

Workaround

Copy maps folder in project to maps folder in Windows
https://aiarena.net/wiki/maps/


Map paths problem.

Not sure how he got it to work?
6709720#diff-af936db1633489b017d1e45a55448545529ebc354aeb40eda83af5db7317a6e1R161
Error:

root@DESKTOP-4EN0ECU:~/cpp-sc2# ./build/bin/all_tests.exe
Running test: sc2::TestAbilityRemap
Launched SC2 (C:\Program Files (x86)\StarCraft II\Versions\Base92440\SC2_x64.exe), PID: 1792
Connecting to 127.0.0.1:8167...
Failed to establish websocket connection: connect(127.0.0.1:8167): timeout
Failed to establish websocket connection: connect(127.0.0.1:8167): timeout
Connected to 127.0.0.1:8167
CreateGame request returned an error code: Invalid Map Path
CreateGame request returned error details: map_path '\\wsl.localhost\Ubuntu\root\cpp-sc2\map
s\Test/Empty.SC2Map' file doesn't exist.
Failed to create game.

The map path is hardcoded to the project directory as a unix path separator, / {Test/Empty.SC2Map}.

const char* kMapEmpty = "Test/Empty.SC2Map";

When I change the source to use a Windows path separator, it reports Invalid Map Path, even though I can list the file using that path.

Coding path (sc2::kMapEmpty) with \ and copying map to my user created Windows maps, C:\Program Files (x86)\StarCraft II\Maps\ {https://aiarena.net/wiki/maps/} gives error, mangling the map path constant:

CreateGame request returned an error code: Invalid Map Path
CreateGame request returned error details: map_path 'C:\Program Files (x86)\StarCraft II\Map
s\Testpty.SC2Map' file doesn't exist.

Solution:

Supply path to bot, using Windows maps. https://aiarena.net/wiki/maps/
For all_tests.exe copy map to Windows & escape directory path separator. i.e. Test\\Empty.SC2Map

Other: Maybe because I'm running WSL as root and didn't create a user? IDK, maybe one day I'll dig deeper, but seems a WSL oddity because Powershell is able to find.

PS C:\Users\nickr> ls \\wsl.localhost\Ubuntu\root\cpp-sc2\maps\Test\Empty.SC2Map


    Directory: \\wsl.localhost\Ubuntu\root\cpp-sc2\maps\Test


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
------         7/19/2024   3:40 AM          23792 Empty.SC2Map

https://github.com/Nickrader/cpp-sc2/tree/fix-wsl2_paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions