slynch8 / 10x

10x IDE/Editor
191 stars 35 forks source link

Build on a project fails with "Build failed. VSEnvBat not setup. Check your 'VisualStudioEnvBat' setting" while build spinner keeps spinning #2830

Closed santagada closed 2 weeks ago

santagada commented 1 month ago

After loading my solution and pressing build on the submenu of a project (or anywhere really, tried multiple build all, build file) opens the Build tab with the message: "Build failed. VSEnvBat not setup. Check your 'VisualStudioEnvBat' setting"

But that config is correct and executing the bat file (in default vs2022 professional install) works. I tried increasing the log level of 10x to get more info but this is all that seems to be produced around the pressing of the build on a single project:

23/09/2024 11:58:07: [10x] CreateWorkspaceTreeFinializer time: 104.27 ms
23/09/2024 11:58:07: [startup pulse]
23/09/2024 11:58:07: [startup pulse]
23/09/2024 11:58:08: [startup pulse]
23/09/2024 11:58:08: EnvVars exit code: 0
23/09/2024 11:58:08: 
23/09/2024 11:58:08: [10x] Initialising Visual Studio build environment complete.
23/09/2024 11:58:08: [startup pulse]
23/09/2024 11:58:09: [parser] Parsing files (28119)...
23/09/2024 11:58:09: [parser] Read cache complete
23/09/2024 11:58:09: [parser] Read cache time: 2705 ms
23/09/2024 11:58:09: [startup pulse]
23/09/2024 11:58:09: [parser] Finished reading workspace files
23/09/2024 11:58:09: [parser] Finished parsing
23/09/2024 11:58:09: [parser] Updating syntax highlighting...
23/09/2024 11:58:09: [parser] Finished updating syntax highlighting
23/09/2024 11:58:09: [parser] Parse complete
23/09/2024 11:58:09: [parser] total parse time: 110 ms  0 sec  (0:00)
23/09/2024 11:58:09: [parser] Parse complete
23/09/2024 11:58:09: [10x] Total memory: 4.66 GB
23/09/2024 11:58:09: [parser] Switching live database
23/09/2024 11:58:09: [startup pulse]
23/09/2024 11:58:10: [startup pulse]
23/09/2024 11:58:10: [startup pulse]
23/09/2024 11:58:11: [startup pulse]
23/09/2024 11:58:11: [startup pulse]
23/09/2024 11:58:12: [startup pulse]
23/09/2024 11:58:12: [startup pulse]
23/09/2024 11:58:13: [startup pulse]
23/09/2024 11:58:13: [startup pulse]
23/09/2024 11:58:14: [startup pulse]
23/09/2024 11:58:15: [startup pulse]
23/09/2024 11:58:15: [startup pulse]
23/09/2024 11:58:16: [startup pulse]
23/09/2024 11:58:16: [startup pulse]
23/09/2024 11:58:17: [startup pulse]
23/09/2024 11:58:17: [startup pulse]
23/09/2024 11:58:18: [startup pulse]
23/09/2024 11:58:18: [startup pulse]
23/09/2024 11:58:19: [startup pulse]
23/09/2024 11:58:19: App Focus Changed: false
23/09/2024 11:58:19: [startup pulse]
23/09/2024 11:58:20: [startup pulse]
23/09/2024 11:58:20: [startup pulse]
23/09/2024 11:58:21: [startup pulse]

here's the spinning building spinner:

image

Any way to debug this further? We build using nmake command.

slynch8 commented 1 month ago

Does it show Executing command: in your log file? It should show it before EnvVars exit code: 0

santagada commented 1 month ago
23/09/2024 11:58:05: Executing command: cmd.exe /c call "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\VsDevCmd.bat" > nul && "C:/Program Files/PureDevSoftware/10x/10x.exe" -logenv "C:/Temp/10xLogEnvOutput.txt"

the log starts with:

10X_INSTALL_DIR=C:\Program Files\PureDevSoftware\10x\
=::=::\
=C:=C:\Program Files\PureDevSoftware\10x
=ExitCode=00000000
=I:=I:\
<...>
WSLENV=
                P4PORT/u:P4IGNORE/u:GG_PROJECT/u:P4WORKROOT/up:GG_USEREMAIL/u:USERDNSDOMAIN/u

_NO_DEBUG_HEAP=1
__DOTNET_ADD_32BIT=1
__DOTNET_PREFERRED_BITNESS=32
__VSCMD_PREINIT_PATH=<...>

then all our env vars (some are confidential)

slynch8 commented 1 month ago

I'm guessing it doesn't like the multi-line WSLENV var. I'll try it here...

slynch8 commented 1 month ago

That does seem to be the problem. I'm not even sure how it's possible to set environment variable to be multi-line.

Can you see if this build fixes it: https://www.10xeditor.com/upload/10xVSEnvBatFix.zip

santagada commented 1 month ago

oh YEAH, this fixes it. I was also impressed with it, our team has the gift for these kinds of magic. Thanks for the fix, when this is released I'll delete this build

slynch8 commented 1 month ago

fix is in early access build (1.0.219)

santagada commented 1 month ago

tested on 1.0.220 and yeah still working perfectly. We also will fix the multi line env var on our side to not trip other tools.

slynch8 commented 2 weeks ago

fixed (1.0.230)