Describe the bug
The latest macvim fails to install with a build error like below
...
error: install_name_tool: changing install names or rpaths can't be redone for: /nix/store/r5iba8lnnwiyrvlgp5076a4898i7aryi-macvim-8.1.2234/Applications/MacVim.app/Contents/MacOS/Vim (for architecture x86_64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)
builder for '/nix/store/rbrryamfcww2bsgr594mv90qrhwcrmrm-macvim-8.1.2234.drv' failed with exit code 1
error: build of '/nix/store/rbrryamfcww2bsgr594mv90qrhwcrmrm-macvim-8.1.2234.drv' failed
I think this change is the cause: https://github.com/NixOS/nixpkgs/commit/647ee3c2f0d6fea832f5e048beb652dafefc4117#diff-588d7d555a8662462d46ffa6d34133af
The previous version builds fine.
To Reproduce
nix-env -i macvim or nix-env -u macvimnix-env --rollbacknix-env -i macvim works fineExpected behavior
Should install/update fine.
Screenshots
N/A
Additional context
macOS 10.14.6 (18G87)
Metadata
Please run nix run nixpkgs.nix-info -c nix-info -m and paste the result.
[2 copied (0.0 MiB), 0.0 MiB DL]
- system: `"x86_64-darwin"`
- host os: `Darwin 18.7.0, macOS 10.14.6`
- multi-user?: `no`
- sandbox: `no`
- version: `nix-env (Nix) 2.3.1`
- channels(jinwoo): `"nixpkgs-20.03pre201329.f1682a7f126"`
- nixpkgs: `/Users/jinwoo/.nix-defexpr/channels/nixpkgs`
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
cc: @lilyball
Huh, it builds on my 10.14.6 machine, I wonder what the difference is. Also looking through the build output right now I see -headerpad_max_install_names on the link command for MacVim.
@jinwoo Did you customize macvim, or just build it as-is?
I guess the link command for the Vim binary doesn't include -headerpad_max_install_names, just the one for MacVim.
@jinwoo Did you customize macvim, or just build it as-is?
I don't have any customizations.
Ok I鈥檒l look into adding the right flag to the Vim link step when I can.
@jinwoo Can you test #73592 and let me know if that fixes it?
@lilyball Will do but I'm quite new to nix and don't know how to apply that change to my local nix env. Any pointers?
Normally I'd suggest using nix-review to build it, but that builds with the sandbox and macvim can't build with the full sandbox (it requires the sandbox to be off or in relaxed).
Given that, what you can do is just check out the PR branch. If you have a git checkout of nixpkgs this can be done with git fetch origin pull/73592/HEAD && git checkout FETCH_HEAD. Then you can run nix-build -A macvim . to build macvim from that checkout. If this succeeds it'll create a result symlink in the current directory that contains the build results. You could in theory install this into your environment too if you like, with nix-env -i ./result.
Normally I'd suggest using
nix-reviewto build it, but that builds with the sandbox and macvim can't build with the full sandbox (it requires the sandbox to be off or inrelaxed).
Can do
nix-review pr --build-args "--option build-use-sandbox relaxed" 73592
or
nix-env -iA macvim -f https://github.com/NixOS/nixpkgs/archive/e9d1262eb2c5f675d1e7bae4185cb8c3e18d7139.tar.gz
nix-env -iA macvim -f https://github.com/NixOS/nixpkgs/archive/e9d1262eb2c5f675d1e7bae4185cb8c3e18d7139.tar.gz
worked. Thanks, @lilyball & @veprbl !
@jinwoo Thank you for testing. I will merge the fix now.