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

blink-cmp-fuzzy no longer builds from the #build-plugin flake output on macOS #652

Open
2 tasks done
antoineco opened this issue Dec 19, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@antoineco
Copy link

antoineco commented Dec 19, 2024

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

nix run '.#build-plugin' no longer builds on macOS (15.1.1, arm64) at revision 46eb5f3.

The command ran without issue at revision 85f318b, but now fails with the following error:

error: linking with `cc` failed: exit status: 1
  |
  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/nix/store/017wqvknv5397hma0qv81draxk0anrfk-rust-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/bin:/nix/store/017wqvknv5397hma0qv81draxk0anrfk-rust-nightly-minimal-2024-12-05/bin:/nix/store/3hq83bgy41m9xpifm3hknjf96v75sg33-gcc-wrapper-13.3.0/bin:/Users/acotten/go/bin:/Users/acotten/.local/bin:/Users/acotten/.nix-profile/bin:/etc/profiles/per-user/acotten/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-Wl,-exported_symbols_list" "-Wl,/var/folders/z4/m753y4zs2j3ctll2klt12_j80000gn/T/rustc76MIaZ/list" "/var/folders/z4/m753y4zs2j3ctll2klt12_j80000gn/T/rustc76MIaZ/symbols.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.00.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.01.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.02.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.03.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.04.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.05.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.06.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.07.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.08.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.09.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.10.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.11.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.12.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.13.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.14.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.blink_cmp_fuzzy.9076aa26689284f4-cgu.15.rcgu.o" "/blink.cmp/target/release/deps/blink_cmp_fuzzy.adltrwr66ipk4tkxj3jlj073o.rcgu.o" "/blink.cmp/target/release/deps/libfrizbee-983b3225dbb25c27.rlib" "/blink.cmp/target/release/deps/libheed-c02797bf7b197ffe.rlib" "/blink.cmp/target/release/deps/libpage_size-dd95431b8027b049.rlib" "/blink.cmp/target/release/deps/libheed_types-9875b79871996ed6.rlib" "/blink.cmp/target/release/deps/libserde_json-fc78badc2f73e02e.rlib" "/blink.cmp/target/release/deps/libitoa-938b23dfd7edab47.rlib" "/blink.cmp/target/release/deps/libryu-593dffdec51dbc6c.rlib" "/blink.cmp/target/release/deps/libbincode-13a969e199d30541.rlib" "/blink.cmp/target/release/deps/libbyteorder-10bba7f2cbe3001e.rlib" "/blink.cmp/target/release/deps/libbitflags-aec9da1662164370.rlib" "/blink.cmp/target/release/deps/libserde-44f07589657cca79.rlib" "/blink.cmp/target/release/deps/liblmdb_master_sys-a975ff7d983b2e15.rlib" "/blink.cmp/target/release/deps/libsynchronoise-4fc9694fc95a32c1.rlib" "/blink.cmp/target/release/deps/libcrossbeam_queue-21c4354132a2bf47.rlib" "/blink.cmp/target/release/deps/libcrossbeam_utils-404dcf96149056e9.rlib" "/blink.cmp/target/release/deps/libonce_cell-6a0e3694097d563f.rlib" "/blink.cmp/target/release/deps/libheed_traits-0ee445d7b987a5d7.rlib" "/blink.cmp/target/release/deps/libregex-3326e17e8e14eddb.rlib" "/blink.cmp/target/release/deps/libregex_automata-0333dcde36f888ac.rlib" "/blink.cmp/target/release/deps/libaho_corasick-7b34d8600b5d49db.rlib" "/blink.cmp/target/release/deps/libregex_syntax-57412439903b9871.rlib" "/blink.cmp/target/release/deps/libmlua-d1a8f41c5477a451.rlib" "/blink.cmp/target/release/deps/libeither-ce0475901c72df32.rlib" "/blink.cmp/target/release/deps/librustc_hash-ee9393192f86f82a.rlib" "/blink.cmp/target/release/deps/libparking_lot-3c8c36bf236fd469.rlib" "/blink.cmp/target/release/deps/libparking_lot_core-3465eb1bcfae9cbe.rlib" "/blink.cmp/target/release/deps/liblibc-cdffed7176ed0db0.rlib" "/blink.cmp/target/release/deps/libcfg_if-237ca97c10329bbb.rlib" "/blink.cmp/target/release/deps/libsmallvec-4a38823d62c9f18b.rlib" "/blink.cmp/target/release/deps/liblock_api-859a4ec40813d543.rlib" "/blink.cmp/target/release/deps/libscopeguard-91dc0781da109ffe.rlib" "/blink.cmp/target/release/deps/libmlua_sys-20edcb13f77dccf6.rlib" "/blink.cmp/target/release/deps/libnum_traits-8e9b70b1d09d52d4.rlib" "/blink.cmp/target/release/deps/libbstr-c9ae8ba000038548.rlib" "/blink.cmp/target/release/deps/libmemchr-24810b688e3ddc5e.rlib" "/blink.cmp/target/release/deps/liblazy_static-3e47bd3122c6f73b.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libstd-560f0ba65be8a719.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-41d44c661d6484d4.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libobject-8634c447cc4a44e1.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-ac4732ca6daebb51.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-c8b02707a1d0316f.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libgimli-71738fd19ca7ee37.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-9d6ecc9a40f938aa.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-5b224714d5f246f3.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-4ced8cc4820dbc3c.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-26ad4b898cc84540.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-19603074627da9cb.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libadler-cb53e4341e186e9e.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libunwind-57c5c850572258da.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-829391a7ef1928a1.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/liblibc-95581a51a4b5aefa.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/liballoc-aabfc96903587412.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-86a91ad72b99b853.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libcore-0d6279724923194b.rlib" "/nix/store/kni0kbn2v7vi9qir8iq69rl0kfls5n8q-rust-std-nightly-minimal-2024-12-05/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-20c2533b0c822356.rlib" "-liconv" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-L" "/blink.cmp/target/release/build/lmdb-master-sys-2a866083c22e9833/out" "-o" "/blink.cmp/target/release/deps/libblink_cmp_fuzzy.dylib" "-Wl,-dead_strip" "-dynamiclib" "-nodefaultlibs" "-undefined" "dynamic_lookup"
  = note: ld: library not found for -liconv
          collect2: error: ld returned 1 exit status


