-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symlinking on Windows needs privilege #350
Comments
I tried with So now I'll go with I haven't yet dug very deeply into the functionality here. Could this also be implemented without symlinking? |
This is a bit of a head scratcher. The Windows command line tool mklink does not require elevation to create a symbolic link within the user context. However, it seems like cmake is calling the system API directly and failing. I'll need to dig in a bit more, but a quick workaround would be to call mklink as suggested here - https://stackoverflow.com/questions/61243174/replacement-of-create-symlink-in-windows. |
I also needed privileges for a symbolic link using mklink, unfortunately. |
Note: hardlink doesn't need privileges (mklink /h ...) works fine |
Yeah, a https://gitlab.kitware.com/cmake/cmake/-/merge_requests/2144 suggests |
I just ran into this. I'm migrating a toolchain from Could it be #327 now also complicates / requires this (ie: symlinks)? What's puzzling is that I'm asking Colcon to do a I'm not sure I completely understand |
Hmm, yeah, it does. It is unconditionally creating symlinks to build the egg in the build tree off of sources that are in the source tree (w/o affecting the source tree). This ensures symlink installs work, but breaks things on Windows... (I feel like a man yelling at clouds).
@gavanderhoorn perhaps the solution is to fallback to a copy if creating a symlink fails. Symlink installs are not possible anyways if that's the case. |
What would be the way forward? This is currently completely blocking my efforts to migrate to Galactic. But I must admit I'm easily getting lost in all the |
Let me see if I can put together something quickly. |
As far as I understand, in the default configuration symlinking on Windows needs special privileges.
Here
ament_cmake/ament_cmake_python/cmake/ament_python_install_package.cmake
Lines 108 to 121 in 84e1cea
the CMake tries to create some symlink which fails when building from an average user:
A "hard link" should be fine, though.
cc @ooeygui are you aware of other fixes?
Also PS: for the conda installation one doesn't need admin privileges, and it would be quite annoying to change that for symlinks :)
There is apparently a way to allow users to create symlinks: https://community.perforce.com/s/article/3472#:~:text=Create%20Symbolic%20Links%20Privilege&text=Open%20Control%20Panel%2D%3EAdministrative%20Tools,Administrators%20group%2C%20add%20the%20user.
The text was updated successfully, but these errors were encountered: