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

luarocks: patch sw_vers and gcc #55580

Merged
merged 2 commits into from Feb 11, 2019
Merged

luarocks: patch sw_vers and gcc #55580

merged 2 commits into from Feb 11, 2019

Conversation

LnL7
Copy link
Member

@LnL7 LnL7 commented Feb 11, 2019

Motivation for this change

Fixes #55553

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The sw_vers binary is not part of the stdenv and it would make builds
impure based on what macOS version they where built on.
The unzip variable is only set if it's an attribute and it's a
propagated input so it is already part of PATH.
@LnL7
Copy link
Member Author

LnL7 commented Feb 11, 2019

/cc @teto The second commit resulted in PATH=/bin:$PATH, this caused the chmod error because /bin contains the bsd version that doesn't support --. (Without sandboxing)

@7c6f434c
Copy link
Member

@GrahamcOfBorg build luaPackages.mpack neovim luaPackages.lgi

@7c6f434c
Copy link
Member

No Cc for me? (I agree the changes should not change anything on Linux, but I want the success of that NixOS check on record)

@LnL7
Copy link
Member Author

LnL7 commented Feb 11, 2019

Oh, didn't realise you're also a lua user 😄, we could make the patches conditional but I generally prefer not to.

@7c6f434c
Copy link
Member

Not a heavy Lua user, but I do run some LÖVE stuff from time to time. A keen observer might have noticed I am the one who merges @teto's PRs most of the time; I am actually listed as the package maintainer for some Lua packages…

(on the other hand, yeah, that means that Cc doesn't matter as ofBorg eventually sends a review request — overwriting my preexisting review)

@7c6f434c 7c6f434c merged commit 5b0e7de into NixOS:master Feb 11, 2019
@LnL7 LnL7 deleted the darwin-luarocks branch February 11, 2019 20:58
@7c6f434c
Copy link
Member

For the record: I pressed the «merge button», GitHub said that the merge failed (happens), «Try again» did not refresh the lack-of-conflict status, reloading shows the commit as merged. What the… convenient UI.

@teto
Copy link
Member

teto commented Feb 12, 2019

@LnL7 thanks for troubleshooting this, testing via ofborg is not very productive and I was really troubled by the message saying the folder doesn't exist while it existed on linux.
@7c6f434c Thanks for following up on the aftermath of my changes. I am sorry for the trouble but considering the amount of changes, I guess it's unavoidable but hopefully the future is brigther.

As for the changes themselves, when I looked in nixpkgs, some packages patch the path to sw_vers while others replace it with 10.10. Why did you choose the latter ?
Removing unzip from PATH means that luarocks won't be able to install src.rock (=zip files) so this should break the install of src.rock packages. I will fix it but what would you suggest @7c6f434c ? Should I just add unzip to the buildInputs ? I didn't want to increase the closure size too much but now that it has become necessary this is justified right ?

@teto
Copy link
Member

teto commented Feb 12, 2019

As for the changes themselves, when I looked in nixpkgs, some packages patch the path to sw_vers while others replace it with 10.10. Why did you choose the latter ?

Nevermind I just saw your answer on the other issue.

EDIT: ...and unzip is already in buildInputs... yeah false alert.

@7c6f434c
Copy link
Member

Adding unzip to $PATH in any way would effectively put it into build dependencies, there is no way around that.

It should be nativeBuildInputs, although maybe cross-builds are not the most pressing problem.

Thanks to @alyssais for the other part of troubleshooting, too!

@softinio
Copy link
Member

I am having trouble installing neovim because of this issue. I am new to nix. Any suggestions on how I can get this fix to overcome my issue? Thanks

I get:

building '/nix/store/yh1nidzn34rkpqh2k070zbcpcg0w3dv1-lua5.1-mpack-1.0.7-0.drv'...
unpacking sources
unpacking source archive /nix/store/w1xca9032cbmmmq9437bsg6kh0l6k184-mpack-1.0.7-0.src.rock
sh: sw_vers: command not found
Warning: The directory '/homeless-shelter/.cache/luarocks' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing /nix/store/8r4c73pjlj6wdk0id6xl8p4j9wy203kz-luarocks-2.4.4/bin/.luarocks-wrapped with sudo, you may want sudo's -H flag.

Done. You may now enter directory
mpack-1.0.7-0/libmpack-lua-1.0.7
and type 'luarocks make' to build.
source root is ./mpack-1.0.7-0/libmpack-lua-1.0.7
chmod: --: No such file or directory
builder for '/nix/store/yh1nidzn34rkpqh2k070zbcpcg0w3dv1-lua5.1-mpack-1.0.7-0.drv' failed with exit code 1
cannot build derivation '/nix/store/yj3fg41bdpnx80cc92f5632vxk5zsykz-luajit-2.1.0-beta3-env.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/yqzryphbdpcrhjipp7mnip1h9srkjp11-neovim-unwrapped-0.3.4.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/yz2q2i3r0jha6w26y35nwfqfsw1hp0zf-neovim-0.3.4.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/3ihbv8pvqxr0p2l8r3v53c09havqy7wk-system-applications.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/2wz29fbcrs02yzgd7gk8mc20g14q134a-system-path.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/db1nx2690ksbxzvrxmnz9jimb0y5z3wy-darwin-system-19.03pre-git.drv': 1 dependencies couldn't be built
error: build of '/nix/store/db1nx2690ksbxzvrxmnz9jimb0y5z3wy-darwin-system-19.03pre-git.drv' failed

@LnL7
Copy link
Member Author

LnL7 commented Feb 16, 2019

Keep an eye on http://howoldis.herokuapp.com for a channel update and rollback in the meantime. But if you don't want to rollback your channel for some reason you can use this commit temporarily.

nix-env -iA neovim -f https://github.com/NixOS/nixpkgs/archive/5b0e7de0bd2f329b506a57c54c4e68af3e2a6935.tar.gz

@softinio
Copy link
Member

@LnL7 Thx for responding so fast. That is great. Which channel update am I looking for? Assume Darwin one moving to 18.10 ? Told you I am new to nix :-)

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

Successfully merging this pull request may close these issues.

None yet

5 participants