-
Notifications
You must be signed in to change notification settings - Fork 913
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
Fix CGDisplayCreateUUIDFromDisplayID
linking (again)
#2078
Conversation
|
f36f127
to
4a3f5b6
Compare
I've investigated this some more, and I'm pretty sure I've found the correct way of doing it (see the updated description) @Imberflur and @ArturKovacs, sorry for pinging you before, but this is now ready to be tested. Also pinging @ryanisaacg, don't know what macOS version you have but the more testers of this the merrier 😉 |
Just FYI, the nightly android builds will be fixed by rust-lang/rust#91381 |
Unfortunately I won't have access to a macOS device until January. Feel free to ping me again at that time if this is still open then. |
There is kind of a deadline on this, |
This is a work around for rust-windowing/winit#2078
This is a work around for rust-windowing/winit#2078
4a3f5b6
to
106d77c
Compare
To get this merged quicker, I took out the |
#[cfg_attr( | ||
not(use_colorsync_cgdisplaycreateuuidfromdisplayid), | ||
link(name = "CoreGraphics", kind = "framework") | ||
link(name = "ApplicationServices", kind = "framework") |
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.
Note that a bit further down in this file we're linking against CoreGraphics
(this link attribute was redundant), so the only change is that we now also link to ApplicationServices
.
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.
Tested on MBP running macOS 12.0.1 and it works 👍
@madsmtm I tested this with the docker setup and it links fine 👍 (although we aren't using that setup anymore currently) |
Deferring to new ggez devs: @PSteinhaus , @nobbele and @IGBC . |
106d77c
to
007bc57
Compare
Due to the winit bug: rust-windowing/winit#2078
- These are failing on: rust-windowing/winit#2078
- These are failing on: rust-windowing/winit#2078
- These are failing on: rust-windowing/winit#2078
@ArturKovacs Thanks for the heads up! Indeed, there are a bunch of projects I maintain that have failing CI with the Is there any way I can help? |
If we could get this tested by someone with a macOS version < 10.13 that would be nice, but this PR very probably works as-is (the previous behaviour utilized undocumented behaviour on older platforms, while linking to |
Relatedly, an update to the people following this issue: The changes to |
I have macOS 10.15 so it's not that easy for me to test on macOS < 10.13 However given that my machine is from mid 2012, I think I can reinstall it to the old OS version. That's a bit intrusive but I can do it if it's reeeealy needed. |
I have an old Macbook with 10.10 lying around. Not being familiar with winit what would be the best way to test it? Just |
Just something where the linking is triggered. Try: cargo clean
MACOSX_DEPLOYMENT_TARGET=10.7 cargo build --example window
cargo clean
cargo build --example window |
Looks good:
|
Wonderful, thanks a lot @hkratz! Just out of interest, could I get you to do: cargo clean
MACOSX_DEPLOYMENT_TARGET=10.7 cargo run --example window And just verify that a window actually opens? I think it's rare that |
007bc57
to
c780fc6
Compare
c780fc6
to
18d8079
Compare
@madsmtm It shows a small window and produces lots of logging output after adding a workaround for borntyping/rust-simple_logger#43 |
Wonderful, thanks! |
See also rust-windowing#1626. The `cocoa` crate links to AppKit, which made the symbol `CGDisplayCreateUUIDFromDisplayID` from ApplicationServices/ColorSync (which AppKit uses internally) available to us on macOS 10.8 to 10.13. However, this does not work on macOS 10.7 (where AppKit does not link to ColorSync internally). Instead of relying on this, we should just link to ApplicationServices directly.
18d8079
to
83d55c5
Compare
Well, I think this has had enough eyes on it |
Since rust-windowing#2078 we link to `ApplicationServices`, which contains the `CGDisplayCreateUUIDFromDisplayID` symbol in all versions.
Since rust-windowing#2078 we link to `ApplicationServices`, which contains the `CGDisplayCreateUUIDFromDisplayID` symbol in all versions.
Since #2078 we link to `ApplicationServices`, which contains the `CGDisplayCreateUUIDFromDisplayID` symbol in all versions.
See previous issue: #1626.
The
cocoa
crate links to AppKit, which made the symbolCGDisplayCreateUUIDFromDisplayID
from ApplicationServices/ColorSync (which AppKit uses internally) available to us (on macOS 10.8 to 10.13).However, this does not work on macOS 10.7 (where AppKit does not link to ColorSync internally). Instead of relying on this, we should just link to ApplicationServices directly.
Also, lately something changed in rustc so that the linker's macOS version is 10.7, see rust-lang/rust#91372, which is why the nightly builds were failing.
MACOSX_DEPLOYMENT_TARGET=X.Y cargo build --example window
.cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to users