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

Build fails on macOS using nix #5896

Closed
nhooyr opened this issue Jan 6, 2017 · 8 comments
Closed

Build fails on macOS using nix #5896

nhooyr opened this issue Jan 6, 2017 · 8 comments
Labels
build building and installing Neovim using the provided scripts platform:macos
Milestone

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Jan 6, 2017

  • nvim --version: using latest master
  • Operating system/version: macOS 10.12.2
  • Terminal name/version: iTerm 3.0.13
  • $TERM: xterm-256color
  • nix version: nix-env (Nix) 1.11.5
  • nixkpgs version: "17.03pre-git"

Actual behaviour

I cloned the repository and then:

❯ make CMAKE_BUILD_TYPE=debug                                                                                                                                                                              i
ninja  -C .deps
ninja: Entering directory `.deps'
[2/2] cd /Users/nhooyr/code/neovim/.deps && /nix/store/izh37lifmdg8kr8kp68pwx9864l1m0vd-cmake-3.7.1/bin/cmake -E touch .third-party
cd build && cmake -G 'Ninja' -DCMAKE_BUILD_TYPE=debug  ..
-- Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2.
-- Unsupported _FORTIFY_SOURCE found, forcing _FORTIFY_SOURCE=1.
-- Could NOT find unibilium (missing:  UNIBILIUM_LIBRARY)
CMake Error at /nix/store/aqqlrc5bsb6z18jq4i1qk6j7wc561vhb-cmake-3.7.1/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find LibTermkey (missing: LIBTERMKEY_LIBRARY)
Call Stack (most recent call first):
  /nix/store/aqqlrc5bsb6z18jq4i1qk6j7wc561vhb-cmake-3.7.1/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindLibTermkey.cmake:44 (find_package_handle_standard_args)
  CMakeLists.txt:322 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/nhooyr/code/neovim/build/CMakeFiles/CMakeOutput.log".
See also "/Users/nhooyr/code/neovim/build/CMakeFiles/CMakeError.log".
make: *** [build/.ran-cmake] Error 1

I am using nix on darwin (i have a feeling this is relevant).

Expected behaviour

No error, successful build.

@justinmk justinmk added the build building and installing Neovim using the provided scripts label Jan 6, 2017
@jamessan
Copy link
Member

jamessan commented Jan 6, 2017

Have you built successfully in this environment before? Is there anything in CMakeOutput.log or CMakeError.log that looks relevant? If you make distclean && make CMAKE_BUILD_TYPE=Debug (note the captial D), does it work?

@nhooyr
Copy link
Contributor Author

nhooyr commented Jan 6, 2017

No, I have not, that's why I felt mentioning nix is relevant.

CMakeOutput.log: https://gist.github.com/73bdf8fc03f79e525d302e991bfe62a4
CMakeError.log: https://gist.github.com/6b4c9b7de1147e25c4ffc5299517b45f

Nope, same error as before. I can post the full output if that would help.

@jamessan jamessan changed the title error when building Build fails on macOS using nix Jan 6, 2017
@nhooyr
Copy link
Contributor Author

nhooyr commented Jan 8, 2017

Yup, installed brew and now it all works fine. Weird.

@justinmk justinmk added this to the todo milestone Jan 8, 2017
@nhooyr
Copy link
Contributor Author

nhooyr commented Jan 8, 2017

According to the Nix IRC, this is expected and there isn't much that can be done. According to them, I should be using Nix to build neovim and specify all dependencies explicitly.

@nhooyr nhooyr closed this as completed Jan 8, 2017
@nhooyr
Copy link
Contributor Author

nhooyr commented Jan 31, 2017

It's a simple fix. For anyone in the future!

Run

cd path/to/neovim
nix-shell '<nixpkgs>' -A neovim
patchPhase
cmakeConfigurePhase
buildPhase
installPhase

And then enjoy :)

@tssm
Copy link

tssm commented Jun 1, 2017

@nhooyr I'm trying to replace Homebrew with Nix and what confuses me is that to execute Neovim after it is build I need to switch the Nix environment with nix-shell. Is there a way to avoid that?

@guyzmo
Copy link

guyzmo commented Jun 1, 2017

@tssm you'll need to learn about nix' profiles so you can deploy neovim either in your current profile, or a given profile you'll switch to.

@tssm
Copy link

tssm commented Jun 1, 2017

Thanks @guyzmo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build building and installing Neovim using the provided scripts platform:macos
Projects
None yet
Development

No branches or pull requests

5 participants