Skip to content

neovim: add ldflag for treesitter plugins requiring libstdc++#155688

Merged
jonringer merged 1 commit intoNixOS:masterfrom
Thornycrackers-Forks:master
Jan 24, 2022
Merged

neovim: add ldflag for treesitter plugins requiring libstdc++#155688
jonringer merged 1 commit intoNixOS:masterfrom
Thornycrackers-Forks:master

Conversation

@thornycrackers
Copy link
Copy Markdown
Contributor

Motivation for this change

#147658

Things done
  • Built on platform(s)
    • [*] x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

This just completes the review from #147658 so that it can get merged. It's a longstanding issue with a very simple change so I'm just trying to help it along. Thanks @jonringer for reviewing the original.

@github-actions github-actions bot added the 6.topic: vim Advanced text editor label Jan 19, 2022
@ofborg ofborg bot requested review from Ma27, manveru and rvolosatovs January 19, 2022 18:24
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 19, 2022
@rvolosatovs
Copy link
Copy Markdown
Member

refs #147658 (review)

@kubukoz
Copy link
Copy Markdown
Member

kubukoz commented Jan 25, 2022

I think this broke the build on darwin (see https://hydra.nixos.org/build/165247176), should this flag be removed on that system?

Build log
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/wsv1a3dn034cmyykig8xmip2h5zwaqb7-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/jnp9n2x9cdvl47da3656illrd3p2qvb5-system_rplugin_manifest.patch
patching file runtime/autoload/remote/host.vim
patching file runtime/plugin/rplugin.vim
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/share/doc/nvim -DCMAKE_INSTALL_INFODIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/include -DCMAKE_INSTALL_SBINDIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/3ap3mhd6zg3byiqqqyqbhr8phbwxca01-clang-wrapper-11.1.0/bin/strip -DCMAKE_RANLIB=/nix/store/nf1fzw7xingi0avxg77mim6bz5nm3xl4-cctools-binutils-darwin-949.0.1/bin/ranlib -DCMAKE_AR=/nix/store/nf1fzw7xingi0avxg77mim6bz5nm3xl4-cctools-binutils-darwin-949.0.1/bin/ar -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX=/nix/store/dhbv5w5hm3j6zgsw8yv4wgpfdfnkgmhf-neovim-unwrapped-0.6.1 -DGPERF_PRG=/nix/store/xjkwy0l6yi8wn58a8fmzgcvcy6714qk4-gperf-3.1/bin/gperf -DLUA_PRG=/nix/store/5q24jjv31ijwznspmvfqnl95ka0fsx8j-luajit-2.1.0-2021-10-27-env/bin/lua -DLIBLUV_LIBRARY=/nix/store/z294rsb6d8fyxal9qrjjlr5716jq53za-luajit-2.1.0-2021-10-27-luv-1.42.0-0/lib/lua/5.1/libluv.1.42.0.dylib -DUSE_BUNDLED=OFF 
-- The C compiler identification is Clang 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /nix/store/3ap3mhd6zg3byiqqqyqbhr8phbwxca01-clang-wrapper-11.1.0/bin/clang
-- Check for working C compiler: /nix/store/3ap3mhd6zg3byiqqqyqbhr8phbwxca01-clang-wrapper-11.1.0/bin/clang - broken
�[31mCMake Error at /nix/store/fxbkqqwm2x45nsmr9s30w7l55cj4494r-cmake-3.22.1/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/nix/store/3ap3mhd6zg3byiqqqyqbhr8phbwxca01-clang-wrapper-11.1.0/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /tmp/nix-build-neovim-unwrapped-0.6.1.drv-0/source/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/nix/store/x106zq8vrcjqzxfr4k8ipv7alnc65ydz-gnumake-4.3/bin/make -f Makefile cmTC_476b7/fast && /nix/store/x106zq8vrcjqzxfr4k8ipv7alnc65ydz-gnumake-4.3/bin/make  -f CMakeFiles/cmTC_476b7.dir/build.make CMakeFiles/cmTC_476b7.dir/build
    make[1]: Entering directory '/private/tmp/nix-build-neovim-unwrapped-0.6.1.drv-0/source/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_476b7.dir/testCCompiler.c.o
    /nix/store/3ap3mhd6zg3byiqqqyqbhr8phbwxca01-clang-wrapper-11.1.0/bin/clang    -MD -MT CMakeFiles/cmTC_476b7.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_476b7.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_476b7.dir/testCCompiler.c.o -c /tmp/nix-build-neovim-unwrapped-0.6.1.drv-0/source/build/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_476b7
    /nix/store/fxbkqqwm2x45nsmr9s30w7l55cj4494r-cmake-3.22.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_476b7.dir/link.txt --verbose=1
    /nix/store/3ap3mhd6zg3byiqqqyqbhr8phbwxca01-clang-wrapper-11.1.0/bin/clang -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_476b7.dir/testCCompiler.c.o -o cmTC_476b7 
    ld: library not found for -libc++
    clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [CMakeFiles/cmTC_476b7.dir/build.make:100: cmTC_476b7] Error 1
    make[1]: Leaving directory '/private/tmp/nix-build-neovim-unwrapped-0.6.1.drv-0/source/build/CMakeFiles/CMakeTmp'
    make: *** [Makefile:127: cmTC_476b7/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)

�[0m
-- Configuring incomplete, errors occurred!
See also "/tmp/nix-build-neovim-unwrapped-0.6.1.drv-0/source/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/nix-build-neovim-unwrapped-0.6.1.drv-0/source/build/CMakeFiles/CMakeError.log".

@techknowlogick
Copy link
Copy Markdown
Member

Can confirm that this broke at least darwin/arm64, just tested locally and am having the same build errors as hydra link

@kubukoz
Copy link
Copy Markdown
Member

kubukoz commented Jan 25, 2022

I checked both arm64 and amd64 machines, they're Monterey and Catalina respectively.

@ghisvail
Copy link
Copy Markdown

Same here on Monterey amd64.

@nifoc
Copy link
Copy Markdown
Contributor

nifoc commented Jan 25, 2022

Can confirm that simply doing

pkgs.neovim.overrideAttrs (oldAttrs: rec {
  NIX_LDFLAGS = [ ];
})

makes neovim compile again on aarch64-darwin.

@jonringer
Copy link
Copy Markdown
Contributor

I'll scope to just glibc then

@lockejan
Copy link
Copy Markdown
Contributor

Why isn't it the default that such changes are also tested against all other relevant architectures before merging it into master? (darwin in this particular situation)
I appreciate the quick fix, but since hydra's build is currently stuck it will probably take some time till the fix is online and I'm thinking this could have been avoided in the first place.😐

@jonringer
Copy link
Copy Markdown
Contributor

Why isn't it the default that such changes are also tested against all other relevant architectures before merging it into master? (darwin in this particular situation) I appreciate the quick fix, but since hydra's build is currently stuck it will probably take some time till the fix is online and I'm thinking this could have been avoided in the first place.neutral_face

  1. Not reasonable to expect contributors to have multiple variants of hardware.
  2. Darwin is a signficantly smaller community within nixpkgs
  1. Increasing darwin compute is much more expensive (legally)

The main thing is just darwin user participation.

@kubukoz
Copy link
Copy Markdown
Member

kubukoz commented Jan 26, 2022

As for availability, the build doesn't take that long and you can update to the latest master by using that as a channel / flake input, so I'm not complaining about that 🙂

I wish some kind of checking was done as part of each PR but it's understandable that it's difficult right now.

@jonringer
Copy link
Copy Markdown
Contributor

jonringer commented Jan 26, 2022

darwin builds don't get kicked off for ofborg normally, unless you're added to a trusted user list (this may have changed). But the reasoning was that darwin builds can't be properly sandboxed.

Example PR with x86_64-linux, aarch64-darwin, and aarch64-linux are kicked off: #156836

@lockejan
Copy link
Copy Markdown
Contributor

darwin builds don't get kicked off for ofborg normally, unless you're added to a trusted user list (this may have changed). But the reasoning was that darwin builds can't be properly sandboxed.

Example PR with x86_64-linux, x86_64-darwin, and aarch64-linux are kicked off: #156836

Thank you for clarifying. Makes sense how you put it.
I was naively thinking that the given darwin infrastructure could have been used in an automatic way already, which was the reasoning behind my comment.

Given your explanation and example I see we aren't there yet, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: vim Advanced text editor 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants