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
glib-networking: Fix glib-networking for macOS #33459
Conversation
@GrahamcOfBorg build glib_networking |
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.
Success for system: x86_64-darwin
make[3]: Leaving directory '/private/tmp/nix-build-glib-networking-2.54.1.drv-0/glib-networking-2.54.1'
make[2]: Leaving directory '/private/tmp/nix-build-glib-networking-2.54.1.drv-0/glib-networking-2.54.1'
make[1]: Leaving directory '/private/tmp/nix-build-glib-networking-2.54.1.drv-0/glib-networking-2.54.1'
glibPreFixupPhase
post-installation fixup
strip is /nix/store/bhfkh37smh9lc5bngdha6zx98k6w6cgd-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/dlv7bm17g1qmdmxfxz3d8r81gmwpkiaz-glib-networking-2.54.1/lib
patching script interpreter paths in /nix/store/dlv7bm17g1qmdmxfxz3d8r81gmwpkiaz-glib-networking-2.54.1
strip is /nix/store/bhfkh37smh9lc5bngdha6zx98k6w6cgd-cctools-binutils-darwin/bin/strip
/nix/store/dlv7bm17g1qmdmxfxz3d8r81gmwpkiaz-glib-networking-2.54.1
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.
Success for system: x86_64-linux
shrinking /nix/store/nb4w325yn01pzpjvkd9238mby65raf0i-glib-networking-2.54.1/libexec/glib-pacrunner
shrinking /nix/store/nb4w325yn01pzpjvkd9238mby65raf0i-glib-networking-2.54.1/lib/gio/modules/libgiognomeproxy.so
shrinking /nix/store/nb4w325yn01pzpjvkd9238mby65raf0i-glib-networking-2.54.1/lib/gio/modules/libgiognutls.so
shrinking /nix/store/nb4w325yn01pzpjvkd9238mby65raf0i-glib-networking-2.54.1/lib/gio/modules/libgiolibproxy.so
strip is /nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/nb4w325yn01pzpjvkd9238mby65raf0i-glib-networking-2.54.1/lib /nix/store/nb4w325yn01pzpjvkd9238mby65raf0i-glib-networking-2.54.1/libexec
patching script interpreter paths in /nix/store/nb4w325yn01pzpjvkd9238mby65raf0i-glib-networking-2.54.1
checking for references to /tmp/nix-build-glib-networking-2.54.1.drv-0 in /nix/store/nb4w325yn01pzpjvkd9238mby65raf0i-glib-networking-2.54.1...
strip is /nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
/nix/store/nb4w325yn01pzpjvkd9238mby65raf0i-glib-networking-2.54.1
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.
Success for system: aarch64-linux
shrinking /nix/store/xgr3fs299vpndfgjb4lhgzs1xgnadg8m-glib-networking-2.54.1/lib/gio/modules/libgiognutls.so
shrinking /nix/store/xgr3fs299vpndfgjb4lhgzs1xgnadg8m-glib-networking-2.54.1/lib/gio/modules/libgiognomeproxy.so
shrinking /nix/store/xgr3fs299vpndfgjb4lhgzs1xgnadg8m-glib-networking-2.54.1/lib/gio/modules/libgiolibproxy.so
shrinking /nix/store/xgr3fs299vpndfgjb4lhgzs1xgnadg8m-glib-networking-2.54.1/libexec/glib-pacrunner
strip is /nix/store/c6qj0j45xizkrx58i65j75a5ysmqhgrs-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/xgr3fs299vpndfgjb4lhgzs1xgnadg8m-glib-networking-2.54.1/lib /nix/store/xgr3fs299vpndfgjb4lhgzs1xgnadg8m-glib-networking-2.54.1/libexec
patching script interpreter paths in /nix/store/xgr3fs299vpndfgjb4lhgzs1xgnadg8m-glib-networking-2.54.1
checking for references to /build in /nix/store/xgr3fs299vpndfgjb4lhgzs1xgnadg8m-glib-networking-2.54.1...
strip is /nix/store/c6qj0j45xizkrx58i65j75a5ysmqhgrs-binutils-2.28.1/bin/strip
/nix/store/xgr3fs299vpndfgjb4lhgzs1xgnadg8m-glib-networking-2.54.1
This is better, though ideally we would also build |
1bfd9d5
to
9ef37a7
Compare
I got libproxy to build too using those macports patches and have updated this PR and the webkitgtk one (#33307). |
@@ -12,22 +12,47 @@ stdenv.mkDerivation rec { | |||
sha256 = "10swd3x576pinx33iwsbd4h15fbh2snmfxzcmab4c56nb08qlbrs"; | |||
}; | |||
|
|||
patches = lib.optionals stdenv.isDarwin [ | |||
(fetchpatch { | |||
url = https://raw.githubusercontent.com/macports/macports-ports/master/net/libproxy/files/patch-libproxy-cmake.diff; |
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.
Rather than master
, we probably want to use a specific commit.
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.
Actually, do we need every one of these patches? It is not like we are building Qt4 or Perl bindings. It would be nice if you could add a comment with an error produced without each patch.
buildInputs = [ dbus networkmanager spidermonkey_38 pcre python2 python3 ]; | ||
buildInputs = [ dbus pcre python2 python3 ] | ||
++ lib.optionals stdenv.isLinux [ networkmanager spidermonkey_38 ] | ||
++ lib.optional stdenv.isDarwin zlib; | ||
|
||
preConfigure = '' | ||
cmakeFlagsArray+=( | ||
"-DWITH_MOZJS=ON" |
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.
How does this flag work when we do not provide spidermonkey?
|
||
preConfigure = '' | ||
cmakeFlagsArray+=( | ||
"-DWITH_MOZJS=ON" | ||
"-DPYTHON2_SITEPKG_DIR=$out/${python2.sitePackages}" | ||
"-DPYTHON3_SITEPKG_DIR=$out/${python3.sitePackages}" | ||
${lib.optionalString stdenv.isDarwin '' | ||
"-DMP_MACOSX=NO" |
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.
We are already using ON
, so we should use OFF
to be consistent.
pkgs/top-level/all-packages.nix
Outdated
@@ -9754,9 +9754,6 @@ with pkgs; | |||
}; | |||
|
|||
libproxy = callPackage ../development/libraries/libproxy { |
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.
You can collapse this to a single line.
"-DMP_MACOSX=NO" | ||
"-DWITH_WEBKIT=NO" | ||
"-DWITH_WEBKIT3=NO" | ||
''} |
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.
Actually, I would move all the flags except for the ones containing $out
to cmakeFlags
attribute in the derivation, this is affront to my sense of aesthetics 😉
@@ -24,6 +24,8 @@ stdenv.mkDerivation rec { | |||
nativeBuildInputs = [ pkgconfig intltool ]; | |||
propagatedBuildInputs = [ glib gnutls libproxy gsettings_desktop_schemas ]; | |||
|
|||
NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null; |
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.
You can also use stdenv.lib.optionalString
.
@@ -1,5 +1,5 @@ | |||
{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake | |||
, dbus, networkmanager, spidermonkey_38, pcre, python2, python3 }: | |||
{ stdenv, lib, fetchFromGitHub, fetchpatch, pkgconfig, cmake |
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.
Also this should probably be a separate commit.
9ef37a7
to
3d3bcc7
Compare
I have updated the PR again based on your comments. I left out the two patches that are not really necessary. I'm not really sure why the other patch is needed. I think it is the circular dependency problem described here. That would explain why without it it fails to find JavaScriptCore (since that will be part of webkitgtk). |
@GrahamcOfBorg build glib_networking |
Could you provide the full build log without any patch (especially the |
|
I do not understand this. The webkit module is only supposed to be build when And that would need to be set here: |
Adding
|
Only thing that comes to mind is the Webkit coming from somewhere else. Let’s try pushing it without the patch and sic @GrahamcOfBorg on it. |
3d3bcc7
to
3b0bf6e
Compare
Pushed. I am also trying out a local build with
in the |
@GrahamcOfBorg build libproxy |
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.
Failure for system: x86_64-darwin
[ 67%] Building CXX object libproxy/CMakeFiles/libproxy.dir/modules/config_macosx.cpp.o
/tmp/nix-build-libproxy-0.4.15.drv-0/source/libproxy/modules/config_macosx.cpp:25:10: fatal error: 'SystemConfiguration/SystemConfiguration.h' file not found
#include <SystemConfiguration/SystemConfiguration.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [libproxy/CMakeFiles/libproxy.dir/build.make:183: libproxy/CMakeFiles/libproxy.dir/modules/config_macosx.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1722: libproxy/CMakeFiles/libproxy.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
builder for ‘/nix/store/3absac5kfz7aa82zw1bjiznqh29h5wvf-libproxy-0.4.15.drv’ failed with exit code 2
error: build of ‘/nix/store/3absac5kfz7aa82zw1bjiznqh29h5wvf-libproxy-0.4.15.drv’ failed
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.
Success for system: x86_64-linux
strip is /nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15/lib /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15/libexec /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15/bin
patching script interpreter paths in /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15
checking for references to /tmp/nix-build-libproxy-0.4.15.drv-0 in /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15...
shrinking RPATHs of ELF executables and libraries in /nix/store/cy1cfksbs9rsz0p0xs7hj618qvjgizpd-libproxy-0.4.15-dev
strip is /nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/cy1cfksbs9rsz0p0xs7hj618qvjgizpd-libproxy-0.4.15-dev/lib
patching script interpreter paths in /nix/store/cy1cfksbs9rsz0p0xs7hj618qvjgizpd-libproxy-0.4.15-dev
checking for references to /tmp/nix-build-libproxy-0.4.15.drv-0 in /nix/store/cy1cfksbs9rsz0p0xs7hj618qvjgizpd-libproxy-0.4.15-dev...
/nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15
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.
Success for system: aarch64-linux
strip is /nix/store/c6qj0j45xizkrx58i65j75a5ysmqhgrs-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/mybb7lkinn9p53diviaccrdgfmfk5nys-libproxy-0.4.15/lib /nix/store/mybb7lkinn9p53diviaccrdgfmfk5nys-libproxy-0.4.15/libexec /nix/store/mybb7lkinn9p53diviaccrdgfmfk5nys-libproxy-0.4.15/bin
patching script interpreter paths in /nix/store/mybb7lkinn9p53diviaccrdgfmfk5nys-libproxy-0.4.15
checking for references to /build in /nix/store/mybb7lkinn9p53diviaccrdgfmfk5nys-libproxy-0.4.15...
shrinking RPATHs of ELF executables and libraries in /nix/store/y71aahgknfzycn7lxzcy6i0yrzszqydn-libproxy-0.4.15-dev
strip is /nix/store/c6qj0j45xizkrx58i65j75a5ysmqhgrs-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/y71aahgknfzycn7lxzcy6i0yrzszqydn-libproxy-0.4.15-dev/lib
patching script interpreter paths in /nix/store/y71aahgknfzycn7lxzcy6i0yrzszqydn-libproxy-0.4.15-dev
checking for references to /build in /nix/store/y71aahgknfzycn7lxzcy6i0yrzszqydn-libproxy-0.4.15-dev...
/nix/store/mybb7lkinn9p53diviaccrdgfmfk5nys-libproxy-0.4.15
3b0bf6e
to
0dc9958
Compare
@GrahamcOfBorg build libproxy |
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.
Success for system: aarch64-linux
/nix/store/mybb7lkinn9p53diviaccrdgfmfk5nys-libproxy-0.4.15
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.
Failure for system: x86_64-darwin
[ 74%] Building CXX object libproxy/CMakeFiles/libproxy.dir/modules/pacrunner_webkit.cpp.o
/tmp/nix-build-libproxy-0.4.15.drv-0/source/libproxy/modules/pacrunner_webkit.cpp:27:10: fatal error: 'JavaScriptCore/JavaScriptCore.h' file not found
#include <JavaScriptCore/JavaScriptCore.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [libproxy/CMakeFiles/libproxy.dir/build.make:279: libproxy/CMakeFiles/libproxy.dir/modules/pacrunner_webkit.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1722: libproxy/CMakeFiles/libproxy.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
builder for ‘/nix/store/mcpqha9yab78ynw5pgzq8x92w3jvmmd5-libproxy-0.4.15.drv’ failed with exit code 2
error: build of ‘/nix/store/mcpqha9yab78ynw5pgzq8x92w3jvmmd5-libproxy-0.4.15.drv’ failed
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.
Success for system: x86_64-linux
strip is /nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15/lib /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15/libexec /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15/bin
patching script interpreter paths in /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15
checking for references to /tmp/nix-build-libproxy-0.4.15.drv-0 in /nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15...
shrinking RPATHs of ELF executables and libraries in /nix/store/cy1cfksbs9rsz0p0xs7hj618qvjgizpd-libproxy-0.4.15-dev
strip is /nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/cy1cfksbs9rsz0p0xs7hj618qvjgizpd-libproxy-0.4.15-dev/lib
patching script interpreter paths in /nix/store/cy1cfksbs9rsz0p0xs7hj618qvjgizpd-libproxy-0.4.15-dev
checking for references to /tmp/nix-build-libproxy-0.4.15.drv-0 in /nix/store/cy1cfksbs9rsz0p0xs7hj618qvjgizpd-libproxy-0.4.15-dev...
/nix/store/akaisi61dvkzb77lkx3sx0cacnmgla50-libproxy-0.4.15
c837994
to
35b706f
Compare
@jtojnar I used the patch you suggested on IRC (with a small change to prevent it trying and failing on the line |
cmakeFlags = lib.optional stdenv.isLinux "-DWITH_MOZJS=ON" | ||
++ lib.optionals stdenv.isDarwin [ | ||
"-DWITH_WEBKIT=OFF" | ||
"-DWITH_WEBKIT3=OFF" |
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.
This is not used with this patch, is it?
@@ -12,22 +12,34 @@ stdenv.mkDerivation rec { | |||
sha256 = "10swd3x576pinx33iwsbd4h15fbh2snmfxzcmab4c56nb08qlbrs"; | |||
}; | |||
|
|||
patches = [ ./files/apple-webkit-disable.patch ]; |
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.
You can just put it next to default.nix
there probably will not be many patches. Ideally we would open a pull request against libproxy and just fetchpatch
ed it.
35b706f
to
d545e11
Compare
@hamishmack Apparently, #34765 got merged, which uses to Apple’s WebKit on Darwin. Maybe we can go with it for now and if fix it later, if the two WebKit libraries clash. |
d545e11
to
56e4d8a
Compare
@jtojnar, sounds good. I have pushed an update so this PR now just adds the |
@GrahamcOfBorg build glib_networking |
Success on x86_64-darwin (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
Success on x86_64-linux (full log) Partial log (click to expand)
|
Thanks. |
Motivation for this change
Replaces #33304
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)