NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.15k stars 14.18k forks source link

Dino fails to build on aarch64-darwin #213828

Closed BatteredBunny closed 1 year ago

BatteredBunny commented 1 year ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build dino

Build log

https://gist.github.com/ayes-web/5ddfba641cb8831d097f55b3ebb00448

Additional context

Add any other context about the problem here.

Notify maintainers

@alyssais @tomfitzhenry

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

mina@navi ~> nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 22.2.0, macOS 13.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.13.2`
 - channels(mina): `"darwin, home-manager, nixpkgs"`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/Users/mina/.nix-defexpr/channels/nixpkgs`
superherointj commented 1 year ago

Here's my random guess:

From logs, error seems to be:

At nixpkgs, seems to be package: pcre2

My initial guess would be to replace pcre with pcre2 at:

And try to build it.

I cannot build for aarch64-darwin. So I cannot test it.

In case that works for you, open a PR fixing it.

wegank commented 1 year ago

A dirty hack:

  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lgpg-error";
superherointj commented 1 year ago

A dirty hack:

  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lgpg-error";

Can you provide more context for this? (I'm not sure of the intent.)

wegank commented 1 year ago

A dirty hack:

  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lgpg-error";

Can you provide more context for this? (I'm not sure of the intent.)

In the provided build log:

[849/857] Linking C shared library plugins/openpgp.dylib
FAILED: plugins/openpgp.dylib 
: && /nix/store/bwscr98440mhhlg556fqhp5ll2fxnfic-clang-wrapper-11.1.0/bin/clang -fdiagnostics-color -Wall -Wextra -Werror=format-security -Wno-duplicate-decl-specifier -fno-omit-frame-pointer -g -O3 -DNDEBUG  -dynamiclib -Wl,-headerpad_max_install_names  -o plugins/openpgp.dylib -install_name @rpath/openpgp.dylib plugins/openpgp/CMakeFiles/openpgp.dir/src/file_transfer/file_decryptor.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/file_transfer/file_encryptor.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/account_settings_entry.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/account_settings_widget.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/contact_details_provider.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/database.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/encryption_list_entry.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/manager.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/plugin.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/register_plugin.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/stream_flag.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/stream_module.c.o plugins/openpgp/CMakeFiles/openpgp.dir/src/util.c.o plugins/openpgp/CMakeFiles/openpgp.dir/resources/resources.c.o  -Wl,-rpath,/tmp/nix-build-dino-0.3.1.drv-0/source/build  libdino.0.0.dylib  plugins/gpgme-vala/libgpgme-vala.a  libxmpp-vala.0.1.dylib  /nix/store/civ9n1ja12x3npvi3g00yhlmvr5qab5d-icu4c-72.1/lib/libicuuc.dylib  /nix/store/civ9n1ja12x3npvi3g00yhlmvr5qab5d-icu4c-72.1/lib/libicudata.dylib  libqlite.0.1.dylib  /nix/store/11qwahzi3ydd0jknck2pf3q6kqn8s77q-sqlite-3.40.1/lib/libsqlite3.dylib  -lm  /nix/store/kxpk4w9rband33wmykilwq5qa0l9wwjn-gpgme-1.18.0/lib/libgpgme.dylib  /nix/store/7mmnygq9fh2nahxvanvrb224r8j9x3di-libgee-0.20.6/lib/libgee-0.8.dylib  /nix/store/9q3ad0i1fdc5cflpbk4hdb5x7m4kc9v2-glib-2.74.3/lib/libgmodule-2.0.dylib  /nix/store/phyzpb3z28xvxwlz3ww1ny21bw5ml6hx-gtk+3-3.24.35/lib/libgtk-3.dylib  /nix/store/phyzpb3z28xvxwlz3ww1ny21bw5ml6hx-gtk+3-3.24.35/lib/libgdk-3.dylib  /nix/store/55q3bji3rx9w4993hnb5rhiiv6gi88jn-zlib-1.2.13/lib/libz.dylib  /nix/store/gxlpsrfpnp0ki5i94glqbl5gz3w6xmc6-pango-1.50.12/lib/libpangocairo-1.0.dylib  /nix/store/gxlpsrfpnp0ki5i94glqbl5gz3w6xmc6-pango-1.50.12/lib/libpango-1.0.dylib  /nix/store/51463hr66m50fk96yk1nqdf8fzmjpl05-harfbuzz-6.0.0/lib/libharfbuzz.dylib  /nix/store/fny44qp6w28wgvdlqw1vycn2knmcwing-at-spi2-core-2.46.0/lib/libatk-1.0.dylib  /nix/store/8kq5m3j1nqf1118ll5lprggmc2rg37xx-cairo-1.16.0/lib/libcairo-gobject.dylib  /nix/store/8kq5m3j1nqf1118ll5lprggmc2rg37xx-cairo-1.16.0/lib/libcairo.dylib  /nix/store/zap6rc795kc0fm8dlzw4xns9aj1as1i3-gdk-pixbuf-2.42.10/lib/libgdk_pixbuf-2.0.dylib  /nix/store/9q3ad0i1fdc5cflpbk4hdb5x7m4kc9v2-glib-2.74.3/lib/libgio-2.0.dylib  /nix/store/9q3ad0i1fdc5cflpbk4hdb5x7m4kc9v2-glib-2.74.3/lib/libgobject-2.0.dylib  /nix/store/9q3ad0i1fdc5cflpbk4hdb5x7m4kc9v2-glib-2.74.3/lib/libglib-2.0.dylib && :
Undefined symbols for architecture arm64:
  "_gpg_strerror", referenced from:
      _gpg_helper_encrypt_armor in libgpgme-vala.a(gpgme_helper.c.o)
      _gpgme_op_encrypt_ in libgpgme-vala.a(gpgme_helper.c.o)
      _gpg_helper_encrypt_file in libgpgme-vala.a(gpgme_helper.c.o)
      _gpg_helper_decrypt in libgpgme-vala.a(gpgme_helper.c.o)
      _gpgme_op_decrypt_ in libgpgme-vala.a(gpgme_helper.c.o)
      _gpg_helper_decrypt_data in libgpgme-vala.a(gpgme_helper.c.o)
      _gpg_helper_sign in libgpgme-vala.a(gpgme_helper.c.o)
      ...
ld: symbol(s) not found for architecture arm64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
superherointj commented 1 year ago

@wegank Thanks for clarifying. I couldn't build package. So I don't know the actual solution myself. But it is good that you have added more hints on how to have it fixed. Hope someone tries it to confirm issue/solution. I see, you have solved it. Great!

wegank commented 1 year ago
Capture d’écran 2023-02-01 à 02 28 22