- Notifications
You must be signed in to change notification settings - Fork48
Link MSVC runtime library statically#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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
This change makes all CMake targets to use `-MT`/`-MTd` compilationflags for Windows MSVC builds. This way the MSVC runtime library islinked statically and the workaround for VS2019 described induckdb/duckdb#17991 is no longer necessary.`extension-ci-tools` PR:duckdb/extension-ci-tools#276Ref:duckdblabs/duckdb-internal#2036
staticlibs commentedOct 17, 2025
The Python build setup is complex, it is not clear that this CMake flag covers everything.@evertlammerts The PR is only intended to be merged after the |
paultiq commentedOct 18, 2025
There's a nuanced discussion of statically linking c++ extensions here, the key point is ensuring the UCRT remains dynamically linked, which I don't see in this PR:https://discuss.python.org/t/planning-for-an-msvc-abi-break/65102/21 See Matplotlib, a static c++ runtime but dynamic ucrt:https://github.com/matplotlib/matplotlib/pull/28687/files |
staticlibs commentedOct 18, 2025
Thanks for the pointers! Just currently there are no plans to have VCRUNTIME or UCRT libs to be linked dynamically, unless that would be a blocker for the Python client. In general we don't want any complex linking setup around MSVC runtime. |
This change makes all CMake targets to use
-MT/-MTdcompilation flags for Windows MSVC builds. This way the MSVC runtime library is linked statically and the workaround for VS2019 described induckdb/duckdb#17991 is no longer necessary.extension-ci-toolsPR:duckdb/extension-ci-tools#276Ref: duckdblabs/duckdb-internal#2036