error: could not compile `blink-cmp-fuzzy` (lib) due to 1 previous error

blink.cmp version: branch, tag, or commit

master(46eb5f3)

@antoineco antoineco added the bug Something isn't working label Dec 19, 2024
@antoineco
Copy link
Author

antoineco commented Dec 19, 2024

I found the culprit via git bisect: 380bccf

Some extra information about the different GCC versions involved:

$ gcc --version  # host
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ gcc --version  # devshell
gcc (GCC) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Interestingly, the build succeeds from within the devshell:

$ nix develop .
(nix:blink-env) bash-5.2$
$ cargo build --release  # (nix:blink-env)
    Compiling [...]
    Finished `release` profile [optimized] target(s) in 13.14s
$ ls -l target/release/libblink_cmp_fuzzy.dylib  # (nix:blink-env)
-rwxr-xr-x 1 acotten staff 2096288 Dec 19 11:20 target/release/libblink_cmp_fuzzy.dylib

If I remove gcc from the flake, the build also succeeds:

--- a/flake.nix
+++ b/flake.nix
@@ -76,7 +76,7 @@
           program = let
             buildScript = pkgs.writeShellApplication {
               name = "build-plugin";
-              runtimeInputs = with pkgs; [ fenix.minimal.toolchain gcc ];
+              runtimeInputs = with pkgs; [ fenix.minimal.toolchain ];
               text = ''
                 cargo build --release
               '';
@@ -88,7 +88,6 @@
         devShells.default = pkgs.mkShell {
           name = "blink";
           packages = with pkgs; [
-            gcc
             fenix.complete.toolchain
             rust-analyzer-nightly
             nix-update
$ gcc --version  # (nix:blink-env)
error: tool 'gcc' not found
$ cargo build --release  # (nix:blink-env)
    Compiling [...]
    Finished `release` profile [optimized] target(s) in 13.40s

@antoineco antoineco changed the title blink-cmp-fuzzy no longer builds on macOS blink-cmp-fuzzy no longer builds from the #build-plugin flake output on macOS Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant