NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.71k stars 13.85k forks source link

qtwebengine does not build on darwin #36932

Closed mpickering closed 5 years ago

mpickering commented 6 years ago

Issue description

qtwebengine fails just after successfully configuring with error message

Using Xcode version , but at least version 7.3 is required to build Qt WebEngine.
QtWebEngine will not be built.

I've fixed quite a few of the Qt issues recently on darwin but this one is out of my depth. Can anyone help?

Steps to reproduce

nix-shell -p qt5.qtwebengine

Technical details

 - system: `"x86_64-darwin"`
 - host os: `Darwin 16.7.0, macOS 10.12.6`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 1.11.15`
 - channels(matt): `""`
 - channels(root): `"nixpkgs-18.03pre118061.69607d7662"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
LnL7 commented 6 years ago

Nix builds don't depend on xcode, it's pretty likely the build works fine with just clang if the check is skipped. Otherwise there's xcbuild that can build certain xcode projects.

mpickering commented 6 years ago

Thanks for that. I just removed the check it the build proceeded some more..

Now there is a libtool error after adding libtool as a dependency.

[9/371] CC base/third_party/libevent/evdns.o
[10/371] CC base/third_party/libevent/evrpc.o
[11/371] CC base/third_party/libevent/event_tagging.o
[12/371] CC base/third_party/libevent/evutil.o
[13/371] CC base/third_party/libevent/log.o
[14/371] CC base/third_party/libevent/poll.o
[15/371] CC base/third_party/libevent/select.o
[16/371] CC base/third_party/libevent/signal.o
[17/371] CC base/third_party/libevent/kqueue.o
[18/371] CC base/third_party/libevent/strlcpy.o
[19/371] CXX base/allocator/allocator_check.o
[20/371] CXX base/files/file_posix.o
[21/371] CC base/third_party/libevent/http.o
[22/371] AR libevent.a
FAILED: libevent.a 
rm -f libevent.a && libtool -static -o libevent.a base/third_party/libevent/buffer.o base/third_party/libevent/evbuffer.o base/third_party/libevent/evdns.o base/third_party/libevent/event.o base/third_party/libevent/event_tagging.o base/third_party/libevent/evrpc.o base/third_party/libevent/evutil.o base/third_party/libevent/http.o base/third_party/libevent/log.o base/third_party/libevent/poll.o base/third_party/libevent/select.o base/third_party/libevent/signal.o base/third_party/libevent/strlcpy.o base/third_party/libevent/kqueue.o
Usage: /nix/store/gsarznl9jdshg7iq18idyj5pzlixmrgr-libtool-2.4.6/bin/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool:   error: unrecognised option: '-static'
[23/371] CXX base/allocator/allocator_extension.o
[24/371] CXX base/values.o
[25/371] CXX base/base_paths.o
[26/371] CXX base/at_exit.o
[27/371] CXX base/trace_event/trace_log.o
ninja: build stopped: subcommand failed.
Command '['ninja', '-C', '/private/tmp/nix-build-qtwebengine-5.10.1.drv-0/qtwebengine-everywhere-src-5.10.1/src/3rdparty/chromium/tools/gn/out/Release', 'gn']' returned non-zero exit status 1
Building gn manually in a temporary directory for bootstrapping...
Project ERROR: GN build error!
make[2]: *** [Makefile:60: sub-gn-pro-make_first] Error 3
make[2]: Leaving directory '/private/tmp/nix-build-qtwebengine-5.10.1.drv-0/qtwebengine-everywhere-src-5.10.1/src/buildtools'
make[1]: *** [Makefile:54: sub-buildtools-make_first] Error 2
make[1]: Leaving directory '/private/tmp/nix-build-qtwebengine-5.10.1.drv-0/qtwebengine-everywhere-src-5.10.1/src'
make: *** [Makefile:47: sub-src-make_first] Error 2
builder for ‘/nix/store/l0wfq75h3kahzy9fnksi747hj6xywkzy-qtwebengine-5.10.1.drv’ failed with exit code 2
error: build of ‘/nix/sto
matthewbauer commented 6 years ago

darwin.cctools can provide libtool I think.

mpickering commented 6 years ago

It is even more broken now.

~/nixpkgs:nix-build ./ -A qt510.qtwebengine
error: assertion failed at /Users/matt/nixpkgs/pkgs/os-specific/linux/libcap/default.nix:2:1
(use ‘--show-trace’ to show detailed location information)
matthewbauer commented 6 years ago

It looks like the new issue is coming from qtmultimedia. I'm not really sure what's going on though.

/cc @ttuegel

matthewbauer commented 6 years ago

Ah it looks like it's still kind of broken so I'll reopen this. Not sure what's going on though.

https://hydra.nixos.org/build/73282201/log

mpickering commented 6 years ago

The error appears to be:

Could not resolve SDK product version for 'macosx'. 
Building Qt WebEngine requires a macOS SDK version of 10.11 or newer. Current version is .
QtWebEngine will not be built.
toonn commented 5 years ago

Seems like I'm running into this:

Checking for libxml2 and libxslt... yes
Checking for compatible system libxml2... no
Checking for minizip... no
Checking for system ninja... yes
Checking for opus... yes
Checking for protobuf... no
Checking for re2... no
Checking for snappy... no
Checking for xcomposite... no
Checking for xcursor... no
Checking for xi... no
Checking for xrandr... no
Checking for xtst... no
Checking for zlib... yes
Done running configuration tests.

Configure summary:

Qt WebEngine:
  Embedded build ......................... no
  Pepper Plugins ......................... yes
  Printing and PDF ....................... yes
  Proprietary Codecs ..................... yes
  Spellchecker ........................... yes
  Native Spellchecker .................... no
  WebRTC ................................. yes
  Use System Ninja ....................... yes
  Geolocation ............................ yes
  Use v8 snapshot ........................ yes
  Use ALSA ............................... no
  Use PulseAudio ......................... no
  Optional system libraries used:
    re2 .................................. no
    icu .................................. no
    libwebp, libwebpmux and libwebpdemux . yes
    opus ................................. yes
    ffmpeg ............................... no
    libvpx ............................... yes
    snappy ............................... no
    libsrtp .............................. no
    glib ................................. no
    zlib ................................. yes
    minizip .............................. no
    libevent ............................. yes
    jsoncpp .............................. no
    protobuf ............................. no
    libxml2 and libxslt .................. no
    lcms2 ................................ no
    png .................................. no
    JPEG ................................. yes
    harfbuzz ............................. yes
    freetype ............................. no

Qt is now configured for building. Just run 'make'.
Once everything is built, Qt is installed.
You should NOT run 'make install'.
Note that this build cannot be deployed to other machines or devices.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

Project ERROR:
Using Xcode version , but at least version 7.3 is required to build Qt WebEngine.

builder for '/nix/store/rs9z50r8k67b7hk2hmkrm7mqmmqyrfc0-qtwebengine-5.11.3.drv' failed with exit code 3
cannot build derivation '/nix/store/7wwrbw00c93vmrq727cbsl9pb1m2k5qg-python3.7-PyQt-5.11.3.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/sv8llx3yzmn916j9h4nkvfih9xs5n5l2-anki-2.1.9.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/05imsd87s931bv8dw3y75y67fq73fvvf-miscTools.drv': 1 dependencies couldn't be built
error: build of '/nix/store/05imsd87s931bv8dw3y75y67fq73fvvf-miscTools.drv' failed

My CLT version is higher than 7.3 though:

macOS: 10.13.6-x86_64
CLT: 10.1.0.0.1.1539992718
Xcode: 10.1
infinisil commented 5 years ago

@toonn Have you seen https://github.com/NixOS/nixpkgs/pull/56440?

toonn commented 5 years ago

@Infinisil, I hadn't but I'm not sure what to do with that? Are you suggesting running a local nixpkgs? I'm still on unstable.

It says it's surpassed by #56744 though so I'm not sure what to do.

veprbl commented 5 years ago

@toonn I'm waiting for #56744 to be merged first, it will still require some fixing on top of that to get qtwebengine working. Meanwhile you can use my existing fix:

nix-env -f https://github.com/veprbl/nixpkgs/archive/b7b1540a430d88026ac11d3df356652cde0cb2c3.tar.gz -iA anki

Or, if you need it to use it declaratively in your config, you could use

(import (builtins.fetchTarball https://github.com/veprbl/nixpkgs/archive/b7b1540a430d88026ac11d3df356652cde0cb2c3.tar.gz) {}).anki
kfiz commented 3 years ago

If this should have been fixed, than unfortunately this seems not to work, at least on macOS 10.15.7. I'm getting this on nixpkgs-unstable:

Configure summary:

Qt WebEngine:
  Embedded build ......................... no
  Full debug information ................. no
  Pepper Plugins ......................... yes
  Printing and PDF ....................... yes
  Proprietary Codecs ..................... yes
  Spellchecker ........................... yes
  Native Spellchecker .................... no
  WebRTC ................................. yes
  Use System Ninja ....................... no
  Geolocation ............................ yes
  WebChannel support ..................... yes
  Use v8 snapshot ........................ yes
  Kerberos Authentication ................ no
  Support qpa-xcb ........................ no
  Use ALSA ............................... no
  Use PulseAudio ......................... no
  Clang version .......................... clang version 7.1.0 (tags/RELEASE_710/final)
  macOS SDK version ...................... 10.15.6
  macOS minimum deployment target ........ 10.12
  Optional system libraries used:
    re2 .................................. no
    icu .................................. no
    libwebp, libwebpmux and libwebpdemux . yes
    opus ................................. yes
    ffmpeg ............................... no
    libvpx ............................... no
    snappy ............................... no
    glib ................................. no
    zlib ................................. yes
    minizip .............................. no
    libevent ............................. yes
    jsoncpp .............................. no
    protobuf ............................. no
    libxml2 and libxslt .................. no
    lcms2 ................................ no
    png .................................. no
    JPEG ................................. yes
    harfbuzz ............................. yes
    freetype ............................. no

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/nix/store/70bh7ksvx8xb522q3salvd5n19fhqbkr-qtbase-5.12.7'.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

Using Xcode version , but at least version 8.3.3 is required to build Qt WebEngine.
QtWebEngine will not be built.
toonn commented 3 years ago

On latest unstable I'm also still seeing this, my log continues like this from where kfiz's stopped:

/nix/store/ng34kqybg1478g13i1kfa7328bx8q0mm-qtbase-5.12.7-dev/mkspecs/features/mac/default_post.prf:5: 'xcodeSDKInfo' is not a recognized replace function.
building
build flags: -j8 -l8 SHELL=/nix/store/8i9kyqfxhk2s9dzx32x0sgdk7kyx9wjc-bash-4.4-p23/bin/bash
make: Nothing to be done for 'first'.
running tests
no test target found in ninja, doing nothing
installing
install flags: SHELL=/nix/store/8i9kyqfxhk2s9dzx32x0sgdk7kyx9wjc-bash-4.4-p23/bin/bash install
make: Nothing to be done for 'install'.
post-installation fixup
find: '/nix/store/g42srfws3x5k8qqljfnrv5xq4w88fqjr-qtwebengine-5.12.7-bin': No such file or directory
[repeated many times]
find: '/nix/store/g42srfws3x5k8qqljfnrv5xq4w88fqjr-qtwebengine-5.12.7-bin': No such file or directory
strip is /nix/store/abvn3wi9va3p9djgjw214a1ggrxc4m69-Toolchains/XcodeDefault.xctoolchain/bin/strip
find: '/nix/store/g42srfws3x5k8qqljfnrv5xq4w88fqjr-qtwebengine-5.12.7-bin': No such file or directory
[repeated many times]
find: '/nix/store/g42srfws3x5k8qqljfnrv5xq4w88fqjr-qtwebengine-5.12.7-bin': No such file or directory
find: '/nix/store/v2jzh3nch9v0i6navkvdkhgpamsp0q6n-qtwebengine-5.12.7-dev': No such file or directory
[repeated many times]
find: '/nix/store/v2jzh3nch9v0i6navkvdkhgpamsp0q6n-qtwebengine-5.12.7-dev': No such file or directory
strip is /nix/store/abvn3wi9va3p9djgjw214a1ggrxc4m69-Toolchains/XcodeDefault.xctoolchain/bin/strip
find: '/nix/store/v2jzh3nch9v0i6navkvdkhgpamsp0q6n-qtwebengine-5.12.7-dev': No such file or directory
[repeated many times]
find: '/nix/store/v2jzh3nch9v0i6navkvdkhgpamsp0q6n-qtwebengine-5.12.7-dev': No such file or directory
strip is /nix/store/abvn3wi9va3p9djgjw214a1ggrxc4m69-Toolchains/XcodeDefault.xctoolchain/bin/strip
patching script interpreter paths in /nix/store/2h2cfmckjy2lg4fbrl32accsr95i0y89-qtwebengine-5.12.7
postPatchMkspecs
postPatchMkspecs
builder for '/nix/store/4r0bmabwqq7ink82gima3kwa4gf0jhw4-qtwebengine-5.12.7.drv' failed to produce output path '/nix/store/g42srfws3x5k8qqljfnrv5xq4w88fqjr-qtwebengine-5.12.7-bin'
cannot build derivation '/nix/store/yjmp0mwabsbf9fzp3dkcyhzxf1g1x0rk-python3.8-PyQtWebEngine-5.15.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/7vcilarzdy1nz7akf8fy8311nnymmv5s-anki-2.1.15.drv': 1 dependencies couldn't be built
error: build of '/nix/store/7vcilarzdy1nz7akf8fy8311nnymmv5s-anki-2.1.15.drv' failed
veprbl commented 3 years ago

If qt5.qtwebengine doesn't work for you, please file a new issue.

toonn commented 3 years ago

But this issue is exactly about qtwebengine not building on darwin, no? Closing it sends a strong signal that it should build now (at least for recent enough channels).

veprbl commented 3 years ago

@toonn Yes, from user perspective it's the same issue. But the reasons for the breakage will likely be different this time, so the context of this past discussion will be mostly irrelevant.

Notice that this was closed in 2019, so no message regarding the current state is implied. Also, since then we had #86949.

kfiz commented 3 years ago

see #103230