Open anderslanglands opened 2 years ago
This is with cmd.exe as the shell by the way. With pwsh I get an even more baffling error:
CMake Error: The source directory "C:/Users/anders/AppData/Local/Temp/rez-cook/imath/3.0.5/build/platform-windows/arch-AMD64/.3" does not exist.
I've just been having a poke at it and I'm stumped. Even if I force the path to posix-style (with '/') when setting it in the env in cmake._add_build_actions()
then it still gets written to the tmp CMakeLists.txt with '\'. Of course CMake helpfully deletes that temporary file so can't actually inspect it, but still I guess the path's getting reverted to windows-style in the
-DCMAKE_MODULE_PATH=%CMAKE_MODULE_PATH%
expansion in the cmake command line.
Just for fun I tried changing the command line setting in cmake.build()
to:
cmake_path = os.path.join(os.path.dirname(__file__), "cmake_files")
cmd.append("-DCMAKE_MODULE_PATH=%s" %
pathlib.Path(cmake_path).as_posix())
which seems to work. Of course now I'm blowing away anything else that might be set in CMAKE_MODULE_PATH
so it's not a real solution.
OK so the fix is I think to change cmd's normalize_path():
def normalize_path(self, path):
# Don't convert to windows path here because windows paths are evil and
# CMake can't handle them
return path
Actually I would go further than this and do:
def normalize_path(self, path):
# Use POSIX paths because Windows understands them as well and CMake ONLY
# understands POSIX
import pathlib
return pathlib.Path(path).as_posix()
reason being that without this, if I set an environment variable as "{root}/blah" then {root} may get exapnded to windows-style which also breaks CMake. A great example is setting env.CMAKE_PREFIX_PATH = "{root}"
Ok, I don't see a problem with doing this. In terms of action items:
as_posix
for py2to_posix_path
there already, but it specifically converts to a format that git-bash uses. This should probably be moved into the gitbash plugin, and updated to use pathlib's as_posix
under the hood as it'll probably deal with edge cases like escaping whitespace better.For clarity, pathlib's as_posix
converts (eg) C:\foo\bah.txt
to C:/foo/bah.txt
.
Here's a simpler test case. Again, the build_requires = ["vs"]
just sets up the visual studio environment so cl, cmake etc can be found
rez_path_test.zip
.
Ugh of course it's not that simple as other windows programs (e.g. move) will interpret the "/" as a switch. Will have to try escaped slash "\" now...
Hi!
Any other fixes found here? Also getting this when using powerhsell
CMake Error: The source directory ".../build/.3" does not exist.
Thanks!
Unfortunately, I don't think any substantial progress has been made. Or at least I haven't heard of anything recently.
The thing is that we can patch stuff here and there, do hacks, etc but the problem is that it becomes hard to maintain. We need more investigation and a solid plan before we can move forward.
The issue is mainly tracked in https://github.com/AcademySoftwareFoundation/rez/issues/1302. Feel free to chip in.
We are also extremely limited in terms of resources right now and we also need to get the TSC up and running to get things rolling again.
3.0.5.zip
Trying to build Imath with the attached setup gives me:
Environment
To Reproduce