NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.11k stars 14.15k forks source link

wxPython_4_0 is not built for darwin #86040

Closed evils closed 3 years ago

evils commented 4 years ago

Describe the bug wxPython_4_0, while accounting for darwin somewhat, does not build there likely because it uses wxGTK rather than wxmac this prevents kicad from being built on darwin

To Reproduce Steps to reproduce the behavior:

  1. on darwin, nix-build '<nixpkgs>' -A wxPython_4_0

Expected behavior wxPython_4_0 to build on darwin and be usable by kicad there

Additional context i maintain the kicad package and already tried pinging the principle contributor

Notify maintainers while there are no listed maintainers for this package it was initially contributed by @tbenst (if you already investigated after the kicad PR ping, nothing relevant changed since) and has a fair amount of contributions by @FRidh

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: wxPython_4_0
# a list of nixos modules affected by the problem
module:
tbenst commented 4 years ago

Hi @evils, I don't have/use mac but happy to answer any wxPython questions as I can

matthuszagh commented 4 years ago

I'm experiencing the same issue with Linux, using nix-build '<nixpkgs>' -A python3Packages.wxPython_4_0.

tbenst commented 4 years ago

@matthuszagh likely a different issue. Stacktrace? What nixpkgs version / commit?

matthuszagh commented 4 years ago

The latest master branch commit as of this writing. Here's the output I'm seeing.

