Closed TheLartians closed 4 years ago
@TheLartians You probably need to refresh the env to use the updated path.
Chocolatey spits this out after install LLVM
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type `refreshenv`).
Oooh I see let's try that
nope, that wasn't it
Hmm I'm not sure then, that's odd. Is there any way to tell the script where clang-format
is for the purpose of the CI? It'll be in C:\Program Files\LLVM\bin\clang-format.exe
.
Theoretically yes, you could pass the --binary path/to/clang/format
flag to the python script. But we'd have to tunnel that through Cmake somehow. I just wonder why it's not finding clang-format automatically though.
Couldn't you do a find_program
call in cmake and pass that into the script that way?
Something like:
find_program(CLANG_FORMAT_PROGRAM clang-format${CMAKE_EXECUTABLE_SUFFIX})
if(NOT EXISTS ${CLANG_FORMAT_PROGRAM})
message(FATAL_ERROR "Clang format is required!")
endif()
// pass ${CLANG_FORMAT_PROGRAM} to the python script...
let's find out
cmake --build build --target format
MSBUILD : error MSB1009: Project file does not exist.
Switch: format.vcxproj
Hm is that not how you invoke CMake targets in Windows?
Ah it still didn't find clang-format: clang-format not found: not adding Format.cmake targets
(I didn't want it to error by default as it could break otherwise perfectly fine projects)
Yeah, I just tried this as well locally using Windows Sandbox and I'm actually able to reproduce it not being able to find clang format automatically. I'll see if I can figure out a fix.
Thanks! Testing locally is much more fun than waiting 3 minutes on the CI for every change 😅
So I copied this stackoverflow answer to convert the exit codes to booleans and it worked for the simple case of -not
. However the combination with -and
still throws it off. This is a nightmare.
Holy s*** that worked
So apparently windows has a bash shell. Hell just froze over.
I wonder if it's git bash or similar, glad it worked!
Edit:
Actually Windows now has built in support for Linux subsystems as well so it could be one of those 🤷
Thanks for the help :)
So that didn't work :( Still have to learn more about the platform before I can set up a CI workflow it seems. I'll come back another time.