-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
[baseline][opengl,mesa] Resolve ambiguities #28160
Conversation
ports/mesa/portfile.cmake
Outdated
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link") | ||
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/opengl32${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}" "${CURRENT_PACKAGES_DIR}/lib/manual-link/opengl32${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}") | ||
if(NOT VCPKG_BUILD_TYPE) | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link") | ||
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/opengl32${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/opengl32${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}") | ||
endif() |
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.
I don't think this is necessary. The way this works is just to make the linker happy about the opengl symbols.
Which DLL actually gets loaded depends on load order. the opengl32.dll provided by mesa is a drop in replacement providing full opengl software rendering.
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.
If the symbols exported by this lib are identical to the Windows SDK ones, the user should get the Windows SDK ones (which we require to be present anyway) and the ones in manual-link are pointless (the Windows SDK ones will always be found first).
If the set of symbols differs we need to come up with something else...
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.
I cannot check the Windows SDK files. But AFAIU mesa explicitly claims to provide a drop-in replacement for Windows opengl32.dll, so the import lib cannot be far away, and any bug is theirs. FTR mesa def template is here:
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/gallium/targets/libgl-gdi/opengl32.def.in
Friendly ping. This is blocking #28126 |
I don't think we can remove the SDK libs from |
no
If you need opengl in a windows project you should not really use vcpkg auto linking..... |
Can't msbuild use the Windows SDK without copying the needed import libs or DLLs? |
Some libraries from the Windows SDK are automatically linked by the compiler (
With those points:
This could be possible by implementing an opengl32.lib-specific hack, but does not solve ownership -- see below. The file conflicts are not the root cause of the problem, they are a symptom of the true cause: unclear ownership over
OSS libraries (so far) are either 1) CMake, which needs to explicitly find_library & link anyway or (rarely) 2) MSBuild projects independent of vcpkg, which will directly list opengl32.lib as an additional linker input file. It does not surprise me that we do not (yet) have a port that requires the automatic linkage. We know we have users that use it -- they've filed issues early on in the life of vcpkg that were fixed by this.
We do not need to skip testing mesa in CI. However, our This means we need to move compilation and deployment of opengl32.lib / .dll from Mesa into an off-by-default feature so that, across the tree, the Windows SDK is the default owner of opengl. We may need to make similar adjustments to the Then, the same as with As an aside: @dg0yt is spot on with the observation that we need to better capture the Windows SDK dependency here. |
That probably will never happen if #26370 gets merged since that will always explicitly link libraries in msbuild. As mentioned countless times the current MSBuild integration is flawed by design. Another approach will be needed in the future to avoid further issues with it.
ownership of opengl32.lib isn't required (more later). Ownership of
It is another case but it is different from As such I am still voting for leaving the WindowsSDK out of vcpkg. (Since the alternative would be to have the whole SDK in vcpkg). If you want to have working MSBuild autolinking with |
I reverted the last commit. SDK headers and import lib are installed as before. |
@ras0219-msft @BillyONeal This should be good enough now to move forward from the baseline regression. |
Ping @ras0219-msft @BillyONeal. |
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.
This LGTM as a stopgap solution.
What does your PR fix?
Fix a CI baseline regression for x64-windows-static-md, port osg.
Fixes
#include <GL/gl.h>
is ambiguous on case-insensitve file systems #28087, byno longer copying libs and headers out of the Windows SDK at all (ultimately) /using wrong case and by changes to mesa.I fail to see a robust benefit from the copying of SDK headers. AFAIU package opengl's ABI hash already doesn't depend on the Windows SDK, i.e. rebuilds of the port will be triggered independently of changes to the active version of the Windows SDK, picking what they will find at this time. And even just using exported artifacts on another machine should demand using a compatible (i.e. controlled) version of the SDK.
Somewhat related, this PR moves the opengl32 lib generated by mesa to manual-link, and drops all mesa headers which are available from opengl-registry.
Fixes [egl] Build failure #28688
Revise mesa dependencies.
Installs a proper copyright file for mesa.
Drafts of these changes were tested and discussed in [baseline][osg] Prefer GLVND libraries #28089.
Which triplets are supported/not supported? Have you updated the CI baseline?
unchanged, yes
Does your PR follow the maintainer guide?
yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --all
and committed the result?yes