-
Notifications
You must be signed in to change notification settings - Fork 6.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
[sdl2] Build failure on macOS #25198
Comments
Thanks for posting this issue. I couldn't reproduce this issue locally, because my machine doesn't meet the conditions of this issue. I found there is a upstream PR fix |
Thank you for your answer @LilyWangLL! Isn't libsdl-org/SDL#5578 only about adding different environments on CI builds? Besides, let me ask you a different question then. Using GCC on MacOS is currently throwing errors when handling ObjectiveC code (see https://github.com/njakob/vcpkg-sdl2-report/tree/try-fix-2), would it rather be possible to keep the same compiler (GCC) end to end? Is it expected to use AppleClang for compiling the I'm asking the question since compiling with AppleClang the whole project is working (see https://github.com/njakob/vcpkg-sdl2-report/tree/clang-only). Therefore, it might rather be related to my toolchain "hack" in order to use a wider range of C++20 features. |
Since you mentioned good practices regarding ports respecting users' toolchains, should it be expected to use AppleClang while using SDL port @BillyONeal? |
Triplets need to be able to override the toolchain in use, but we aren't magic. If you build with a mishmash of implementations there's no guarantee that that's going to produce something reasonable. |
My question was targeted toward the requirement of compiling the SDL2 port with AppleClang on macOS and ignoring the compiler provided by the toolchain/environment variables. Is this expected? @BillyONeal At the moment, if a different compiler is provided (e.g. GCC), this will generate errors due to the ObjectiveC code. Should then consider that the port would always need to be compiled with AppleClang and report to SDL2 the linking issue when using different compilers? |
Ports are not allowed to do that. Sometimes we miss attempts to do that in review. That doesn't make it OK.
That's OK. The requirement isn't that every port builds with every compiler ever. The requirement is that the port listens to what the user asked for. (Although, to be listed in our curated registry, it must build with the compilers we use for curation)
Every project under the sun is not responsible for a few people who are extremely opinionated about the compiler that they use. Different compilers have different ABIs. Libraries cannot in general work around that situation. This is one of the big reasons we refuse to allow individual ports to control which tools are used. |
Thanks for posting this issue. Please reopen this issue if this is still a problem for you. |
Host Environment
macos-11
on GitHub actions)To Reproduce
A minimal setup could be found in the following repository.
2022.05.10
)Failure logs
Additional context
First of all, the issue described in this report does not appear when AppleClang (default compiler) is exclusively used. Therefore, it's possible that I'm not configuring something properly in the setup I'm describing below.
The issue happens when g++ (GNU 10.3.0) is used along with AppleClang (13.0.0.13000029) for the
sdl2
port. This setup is required as AppleClang does not have the best support for c++20 features as other compilers. In my case, I'm building projects that include new language functionalities (e.g. concepts) and this fails when AppleClang is used.Therefore, after playing around for a while, I managed to have a working setup where AppleClang is only used for a specific port and a custom toolchain file. Besides,
g++
is used throughCC
andCXX
environment variables for other cases.This has been working very well until #24694. After the update to the commit providing this change, the linking error reported in the log section appeared.
Finally, the port got another update through #25022 which does not change anything to the reported error.
The text was updated successfully, but these errors were encountered: