-
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
Symlinking issues on Windows - Compile fails if build and src folder is on different drives. #5751
Comments
The problem here is that on Windows we are actually creating hard links to these files, rather than the symbolic links claimed by the comment in front of the This was changed by commit
merged as part of #1699 in 2018. This suggests that we either use symbolic links and require elevated permissions to build on Windows, or keep hard links but then can't build on a different volume. |
This came up as an issue in esp-idf, as some users are no longer able to build their project after the mbedtls version used in SDK was upgraded. Maybe someone could help me understand why we need to |
@mpg or @gilles-peskine-arm can you answer the question ^ above? This relates to the comment https://github.com/Mbed-TLS/mbedtls/pull/4514/files#r707221450 in #4514 |
Some files, like Regarding |
Thanks for the quick feedback from both of you! Linking it to the build-tree makes total sense, it was just that I couldn't actually see this linked/generated file being used anywhere in the build process that makes me a bit confused. If being to able to compile on a separate volume is not something you will prioritize supporting (which is understandable!) we might just patch out this |
I don't think there's another reason. IIRC the first version of this PR was putting (some of) the generated files in the source tree and it was working fine, so I think the reason we're generating them in the build tree just trying keep the source tree clean as matter of principle. (Like, in principle your source tree could read-only and that shouldn't prevent you from building out-of-tree.) Now, for uniformity between builds where |
Mbed TLS maintenance tends to attract people who are familiar with C and cryptography but often not with Windows and CMake. So it's quite possible that we're doing the wrong thing and not realizing it. In terms of priorities, Windows is not our most important build platforms. But if you have a patch that works for you, and it doesn't seem to break other uses, we would welcome it. Since this is a somewhat unusual case on a non-first-tier platform, we wouldn't insist on a non-regression test. |
This was already an issue in 2.2x, and still is in 2.28. Windows 10, cmake 3.25.1, Mbed TLS at 3917028 (shortly before mbedtls-2.28.2),
In contrast the same command works if I point it at 80f8c67 (shortly before mbedtls-3.3, with #6188), or at 2.28 plus a cherry-pick of the one commit of #6188. |
Summary
After Generated files cmake was merged it seems like it is no longer possible to build the project on Windows if the source tree and the build tree are on different drives.
error.c
andversion_features.c
are now always linked withlink_to_source
, but this function fails to create symlinks if the build conditions are as described earlier.Error log:
System information
Mbed TLS version (number or commit id): Release "Mbed TLS 3.1.0"
Operating system and version: Windows 10
Expected behavior
Fails during compilation due to unable to create symlinks.
Actual behavior
Successfully compiles.
Steps to reproduce
Run
cmake /path/to/mbedtls_source
from a folder located on a different drive from the source tree.The text was updated successfully, but these errors were encountered: