nix-community / nixvim

Configure Neovim with Nix! [maintainer=@GaetanLepage, @traxys, @mattsturgeon, @khaneliman]
https://nix-community.github.io/nixvim
MIT License
1.6k stars 250 forks source link

[BUG] Nixvim fails to build in cross-compile #1946

Open 347Online opened 1 month ago

347Online commented 1 month ago
Field Description
Plugin N/A
Nixpkgs unstable
Home Manager unstable

Description

Nixvim fails to build when cross-compiling with qemu

The target system can run the configuration with nix run, however adding it to a package list fails

Log:

structuredAttrs is enabled
sourcing setup hook '/nix/store/dk1q4pj1d824fm7kvpryc4nmikb5hbih-make-shell-wrapper-hook/nix-support/setup-hook'
sourcing setup hook '/nix/store/jlcm4q3p5gzc9nfc8fxd8mkhcrv9zcrq-die-hook/nix-support/setup-hook'
sourcing setup hook '/nix/store/yq6n8b0mnk0qxzbs3ajsjcp8ziwqylrl-patchelf-0.15.0/nix-support/setup-hook'
sourcing setup hook '/nix/store/iks1pihvbilsh5sy8qvpd638k422w9i8-update-autotools-gnu-config-scripts-hook/nix-support/setup-hook'
sourcing setup hook '/nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh'
sourcing setup hook '/nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh'
sourcing setup hook '/nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh'
sourcing setup hook '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh'
sourcing setup hook '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh'
sourcing setup hook '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh'
sourcing setup hook '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh'
sourcing setup hook '/nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh'
sourcing setup hook '/nix/store/ilaf1w22bxi6jsi45alhmvvdgy4ly3zs-patch-shebangs.sh'
sourcing setup hook '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh'
sourcing setup hook '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh'
sourcing setup hook '/nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh'
sourcing setup hook '/nix/store/gps9qrh99j7g02840wv5x78ykmz30byp-strip.sh'
sourcing setup hook '/nix/store/kp2j7yn0wzwq5piy494r54dafrh83s6s-gcc-wrapper-13.3.0/nix-support/setup-hook'
sourcing setup hook '/nix/store/9rz99vibv1782dxjkwvxr29s7f2f86wl-binutils-wrapper-2.42/nix-support/setup-hook'
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/dk1q4pj1d824fm7kvpryc4nmikb5hbih-make-shell-wrapper-hook
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/dk1q4pj1d824fm7kvpryc4nmikb5hbih-make-shell-wrapper-hook
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/jlcm4q3p5gzc9nfc8fxd8mkhcrv9zcrq-die-hook
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/jlcm4q3p5gzc9nfc8fxd8mkhcrv9zcrq-die-hook
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/d9rmgjrv7vam414fa0n0zf40dlgyicmd-lndir-1.0.5
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/d9rmgjrv7vam414fa0n0zf40dlgyicmd-lndir-1.0.5
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/yq6n8b0mnk0qxzbs3ajsjcp8ziwqylrl-patchelf-0.15.0
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/yq6n8b0mnk0qxzbs3ajsjcp8ziwqylrl-patchelf-0.15.0
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/iks1pihvbilsh5sy8qvpd638k422w9i8-update-autotools-gnu-config-scripts-hook
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/iks1pihvbilsh5sy8qvpd638k422w9i8-update-autotools-gnu-config-scripts-hook
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/ilaf1w22bxi6jsi45alhmvvdgy4ly3zs-patch-shebangs.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/ilaf1w22bxi6jsi45alhmvvdgy4ly3zs-patch-shebangs.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/gps9qrh99j7g02840wv5x78ykmz30byp-strip.sh
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/gps9qrh99j7g02840wv5x78ykmz30byp-strip.sh
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/kp2j7yn0wzwq5piy494r54dafrh83s6s-gcc-wrapper-13.3.0
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/kp2j7yn0wzwq5piy494r54dafrh83s6s-gcc-wrapper-13.3.0
calling 'envHostHostHook' function hook 'ccWrapper_addCVars' /nix/store/9rz99vibv1782dxjkwvxr29s7f2f86wl-binutils-wrapper-2.42
calling 'envHostHostHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/9rz99vibv1782dxjkwvxr29s7f2f86wl-binutils-wrapper-2.42
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/dk1q4pj1d824fm7kvpryc4nmikb5hbih-make-shell-wrapper-hook
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/dk1q4pj1d824fm7kvpryc4nmikb5hbih-make-shell-wrapper-hook
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/jlcm4q3p5gzc9nfc8fxd8mkhcrv9zcrq-die-hook
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/jlcm4q3p5gzc9nfc8fxd8mkhcrv9zcrq-die-hook
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/d9rmgjrv7vam414fa0n0zf40dlgyicmd-lndir-1.0.5
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/d9rmgjrv7vam414fa0n0zf40dlgyicmd-lndir-1.0.5
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/yq6n8b0mnk0qxzbs3ajsjcp8ziwqylrl-patchelf-0.15.0
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/yq6n8b0mnk0qxzbs3ajsjcp8ziwqylrl-patchelf-0.15.0
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/iks1pihvbilsh5sy8qvpd638k422w9i8-update-autotools-gnu-config-scripts-hook
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/iks1pihvbilsh5sy8qvpd638k422w9i8-update-autotools-gnu-config-scripts-hook
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/ilaf1w22bxi6jsi45alhmvvdgy4ly3zs-patch-shebangs.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/ilaf1w22bxi6jsi45alhmvvdgy4ly3zs-patch-shebangs.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/gps9qrh99j7g02840wv5x78ykmz30byp-strip.sh
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/gps9qrh99j7g02840wv5x78ykmz30byp-strip.sh
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/kp2j7yn0wzwq5piy494r54dafrh83s6s-gcc-wrapper-13.3.0
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/kp2j7yn0wzwq5piy494r54dafrh83s6s-gcc-wrapper-13.3.0
calling 'envHostTargetHook' function hook 'ccWrapper_addCVars' /nix/store/9rz99vibv1782dxjkwvxr29s7f2f86wl-binutils-wrapper-2.42
calling 'envHostTargetHook' function hook 'bintoolsWrapper_addLDVars' /nix/store/9rz99vibv1782dxjkwvxr29s7f2f86wl-binutils-wrapper-2.42
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
calling 'preConfigure' function hook '_multioutConfig'
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
evaling implicit 'postBuild' string hook
Generating remote plugin manifest
/nix/store/jmbwq7gw85ap0zyyhy8nlp04188m02j5-neovim-0.10.1/bin/nvim-wrapper: error while loading shared libraries: libluajit-5.1.so.2: failed to map segment from shared object

Generating rplugin.vim failed!

Minimal, Reproducible Example (MRE)

https://github.com/347Online/nixvim-qemu-mre

347Online commented 1 month ago

Apologies for the delay, I have added the minimal reproduction example

I've tried to strip out everything unnecessary as best I can. The hardware configuration is included for completeness, however if attempting to reproduce, one would likely want to use the result of running nixos-generate-config for the target machine

MattSturgeon commented 1 month ago

Appologies for the delay looking at this. I'm not sure I'll be much help either, as I've not messed with cross-compile before.

/nix/store/4py05ai8azw14nlvfcc46r8930n4p4kv-neovim-0.10.1/bin/nvim-wrapper: error while loading shared libraries: libluajit-5.1.so.2: failed to map segment from shared object

appears to be an error in the nixpkgs pkgs.wrapNeovimUnstable function, so potentially not a nixvim issue per-se.

I'm slightly confused, because your issue describes home-manager modules working but using a standalone package failing, however your MRE is using the nixos module not standalone.

Does that MRE still produce the issue?

We've had other users with cross-compile issues before, however AFAIK those were resolved when we removed all instances of IFD from nixvim.

347Online commented 2 weeks ago

@MattSturgeon Sorry for the delay!

To answer your question, yes, that MRE produces the issue. I'm not sure how I got it in my head that it was working via home-manager, it is broken in all cases, which makes more sense.

I've tried to update the issue to be a little clearer, let me know if there's anything I can shed more light on :)