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

qt59.qtbase: fix darwin build so qtdeclarative can build #29812

Merged
merged 1 commit into from Oct 11, 2017

Conversation

j-hao
Copy link
Contributor

@j-hao j-hao commented Sep 26, 2017

Motivation for this change

All changes are for Darwin: move sed command to patch files; disable mesa; fix OpenGL and AGL header files path. qtdeclarative and qtwebkit can be built

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@FRidh FRidh added 6.topic: darwin Running or building packages on Darwin 6.topic: qt/kde labels Sep 26, 2017
@FRidh FRidh requested review from LnL7 and ttuegel September 26, 2017 16:05
Copy link
Member

@ttuegel ttuegel left a comment

Choose a reason for hiding this comment

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

I cannot test on macOS, so I should not approve this request, but neither does anything look wrong.

@@ -80,7 +80,7 @@ stdenv.mkDerivation {

patches =
copyPathsToStore (lib.readPathsFromFile ./. ./series)
++ stdenv.lib.optional stdenv.isDarwin ./darwin-cf.patch;
++ stdenv.lib.optional stdenv.isDarwin (lib.readPathsFromFile ./. ./darwin-series);
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem to work correctly. I don't really get why it's done like that for the other patches either, what's the advantage over just a list of paths?

applying patch /nix/store/bz3c8wjkkippnb60hcqydklkpx6jngrm-git-export/pkgs/development/libraries/qt-5/5.9/qtbase/mkspecs-common-mac.patch
/nix/store/wh1ck71iabaw743xnf1j3aj9y8wh9jv3-stdenv-darwin/setup: line 740: /nix/store/bz3c8wjkkippnb60hcqydklkpx6jngrm-git-export/pkgs/development/libraries/qt-5/5.9/qtbase/mkspecs-common-mac.patch: No such file or directory
builder for ‘/nix/store/wbpddvjbjm993ffmcl5h2v7z3bfkhbm4-qtbase-5.9.1.drv’ failed with exit code 1

Copy link
Member

Choose a reason for hiding this comment

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

I don't really get why it's done like that for the other patches either, what's the advantage over just a list of paths?

I can point quilt at that list of patches and work with them on top of the unpacked sources (almost) as if it was Git.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I just follow the current way of qt* modules. They are using a list of patches even for just one patch. Like https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/libraries/qt-5/5.9/qtdeclarative

@LnL7 are you sure you pulled in all the changes? Looks like the patch file is not in your test env

Copy link
Member

Choose a reason for hiding this comment

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

@j-hao You need to use copyPathsToStore as on line 82. This is probably broken for @LnL7 because he is using sandboxes, so his builder cannot access non-store paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me fix this

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, that must be it. The hydra builds would have the same problem.

@@ -45,7 +45,7 @@ stdenv.mkDerivation {
libjpeg libpng libtiff
]

++ lib.optional mesaSupported mesa
++ lib.optional (mesaSupported && !stdenv.isDarwin) mesa
Copy link
Member

Choose a reason for hiding this comment

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

This already defaults to false on darwin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On Darwin, the mesaSupported is passed in as true instead of using default value (false). That's the reason why qtdeclarative cannot build. If you look at output of qtbase configuration, the current result shows OpenVG is yes due to mesaSupported value as true.

@LnL7 LnL7 added the 9.needs: port to stable A PR needs a backport to the stable release. label Sep 26, 2017
substituteInPlace ./mkspecs/common/mac.conf \
--replace "/System/Library/Frameworks/OpenGL.framework/" "${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework/"
substituteInPlace ./mkspecs/common/mac.conf \
--replace "/System/Library/Frameworks/AGL.framework/" "${darwin.apple_sdk.frameworks.AGL}/Library/Frameworks/AGL.framework/"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this not part of the patch file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we know the actual ${darwin.apple_sdk.frameworks.AGL} path within patch file?

Copy link
Member

Choose a reason for hiding this comment

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

don't think so, but I think replacing paths like this preferable since it doesn't break as easily as a patch

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh thanks for clarifying this. I missed the ${darwin...} substitutions.

Copy link
Contributor

Choose a reason for hiding this comment

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

btw. these two lines will probably enable qt5.qtwebkit, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can build qt5.qtwebkit locally

@j-hao
Copy link
Contributor Author

j-hao commented Sep 29, 2017

Updated new version. Let me know if anything need to change

@LnL7
Copy link
Member

LnL7 commented Oct 1, 2017

All of the remaining failures are caused by a chmod now, including a dependency of qtdeclarative.

Moving /nix/store/pkw2bp04m7c9xywjwva365glihcwrxqg-qtsvg-5.9.1/lib/qt-5.9/plugins to /nix/store/0zzl2389avjd6nwz8q7cw88xmirhzja4-qtsvg-5.9.1-bin/lib/qt-5.9/plugins
Removing empty /nix/store/pkw2bp04m7c9xywjwva365glihcwrxqg-qtsvg-5.9.1/lib/qt-5.9/ and (possibly) its parents
chmod: changing permissions of '/nix/store/pkw2bp04m7c9xywjwva365glihcwrxqg-qtsvg-5.9.1/lib/cmake/Qt5/Qt5Config.cmake': Operation not permitted
builder for ‘/nix/store/6aq90l300875x6jaimcl9avsz31p1qxz-qtsvg-5.9.1.drv’ failed with exit code 1

@j-hao
Copy link
Contributor Author

j-hao commented Oct 4, 2017

@LnL7 I'm having trouble to reproduce the error you saw. Can you let me know how to reproduce it?

@LnL7
Copy link
Member

LnL7 commented Oct 4, 2017

@j-hao Hmm, maybe the minimal sandbox is only used when build user separation is enabled. Are you using the nix-daemon?

It's probably trying to make a setuid binary, that's not allowed in a build sandbox.

@j-hao
Copy link
Contributor Author

j-hao commented Oct 11, 2017

@LnL7 the problem occurred if I use nix-daemon. I have switched to nix-daemon and tested the build. It can now build qt5.full for me. Please check

@LnL7
Copy link
Member

LnL7 commented Oct 11, 2017

@j-hao Nice, everything builds now except for qtwebengine.

@LnL7 LnL7 merged commit 0d8c6f4 into NixOS:master Oct 11, 2017
@LnL7 LnL7 added the 8.has: port to stable A PR already has a backport to the stable release. label Oct 11, 2017
@samueldr samueldr removed the 9.needs: port to stable A PR needs a backport to the stable release. label Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 6.topic: qt/kde 8.has: port to stable A PR already has a backport to the stable release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants