-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Copy files instead of hard-linking on Windows #6188
Copy files instead of hard-linking on Windows #6188
Conversation
21419a6
to
2238942
Compare
@N3xed Would you consider using I think file(COPY) has two downsides:
|
Fixes an issue on Windows where when source and build directory are on different drives hard-linking to files or directory fails as it doesn't work across filesystem boundaries. Note that symlinking is also not possible because it requires administrator privileges on Windows. The solution copies the files using the built-in cmake `configure_file(src dest COPYONLY)` command. As this command only operates on files, if a directory is specified the files will be globbed recursively and through symlinks. Signed-off-by: Dominik Gschwind <[email protected]>
2238942
to
c6d1636
Compare
I think this would be better, indeed. But as a result, when a directory is specified, the files are now globbed because Additionally, instead of copying every time on Windows, we could check if the |
Thant makes sense to me, I think copying is simpler and more reliable than detecting if files are on the same drive. |
Looks like this version passed CI, so at least it doesn't break anything it seems. From the perspective of the esp-idf project where the issue was originally reported, this change looks good to me. Hope it can be merged upstream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just commenting so that the pr-merge job runs again tonight. |
Description
Fixes an issue on Windows where when the source and build directory are on different drives hard-linking to files or directory fails as it doesn't work across filesystem boundaries.
Note also that symlinking is also not possible because it requires administrator privileges on Windows.
The solution copies the files using the built-in cmakefile(COPY)
command.The solution copies the files using the built-in cmake
configure_file(src dest COPYONLY)
command.As this command only operates on files, if a directory is specified the files will be globbed recursively
and through symlinks.
Status
READY
Additional comments
Fixes #5751
Todos