Skip to content
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

[angle] Rename libs to avoid conflict with system OpenGL. #27701

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

BillyONeal
Copy link
Member

Note that we already rename the headers in

file(GLOB_RECURSE angle_includes "${CURRENT_PACKAGES_DIR}/include")
file(COPY ${angle_includes} DESTINATION "${CURRENT_PACKAGES_DIR}/include/angle")
set(_double_files
include/GLES/egl.h
include/GLES/gl.h
include/GLES/glext.h
include/GLES/glplatform.h
include/GLES2/gl2.h
include/GLES2/gl2ext.h
include/GLES2/gl2platform.h
include/GLES3/gl3.h
include/GLES3/gl31.h
include/GLES3/gl32.h
include/GLES3/gl3platform.h)
foreach(_file ${_double_files})
if(EXISTS "${CURRENT_PACKAGES_DIR}/${_file}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/${_file}")
endif()
endforeach()

Also remove what appears to be phantom dependency in qt5-base when not Windows, @Neumann-A reports over Discord https://discord.com/channels/400588936151433218/687365466422902841/1038241263494893649 that they just need any OpenGL implementation.

This hopefully resolves build baseline issues, including but not limited to: https://dev.azure.com/vcpkg/public/_build/results?buildId=80502

REGRESSION: cmake:x64-linux cascaded, but it is required to pass. (/agent/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt).
REGRESSION: qt:x64-linux cascaded, but it is required to pass. (/agent/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt).
REGRESSION: qtbase:x64-linux failed with BUILD_FAILED. If expected, add qtbase:x64-linux=fail to /agent/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt.

Note that we already rename the headers in https://github.com/microsoft/vcpkg/blob/e6a79ac0183043994ab21a2c4e0f9cdad8a5421c/ports/angle/portfile.cmake#L77

Also remove what appears to be phantom dependency in qt5-base when not Windows, @Neumann-A reports over Discord https://discord.com/channels/400588936151433218/687365466422902841/1038241263494893649 that they just need any OpenGL implementation.
@BillyONeal BillyONeal added category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. category:infrastructure Pertaining to the CI/Testing infrastrucutre labels Nov 8, 2022
github-actions[bot]
github-actions bot previously approved these changes Nov 8, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one vcpkg.json where you should check the license field.

If you feel able to do so, please consider adding a "license" field to the following files:

  • ports/angle/vcpkg.json

Valid values for the license field can be found in the documentation

@BillyONeal
Copy link
Member Author

To clarify, I believe the baseline issue is that qt et al. try to do a check_source_compiles where they get the system OpenGL headers, but end up linking with ANGLE's OpenGL implementation libraries == linker doom.

@Neumann-A
Copy link
Contributor

check_source_compiles where they get the system OpenGL headers, but end up linking with ANGLE's OpenGL implementation libraries == linker doom.

a) It doesn't matter if you use system headers or headers from angle. the OpenGL API is tightly specified so you will basically get the same headers with the same symbols. (Maybe some vendor specific extension are missing but those are typically not used at all)
b) vcpkg builds static libs on linux
c) static libs miss extra linkage so testing them typically requires additional libs like e.g. -lGL -lAngle -lX11 -lXext (or whatever extra libs the linker complains about;)
d) downstream typically assume EGL / GLESv2 to be a shared library which doesn't require c) which is why the checks in https://github.com/qt/qtbase/blob/2ec77f4f11b5e01e25307a068cd3b360b37011e0/cmake/FindGLESv2.cmake#L27 and https://github.com/qt/qtbase/blob/2ec77f4f11b5e01e25307a068cd3b360b37011e0/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake#L127 fail for angle
e) Question: Should linking angle the be default for EGL/GLESv2 on linux? Probably not considering that mesa/libglvnd is the default. As such ports in vcpkg shouldn't be able to find angle libs by default.

@@ -625,6 +625,7 @@ list(APPEND LIBGLESV2_SOURCES
)
add_library(libGLESv2 ${LIBGLESV2_SOURCES})
target_link_libraries(libGLESv2 PRIVATE angle::common angle::libANGLE)
set_property(TARGET libGLESv2 PROPERTY OUTPUT_NAME libGLESv2_angle)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only on Linux

Copy link
Member Author

@BillyONeal BillyONeal Nov 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so should we also avoid renaming the headers on Windows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so should we also avoid renaming the headers on Windows?

If you want to update (opengl|egl)-registry make angle use the officially updated khronos headers and only keep the implementation specific angle headers, feel free to do so but i doubt it is worth the effort ;)

@@ -669,6 +670,7 @@ add_library(libEGL
)

target_link_libraries(libEGL PRIVATE angle::common angle::libANGLE libGLESv2)
set_property(TARGET libEGL PROPERTY OUTPUT_NAME libEGL_angle)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only on Linux

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one vcpkg.json where you should check the license field.

If you feel able to do so, please consider adding a "license" field to the following files:

  • ports/angle/vcpkg.json

Valid values for the license field can be found in the documentation

@BillyONeal
Copy link
Member Author

a) It doesn't matter if you use system headers or headers from angle. the OpenGL API is tightly specified so you will basically get the same headers with the same symbols. (Maybe some vendor specific extension are missing but those are typically not used at all)

Just because in some cases the headers could match doesn't mean they should be used that way.

d) downstream typically assume EGL / GLESv2 to be a shared library which doesn't require c) which is why the checks in https://github.com/qt/qtbase/blob/2ec77f4f11b5e01e25307a068cd3b360b37011e0/cmake/FindGLESv2.cmake#L27 and https://github.com/qt/qtbase/blob/2ec77f4f11b5e01e25307a068cd3b360b37011e0/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake#L127 fail for angle

Thanks for clarifying!

e) Question: Should linking angle the be default for EGL/GLESv2 on linux? Probably not considering that mesa/libglvnd is the default. As such ports in vcpkg shouldn't be able to find angle libs by default.

It indeed seems a system dependency to me.

@BillyONeal BillyONeal merged commit 76a79d9 into microsoft:master Nov 8, 2022
@BillyONeal BillyONeal deleted the fix-qt branch November 8, 2022 19:49
@FrankXie05 FrankXie05 added the info:reviewed Pull Request changes follow basic guidelines label Nov 9, 2022
past-due added a commit to past-due/vcpkg that referenced this pull request Jan 27, 2023
JavierMatosD pushed a commit that referenced this pull request Feb 10, 2023
…ates) (#27444)

* [angle] Update to chromium/5249

- Refactor build system based on WebKit's CMake build system for libANGLE
- Add maintainer-notes.md

* [angle] Fetch & generate more files in portfile

* [angle] Move maintainer-notes.md

* [angle] Port changes from #27701

* Merge install tweak from #28547

* [angle] Tweak PlatformLinux

* Run x-add-version

* [angle] Update to chromium/5414

* Run x-add-version

* Fix version database.

* Fix version database

---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Co-authored-by: Jonliu1993 <13720414433@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:infrastructure Pertaining to the CI/Testing infrastrucutre category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants