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

Add Darwin support for ccls #56673

Merged
merged 1 commit into from
Mar 5, 2019
Merged

Add Darwin support for ccls #56673

merged 1 commit into from
Mar 5, 2019

Conversation

Kaali
Copy link

@Kaali Kaali commented Mar 2, 2019

Motivation for this change

Darwin was not in supported branches.

Things done

Had to set a few compile flags to make it work. And set stdenv from llvmPackages_latest, as Darwin Clang is too old to compile and run CCLS. Visibility change fixes a lot of warnings regarding different visibility in different translation units re. llvmlib

  • 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.

@GrahamcOfBorg GrahamcOfBorg added 6.topic: darwin Running or building packages on Darwin 8.has: package (new) This PR adds a new package labels Mar 2, 2019
@GrahamcOfBorg GrahamcOfBorg requested a review from Mic92 March 2, 2019 09:12
@Mic92 Mic92 merged commit bf444fd into NixOS:master Mar 5, 2019
@Mic92
Copy link
Member

Mic92 commented Mar 5, 2019

Thanks!

@bwolf
Copy link
Contributor

bwolf commented Mar 12, 2019

I wonder how to use this. I cannot build it in my clone of Nixpkgs. I'm on 10.14.3 with Nix 2.2.1.

[ 86%] Building CXX object tools/extra/clangd/xpc/CMakeFiles/clangdXpcJsonConversions.dir/Conversion.cpp.o
In file included from /private/var/folders/pw/0qj665hx4w19p13bh8y630xm0000gp/T/nix-build-clang-8.0.0rc2.drv-0/clang/tools/extra/clangd/xpc/Conversion.cpp:10:
/private/var/folders/pw/0qj665hx4w19p13bh8y630xm0000gp/T/nix-build-clang-8.0.0rc2.drv-0/clang/tools/extra/clangd/xpc/../xpc/Conversion.h:14:10: fatal error: 'xpc/xpc.h' file not found
#include <xpc/xpc.h>
         ^~~~~~~~~~~
1 error generated.
make[2]: *** [tools/extra/clangd/xpc/CMakeFiles/clangdXpcJsonConversions.dir/build.make:63: tools/extra/clangd/xpc/CMakeFiles/clangdXpcJsonConversions.dir/Conversion.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8424: tools/extra/clangd/xpc/CMakeFiles/clangdXpcJsonConversions.dir/all] Error 2

And later:

make: *** [Makefile:130: all] Error 2
builder for '/nix/store/n8gjmwfpl3cbiyb0v6ki09nnj2qzg67p-clang-8.0.0rc2.drv' failed with exit code 2
cannot build derivation '/nix/store/7hknhfb23ndwb444vc6mzcf2wvr20crh-ccls-0.20190301.drv': 1 dependencies couldn't be built
error: build of '/nix/store/7hknhfb23ndwb444vc6mzcf2wvr20crh-ccls-0.20190301.drv' failed

I issued the following commands to build:

export NIXPKGS=~/Code/Play/nixpkgs
nix-build $NIXPKGS -A ccls

@Kaali Kaali deleted the darwin-ccls branch March 13, 2019 09:52
@Kaali
Copy link
Author

Kaali commented Mar 13, 2019

I tried the newest master of nixpkgs and it also fails for me. Even though with this PR it still worked. I haven't bisected yet why it doesn't work anymore.

@Kaali
Copy link
Author

Kaali commented Mar 13, 2019

I tried building the commit that worked for me, which also doesn't work anymore. Even though I have a working version cached on my computer. Could it be a macOS system update related problem?

@Kaali
Copy link
Author

Kaali commented Mar 13, 2019

It seems like PR #56645 changed something with llvmPackages. On macOS llvmPackages_latest doesn't provide the latest LLVM anymore. Version 5 is used instead, and ccls requires a newer version.

I could either set it to some specific version, or does somebody know why _latest returns version 5 here?

@Kaali Kaali mentioned this pull request Mar 13, 2019
10 tasks
@bwolf
Copy link
Contributor

bwolf commented Mar 13, 2019

It seems like PR #56645 changed something with llvmPackages. On macOS llvmPackages_latest doesn't provide the latest LLVM anymore. Version 5 is used instead, and ccls requires a newer version.

This is exactly the behaviour which I observed. For me this also applies to packages like cmake, which is annoying when you require a newer toolchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants