-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
qt6.qtwebengine: fix build on darwin, disable metal shader compilation #359755
Conversation
There are commits from after the Metal shader build was introduced that introduce a proper flag for it, so we shouldn’t need to patch the build unless we maybe need to backport the upstream commits that added that flexibility. (Apparently Google’s toolchain itself can’t use the shader compiler.) IIRC @niklaskorz (?) got as far as you previously. The Bluetooth thing seemed like it might be a compiler version issue (maybe try on |
My only encounter with the Metal shader compiler was in the context of zed-editor (not chromium), which I also solved by contributing runtime (instead of build time) shader compilation as an optional flag: zed-industries/zed@6dca609 |
Sorry, must have mixed you up with whoever was trying to get it building :) I’m not sure about the Bluetooth thing here but hopefully we can figure out how to plumb down the flag to disable the shader compilation from the Qt WebEngine build system down to ANGLE. |
Base on the history of I believe qt6.qtwebengine in nixpkgs already has the latest |
google/angle@a9b0174 added the flag I’m thinking of. Since it’s apparently used by Chrome, it should be quite reliable. |
I don't think |
Ah, okay, I didn’t realize. So I guess the only way to override things like Anyway, my best guess for the Bluetooth error is that LLVM 16 is too old. So I’d try on |
ca4abfa
to
0aaa1f4
Compare
I've used this diff on master to test: -qtModule {
+let
+ stdenv' = if stdenv.cc.isClang then llvmPackages_18.stdenv else stdenv;
+in
+(qtModule.override { stdenv = stdenv'; }) { But get this error:
Same error when using @emilazy Do you recognize this error? |
|
@@ -143,6 +152,9 @@ qtModule { | |||
--replace "AppleClang" "Clang" | |||
substituteInPlace cmake/Functions.cmake \ | |||
--replace "/usr/bin/xcrun" "${xcbuild}/bin/xcrun" | |||
# Disable metal shader compilation, Xcode only |
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.
Nitpick. Can we make this substitution and the AppleClang
one running on all platforms? Than we won't break macos if the package is updated.
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.
Done
0aaa1f4
to
5dcb136
Compare
anything preventing this from being merged? |
Well, merge conflicts for one :) Sorry for forgetting about this. @azuwis That‘s a known issue; you can look at e.g. There‘s also some other LLVM 19‐related V8 backports in there we might need. It’s possible there’s stuff elsewhere in Chromium too but hopefully upstream patches shouldn’t be too hard to find. |
So we won't break darwin build if the package is updated
5dcb136
to
3c92e65
Compare
Looks like the vendored |
3c92e65
to
3bed3d5
Compare
With latest push,
|
|
It seems
|
f17e5cb
to
f0f5204
Compare
- Disable metal shader compilation - Apply upstream zutil.h patch that fixes clang 18 and later - Apply upstream libpng patch that fixes clang 18 and later - Drop `autoSignDarwinBinariesHook` on aarch64-darwin, no longer necessary
I was wrong about the |
f0f5204
to
85c1c3c
Compare
|
Wonderful! I love how straightforward the diff is. Really nice that we can build big things like this again now. I’ll try to remember to test the build on |
@emilazy Gentle ping. |
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.
It builds 🎉
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-24.11
git worktree add -d .worktree/backport-359755-to-release-24.11 origin/release-24.11
cd .worktree/backport-359755-to-release-24.11
git switch --create backport-359755-to-release-24.11
git cherry-pick -x af397f4a337dcdea43583ab12ef31c0fcdbdcb31 85c1c3ca3f214ee465a63bd6a5a41a7a9ebe191b |
Do you mind handling the backport? It’d be great if we got this fixed on 24.11. |
See #372849 |
Currently qt6.qtwebengine failed on Hydra with this log:
It seems that is a Xcode only feature introduce by google/angle@a9b0174
I was trying to workaround that by disabling metal shader compilation:
It seems the workaround did the job (failed at [15832/29764] instead of [5019/29770]), but encountered another error:Edit: The workaround works, and the following error can be fixed using clang 17.
Error log
Full log https://gist.githubusercontent.com/azuwis/fff9587f6c9e55798fb0baf711a4a432/raw/5bc8795fce95340b5e0d350b22ff136f82a7afa2/qtwebengine.log
Any idea? @emilazy @K900
Fixes #353924
ZHF: #352882
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.