build log ``` matt@ryzen3950 ~/s/nixpkgs (master)> nix-build -A python3Packages.wxPython_4_0 these derivations will be built: /nix/store/zj33y46bprzvifqzbxpicb1d2mbrlkw2-wxwidgets-3.0.4.drv /nix/store/dcgp5qjzndfhmx0jdr3956rv0dljy6bx-python3.7-wxPython-4.0.7.post2.drv building '/nix/store/zj33y46bprzvifqzbxpicb1d2mbrlkw2-wxwidgets-3.0.4.drv'... unpacking sources unpacking source archive /nix/store/1xl5dhcvqi5jw8fdvwvmdbmryzs8xy0p-source source root is source patching sources applying patch /nix/store/nnd4xngbv13436vyf1sckvbw2nhd32i7-fix_assertion_using_hide_in_destroy.diff patching file src/common/toplvcmn.cpp configuring fixing libtool script ./src/expat/conftools/ltmain.sh fixing libtool script ./src/png/ltmain.sh fixing libtool script ./src/tiff/config/ltmain.sh configure flags: --disable-dependency-tracking --prefix=/nix/store/k71pr7zg67wmnxlrinf3bvgaq3n73zkr-wxwidgets-3.0.4 --disable-precomp-headers --enable-mediactrl --disable-compat24 --enable-compat26 --enable-unicode --with-opengl --enable-webview --enable-webview-webkit checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for --disable-gui... no checking for --enable-monolithic... no checking for --enable-plugins... no checking for --without-subdirs... no checking for --enable-official_build... no checking for --disable-all-features... no checking for --enable-universal... no checking for --enable-nanox... no checking for --enable-gpe... no checking for toolkit... gtk checking for --with-libpng... yes checking for --with-libjpeg... yes checking for --with-libtiff... yes checking for --without-libjbig... no checking for --without-liblzma... no checking for --with-libxpm... yes checking for --with-libiconv... yes checking for --with-libmspack... no checking for --without-gtkprint... no checking for --with-gnomevfs... no checking for --with-libnotify... yes checking for --with-hildon... no checking for --with-opengl... yes checking for --with-dmalloc... no checking for --with-sdl... no checking for --with-regex... yes checking for --with-zlib... yes checking for --with-expat... yes checking for --with-macosx-sdk... checking for --with-macosx-version-min... checking for --enable-debug... default checking for --disable-debug_flag... no checking for --enable-debug_info... no checking for --enable-debug_gdb... no checking for --enable-debug_cntxt... no checking for --enable-mem_tracing... no checking for --disable-shared... no checking for --enable-stl... no checking for --enable-std_containers... no checking for --enable-std_iostreams... yes checking for --enable-std_string... yes checking for --enable-std_string_conv_in_wxstring... no checking for --disable-unicode... no checking for --enable-mslu... no checking for --enable-utf8... no checking for --enable-utf8only... no checking for --enable-extended_rtti... no checking for --disable-optimise... no checking for --enable-profile... no checking for --enable-no_rtti... no checking for --enable-no_exceptions... no checking for --enable-permissive... no checking for --enable-no_deps... no checking for --disable-vararg_macros... no checking for --enable-universal_binary... no checking for --enable-macosx_arch... no checking for --enable-compat26... yes checking for --disable-compat28... no checking for --disable-rpath... no checking for --enable-objc_uniquifying... no checking for --disable-visibility... no checking for --disable-tls... no checking for --enable-intl... yes checking for --enable-xlocale... yes checking for --enable-config... yes checking for --enable-protocols... yes checking for --enable-ftp... yes checking for --enable-http... yes checking for --enable-fileproto... yes checking for --enable-sockets... yes checking for --enable-ipv6... no checking for --enable-ole... yes checking for --enable-dataobj... yes checking for --enable-ipc... yes checking for --enable-baseevtloop... yes checking for --enable-epollloop... yes checking for --enable-selectloop... yes checking for --enable-any... yes checking for --enable-apple_ieee... yes checking for --enable-arcstream... yes checking for --enable-base64... yes checking for --enable-backtrace... yes checking for --enable-catch_segvs... yes checking for --enable-cmdline... yes checking for --enable-datetime... yes checking for --enable-debugreport... yes checking for --enable-dialupman... yes checking for --enable-dynlib... yes checking for --enable-dynamicloader... yes checking for --enable-exceptions... yes checking for --enable-ffile... yes checking for --enable-file... yes checking for --enable-filehistory... yes checking for --enable-filesystem... yes checking for --enable-fontenum... yes checking for --enable-fontmap... yes checking for --enable-fs_archive... yes checking for --enable-fs_inet... yes checking for --enable-fs_zip... yes checking for --enable-fsvolume... yes checking for --enable-fswatcher... yes checking for --enable-geometry... yes checking for --enable-log... yes checking for --enable-longlong... yes checking for --enable-mimetype... yes checking for --enable-printfposparam... yes checking for --enable-snglinst... yes checking for --enable-sound... yes checking for --enable-stdpaths... yes checking for --enable-stopwatch... yes checking for --enable-streams... yes checking for --enable-sysoptions... yes checking for --enable-tarstream... yes checking for --enable-textbuf... yes checking for --enable-textfile... yes checking for --enable-timer... yes checking for --enable-variant... yes checking for --enable-zipstream... yes checking for --enable-url... yes checking for --enable-protocol... yes checking for --enable-protocol_http... yes checking for --enable-protocol_ftp... yes checking for --enable-protocol_file... yes checking for --enable-threads... yes checking for --enable-iniconf... no checking for --enable-regkey... yes checking for --enable-docview... yes checking for --enable-help... yes checking for --enable-mshtmlhelp... yes checking for --enable-html... yes checking for --enable-htmlhelp... yes checking for --enable-xrc... yes checking for --enable-aui... yes checking for --enable-propgrid... yes checking for --enable-ribbon... yes checking for --enable-stc... yes checking for --enable-constraints... yes checking for --enable-loggui... yes checking for --enable-logwin... yes checking for --enable-logdialog... yes checking for --enable-mdi... yes checking for --enable-mdidoc... yes checking for --enable-mediactrl... yes checking for --enable-gstreamer8... no checking for --enable-richtext... yes checking for --enable-postscript... yes checking for --enable-printarch... yes checking for --enable-svg... yes checking for --enable-webkit... yes checking for --enable-webview... yes checking for --enable-graphics_ctx... yes checking for --enable-clipboard... yes checking for --enable-dnd... yes checking for --disable-controls... no checking for --enable-markup... yes checking for --enable-accel... yes checking for --enable-animatectrl... yes checking for --enable-bannerwindow... yes checking for --enable-artstd... yes checking for --enable-arttango... auto checking for --enable-bmpbutton... yes checking for --enable-bmpcombobox... yes checking for --enable-button... yes checking for --enable-calendar... yes checking for --enable-caret... yes checking for --enable-checkbox... yes checking for --enable-checklst... yes checking for --enable-choice... yes checking for --enable-choicebook... yes checking for --enable-collpane... yes checking for --enable-colourpicker... yes checking for --enable-combobox... yes checking for --enable-comboctrl... yes checking for --enable-commandlinkbutton... yes checking for --enable-dataviewctrl... yes checking for --enable-datepick... yes checking for --enable-detect_sm... yes checking for --enable-dirpicker... yes checking for --enable-display... yes checking for --enable-editablebox... yes checking for --enable-filectrl... yes checking for --enable-filepicker... yes checking for --enable-fontpicker... yes checking for --enable-gauge... yes checking for --enable-grid... yes checking for --enable-headerctrl... yes checking for --enable-hyperlink... yes checking for --enable-imaglist... yes checking for --enable-infobar... yes checking for --enable-listbook... yes checking for --enable-listbox... yes checking for --enable-listctrl... yes checking for --enable-notebook... yes checking for --enable-notifmsg... yes checking for --enable-odcombobox... yes checking for --enable-popupwin... yes checking for --enable-prefseditor... yes checking for --enable-radiobox... yes checking for --enable-radiobtn... yes checking for --enable-richmsgdlg... yes checking for --enable-richtooltip... yes checking for --enable-rearrangectrl... yes checking for --enable-sash... yes checking for --enable-scrollbar... yes checking for --enable-searchctrl... yes checking for --enable-slider... yes checking for --enable-spinbtn... yes checking for --enable-spinctrl... yes checking for --enable-splitter... yes checking for --enable-statbmp... yes checking for --enable-statbox... yes checking for --enable-statline... yes checking for --enable-stattext... yes checking for --enable-statusbar... yes checking for --enable-taskbaricon... yes checking for --enable-tbarnative... yes checking for --enable-textctrl... yes checking for --enable-datepick... yes checking for --enable-tipwindow... yes checking for --enable-togglebtn... yes checking for --enable-toolbar... yes checking for --enable-toolbook... yes checking for --enable-treebook... yes checking for --enable-treectrl... yes checking for --enable-treelist... yes checking for --enable-commondlg... yes checking for --enable-aboutdlg... yes checking for --enable-choicedlg... yes checking for --enable-coldlg... yes checking for --enable-filedlg... yes checking for --enable-finddlg... yes checking for --enable-fontdlg... yes checking for --enable-dirdlg... yes checking for --enable-msgdlg... yes checking for --enable-numberdlg... yes checking for --enable-splash... yes checking for --enable-textdlg... yes checking for --enable-tipdlg... yes checking for --enable-progressdlg... yes checking for --enable-wizarddlg... yes checking for --enable-menus... yes checking for --enable-miniframe... yes checking for --enable-tooltips... yes checking for --enable-splines... yes checking for --enable-mousewheel... yes checking for --enable-validators... yes checking for --enable-busyinfo... yes checking for --enable-hotkey... auto checking for --enable-joystick... yes checking for --enable-metafile... auto checking for --enable-dragimage... yes checking for --enable-accessibility... no checking for --enable-uiactionsim... yes checking for --enable-dctransform... yes checking for --enable-webviewwebkit... yes checking for --enable-palette... yes checking for --enable-image... yes checking for --enable-gif... yes checking for --enable-pcx... yes checking for --enable-tga... yes checking for --enable-iff... yes checking for --enable-pnm... yes checking for --enable-xpm... yes checking for --enable-ico_cur... yes checking for --enable-dccache... yes checking for --enable-ps-in-msw... yes checking for --enable-ownerdrawn... yes checking for --enable-uxtheme... yes checking for --enable-wxdib... yes checking for --enable-webviewie... yes checking for --enable-autoidman... no checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether we are using the Intel C compiler... no checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /nix/store/8pajzfyqx1v7dz1znrnrc4pqj5rmnx24-gnugrep-3.4/bin/grep checking for egrep... /nix/store/8pajzfyqx1v7dz1znrnrc4pqj5rmnx24-gnugrep-3.4/bin/grep -E checking whether gcc needs -traditional... no checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether we are using the Intel C++ compiler... no checking whether we are using the Sun C++ compiler... no checking for ar... ar checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for langinfo.h... yes checking for wchar.h... yes checking for sys/select.h... yes checking for cxxabi.h... yes checking for an ANSI C-conforming const... yes checking for inline... inline checking size of short... 2 checking size of void *... 8 checking size of int... 4 checking size of long... 8 checking size of size_t... 8 checking size of long long... 8 checking size of wchar_t... 4 checking for va_copy... yes checking whether the compiler supports variadic macros... yes checking for _FILE_OFFSET_BITS value needed for large files... 64 checking if large file support is available... yes checking for _LARGEFILE_SOURCE value needed for large files... no checking whether byte ordering is bigendian... no checking for iostream... yes checking if C++ compiler supports the explicit keyword... yes checking for std::wstring in ... yes checking for std::istream... yes checking for std::ostream... yes checking how to run the C++ preprocessor... g++ -E checking type_traits usability... yes checking type_traits presence... yes checking for type_traits... yes checking for __sync_fetch_and_add and __sync_sub_and_fetch builtins... yes checking for libraries directories... /no-such-path/lib checking for cos... no checking for floor... no checking if floating point functions link without -lm... no checking for sin... yes checking for ceil... yes checking if floating point functions link with -lm... yes checking for strtoull... yes checking for pkg-config... /nix/store/b5h8lxy474cli3gznif4626v76j0nr1s-pkg-config-0.29.2/bin/pkg-config checking pkg-config is at least version 0.9.0... yes configure: WARNING: Defaulting to the builtin regex library for Unicode build. checking for zlib.h >= 1.1.4... yes checking for zlib.h... (cached) yes checking for deflate in -lz... yes checking for png.h > 0.90... yes checking for png.h... (cached) yes checking for png_sig_cmp in -lpng... yes checking for jpeglib.h... yes checking for jpeg_read_header in -ljpeg... yes checking for tiffio.h... yes checking for TIFFError in -ltiff... yes checking for expat.h... yes checking if expat.h is valid C++ header... yes checking for XML_ParserCreate in -lexpat... yes checking for GTK+ version... checking for pkg-config... /nix/store/b5h8lxy474cli3gznif4626v76j0nr1s-pkg-config-0.29.2/bin/pkg-config checking for GTK+ - version >= 2.6.0... Package gtk+-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-2.0' found no *** Could not run GTK+ test program, checking why... *** The test program failed to compile or link. See the file config.log for the *** exact error that occurred. This usually means GTK+ is incorrectly installed. checking for pkg-config... (cached) /nix/store/b5h8lxy474cli3gznif4626v76j0nr1s-pkg-config-0.29.2/bin/pkg-config checking for GTK+ - version >= 3.0.0... *** 'pkg-config --modversion gtk+-3.0' returned 3.24.17, but GTK+ (3.24.18) *** was found! If pkg-config was correct, then it is best *** to remove the old version of GTK+. You may also be able to fix the error *** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing *** /etc/ld.so.conf. Make sure you have run ldconfig if that is *** required on your system. *** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH *** to point to the correct configuration files no checking for gtk-config... no checking for GTK - version >= 1.2.7... no *** The gtk-config script installed by GTK could not be found *** If GTK was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the GTK_CONFIG environment variable to the *** full path to gtk-config. checking for gtk-config... (cached) no checking for GTK - version >= 1.2.3... no *** The gtk-config script installed by GTK could not be found *** If GTK was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the GTK_CONFIG environment variable to the *** full path to gtk-config. configure: error: The development files for GTK+ were not found. For GTK+ 2, please ensure that pkg-config is in the path and that gtk+-2.0.pc is installed. For GTK+ 1.2 please check that gtk-config is in the path, and that the version is 1.2.3 or above. Also check that the libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config --libs' are in the LD_LIBRARY_PATH or equivalent. builder for '/nix/store/zj33y46bprzvifqzbxpicb1d2mbrlkw2-wxwidgets-3.0.4.drv' failed with exit code 1 cannot build derivation '/nix/store/dcgp5qjzndfhmx0jdr3956rv0dljy6bx-python3.7-wxPython-4.0.7.post2.drv': 1 dependencies couldn't be built error: build of '/nix/store/dcgp5qjzndfhmx0jdr3956rv0dljy6bx-python3.7-wxPython-4.0.7.post2.drv' failed ```

It looks like pkg-config is giving an old version of GTK+?

evils commented 4 years ago

@matthuszagh please use

<details>
<summary> save the scroll wheels </summary>

dump code block here
</details>

your failure seems the same as #86609 which i closed because it's fixed in the staging branch by #86318 and i can confirm nix-build -A python3Packages.wxPython_4_0 at least starts building there (it's still going...) i'm not sure when this fix will get to master...

matthuszagh commented 4 years ago

@evils nice! didn't know about the details tag. Ok yeah that looks like my issue, thanks for pointing me in that direction.

fricklerhandwerk commented 4 years ago

I can reproduce this on 10.14.6. My best take so far was to use wxmac and adapt other Darwin requirements.

diff against master ```diff diff --git a/pkgs/development/python-modules/wxPython/4.0.nix b/pkgs/development/python-modules/wxPython/4.0.nix index 406493362c4..86fa0740876 100644 --- a/pkgs/development/python-modules/wxPython/4.0.nix +++ b/pkgs/development/python-modules/wxPython/4.0.nix @@ -9,6 +9,9 @@ , python , doxygen , ncurses +, wxmac +, darwin +, libintl , wxGTK , numpy , pillow @@ -26,8 +29,16 @@ buildPythonPackage rec { doCheck = false; - nativeBuildInputs = [ pkgconfig which doxygen wxGTK ]; - buildInputs = [ ncurses wxGTK.gtk ]; + nativeBuildInputs = [ pkgconfig which doxygen ] + ++ (if !stdenv.isDarwin then [ wxGTK ] else [ wxmac ]); + buildInputs = [ ncurses libintl ] + ++ (if !stdenv.isDarwin + then + [ wxGTK.gtk ] + else + with darwin.apple_sdk.frameworks; + [ IOKit Carbon Cocoa AudioToolbox OpenGL CoreFoundation ] + ); DOXYGEN = "${doxygen}/bin/doxygen"; @@ -50,7 +61,7 @@ buildPythonPackage rec { ${python.interpreter} setup.py install --skip-build --prefix=$out ''; - passthru = { inherit wxGTK; }; + passthru = { inherit (if !stdenv.isDarwin then wxGTK else wxmac); }; meta = { ```

Unfortunately it does not build with the same errors as for the homebrew maintainers.

fricklerhandwerk commented 4 years ago

Bumped wxmac to 3.0.5.1, added WebKit to its buildInputs, and it builds! --enable-webkit was set, but no dependency specified. That's what caused the missing symbols.

working diff ```diff diff --git a/pkgs/development/libraries/wxwidgets/3.0/mac.nix b/pkgs/development/libraries/wxwidgets/3.0/mac.nix index 1b4c6702451..30e30ab2546 100644 --- a/pkgs/development/libraries/wxwidgets/3.0/mac.nix +++ b/pkgs/development/libraries/wxwidgets/3.0/mac.nix @@ -1,11 +1,11 @@ { stdenv, fetchzip, expat, libiconv, libjpeg, libpng, libtiff, zlib # darwin only attributes , derez, rez, setfile -, AGL, Cocoa, Kernel +, AGL, Cocoa, WebKit, Kernel }: stdenv.mkDerivation rec { - version = "3.0.4"; + version = "3.0.5.1"; pname = "wxmac"; src = fetchzip { @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { buildInputs = [ expat libiconv libjpeg libpng libtiff zlib derez rez setfile - AGL Cocoa Kernel + AGL Cocoa WebKit Kernel ]; postPatch = '' diff --git a/pkgs/development/python-modules/wxPython/4.0.nix b/pkgs/development/python-modules/wxPython/4.0.nix index 406493362c4..86fa0740876 100644 --- a/pkgs/development/python-modules/wxPython/4.0.nix +++ b/pkgs/development/python-modules/wxPython/4.0.nix @@ -9,6 +9,9 @@ , python , doxygen , ncurses +, wxmac +, darwin +, libintl , wxGTK , numpy , pillow @@ -26,8 +29,16 @@ buildPythonPackage rec { doCheck = false; - nativeBuildInputs = [ pkgconfig which doxygen wxGTK ]; - buildInputs = [ ncurses wxGTK.gtk ]; + nativeBuildInputs = [ pkgconfig which doxygen ] + ++ (if !stdenv.isDarwin then [ wxGTK ] else [ wxmac ]); + buildInputs = [ ncurses libintl ] + ++ (if !stdenv.isDarwin + then + [ wxGTK.gtk ] + else + with darwin.apple_sdk.frameworks; + [ IOKit Carbon Cocoa AudioToolbox OpenGL CoreFoundation ] + ); DOXYGEN = "${doxygen}/bin/doxygen"; @@ -50,7 +61,7 @@ buildPythonPackage rec { ${python.interpreter} setup.py install --skip-build --prefix=$out ''; - passthru = { inherit wxGTK; }; + passthru = { inherit (if !stdenv.isDarwin then wxGTK else wxmac); }; meta = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e1f9b43b1e7..e5f392dc61e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15751,7 +15751,7 @@ in }; wxmac = callPackage ../development/libraries/wxwidgets/3.0/mac.nix { - inherit (darwin.apple_sdk.frameworks) AGL Cocoa Kernel; + inherit (darwin.apple_sdk.frameworks) AGL Cocoa WebKit Kernel; inherit (darwin.stubs) setfile rez derez; }; ```

I'm not even sure why this works at all. wxPython claims they build wxWidgets from a git submodule, but obviously in this setup we take whatever is supplied through nix.

To be pedantic, wxPython 4.0.7 is supposed use some specific commit instead of a release, as you can see here. That commit is after* 3.0.4 and shortly before 3.0.5. I only skimmed the diff, but it sounds and looks like backwards-compatible bug fixes. Opinions on how to proceed? If we follow upstream and choose the intermediate revision, what to specify as the package version?

evils commented 4 years ago

i've kinda given up on wxWidgets stuff, at least until the next wxPython release which i hope will either be built based on a wxWidgets release or be compatible with the latest release (i have no reason to believe this would be the case though)

Opinions on how to proceed?

if you have a diff that fixes a package, i recommend you make a PR

wxPython 4.0.7 seems to work with the wxWidgets 3.0.4, it seems reasonable to assume the same would be true for wxmac 3.0.4