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

color_coded: init at 2017-10-30 #33060

Closed
wants to merge 1 commit into from
Closed

color_coded: init at 2017-10-30 #33060

wants to merge 1 commit into from

Conversation

jeaye
Copy link
Contributor

@jeaye jeaye commented Dec 26, 2017

Motivation for this change

It's a popular vim plugin which I'd like to have on my NixOS machines.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • Fits CONTRIBUTING.md.

This is a bit messier than it would be with mkDerivation, but I've found that buildVimPluginFrom2Nix doesn't seem to have very good CMake support.

sha256 = "0l46ar1b3vy7gbrq2ic734vvw7zcvw6ar78zyhwz55h2lxfh89aq";
};
dependencies = [];
buildInputs = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated, the custom part belongs in additional-nix-code/color_coded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that initially and found that my additional-nix-code/color_coded wasn't being used at all; didn't find any further documentation and I see other plugins in default.nix are specifying their build inputs, so I went ahead with it.

Copy link
Member

@LnL7 LnL7 Dec 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used when updating all of the plugins, vim-plugin-names-to-nix generates the part until dependencies = []; and appends the custom snippet afterwards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I see the benefit of separating the build bits, since they likely don't change with the auto-generated bits. It's the way that it is because additional-nix-code/color_coded didn't work for me and I didn't find any more docs or support elsewhere. If you have any more info, I can try to apply that. If it should just work then maybe I need to try it again.

clang_version=$(clang --version | head -1 | sed 's/clang version \(\S\+\).*/\1/')
. ./lib/generate_sources ${llvm_39} $clang_version

cmake -DDOWNLOAD_CLANG=0 .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember you asking about this in irc, could you link the mkDerivation that did work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with import <nixpkgs> {};
stdenv.mkDerivation {
  name = "color_coded-2017-10-30";
  src = fetchgit {
    url = "https://github.com/jeaye/color_coded";
    rev = "cb356b083362ea6f15bc690c5eb10b01326ad169";
    sha256 = "0l46ar1b3vy7gbrq2ic734vvw7zcvw6ar78zyhwz55h2lxfh89aq";
  };
  dependencies = [];
  buildInputs = [
    stdenv
    cmake
    lua
    ncurses
    zlib
    llvm
    llvmPackages.clang.cc
  ];
  cmakeFlags = [ "-DDOWNLOAD_CLANG=0" ];
  preConfigure = ''
    sed -i "s/add_dependencies(\S\+ \S\+_track_api)//" CMakeLists.txt
    clang_version=$(clang --version | head -1 | sed 's/clang version \(\S\+\).*/\1/')
    . ./lib/generate_sources ${llvm} $clang_version
  '';
  buildPhase = ''
    patchShebangs .
    make install
  '';
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issues with cmake #33203

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent. Thank you!

@LnL7
Copy link
Member

LnL7 commented Dec 29, 2017

@GrahamcOfBorg build vimPlugins.color_coded

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failure for system: x86_64-darwin

  /nix/store/j3yfhwcz55i0yb8g5bnp40py9dzy9rf5-cmake-3.9.6/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
  /nix/store/j3yfhwcz55i0yb8g5bnp40py9dzy9rf5-cmake-3.9.6/share/cmake-3.9/Modules/FindThreads.cmake:212 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:50 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/nix-build-vimplugin-color_coded-2017-10-30.drv-0/color_coded-cb356b0/CMakeFiles/CMakeOutput.log".
See also "/tmp/nix-build-vimplugin-color_coded-2017-10-30.drv-0/color_coded-cb356b0/CMakeFiles/CMakeError.log".
builder for ‘/nix/store/mkkabx30riyr1xhbiz1irg132q9bfbq6-vimplugin-color_coded-2017-10-30.drv’ failed with exit code 1
error: build of ‘/nix/store/mkkabx30riyr1xhbiz1irg132q9bfbq6-vimplugin-color_coded-2017-10-30.drv’ failed

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success for system: x86_64-linux

wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
/nix/store/xzvkzh9ryvkrj1mambqg8fyp02pzvzr8-vimplugin-color_coded-2017-10-30

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success for system: aarch64-linux

wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
/nix/store/pz1dfgzi6z5a4354qnkvgsfiivjpz86d-vimplugin-color_coded-2017-10-30

ncurses
zlib
llvm_39
llvmPackages.clang.cc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be causing the darwin failure, since the stdenv there already uses clang.

@jeaye
Copy link
Contributor Author

jeaye commented Dec 30, 2017

@GrahamcOfBorg build vimPlugins.color_coded

1 similar comment
@LnL7
Copy link
Member

LnL7 commented Dec 30, 2017

@GrahamcOfBorg build vimPlugins.color_coded

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success for system: x86_64-darwin

[ 84%] Linking CXX executable color_coded_config_test
[ 84%] Built target color_coded_config_test
Scanning dependencies of target color_coded
[ 92%] Building CXX object CMakeFiles/color_coded.dir/src/main.cpp.o
[100%] Linking CXX shared library color_coded.so
[100%] Built target color_coded
installing
post-installation fixup
patching script interpreter paths in /nix/store/zrsnci01sln8f8zbiqacwwkfz107xxc4-vimplugin-color_coded-2017-10-30
/nix/store/zrsnci01sln8f8zbiqacwwkfz107xxc4-vimplugin-color_coded-2017-10-30

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success for system: x86_64-linux

wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
/nix/store/dy7ip4i5jbvxivya3mippzywdkah3bhz-vimplugin-color_coded-2017-10-30

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success for system: aarch64-linux

wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
/nix/store/gfndqcxlm6w907zx15zz3jlm5rd2kani-vimplugin-color_coded-2017-10-30

@jeaye
Copy link
Contributor Author

jeaye commented Dec 31, 2017

I've simplified this as much as possible and it builds on all platforms. Let me know if anything else is neeed.

Copy link
Member

@LnL7 LnL7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, could you squash the commits?

};
dependencies = [];
buildInputs = [
stdenv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to add stdenv here, also nativeBuildInputs is more correct for cmake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove stdenv, move cmake to nativeBuildInputs, and squash the commits tonight.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this ever happen?

@jeaye
Copy link
Contributor Author

jeaye commented Jun 10, 2018

@7c6f434c @LnL7 Squashed, removed stdenv, and moved cmake to nativeBuildInputs, as requested. Thanks for the ping.

@@ -4,6 +4,7 @@
, xkb_switch, rustracerd, fzf, skim
, python3, boost, icu, ncurses
, ycmd, makeWrapper, rake
, lua51Packages, ncurses, zlib, llvm_39
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like meanwhile ncurses was already added to the inputs for something else.

@jeaye
Copy link
Contributor Author

jeaye commented Jun 11, 2018

@LnL7 Good catch. Removed the extra ncurses.

@LnL7
Copy link
Member

LnL7 commented Jun 11, 2018

@GrahamcOfBorg build vimPlugins.color_coded

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: vimPlugins.color_coded

Partial log (click to expand)

      color_coded::clang::source_range(color_coded::clang::translation_unit const&) in main.cpp.o
  "_clang_parseTranslationUnit", referenced from:
      color_coded::clang::compile(color_coded::conf::args_view, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/color_coded_config_test.dir/build.make:128: color_coded_config_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/color_coded_config_test.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
builder for '/nix/store/lfc2vbh1l9qhcnfm57a60cy10jiagxxy-vimplugin-color_coded-2017-10-30.drv' failed with exit code 2
error: build of '/nix/store/lfc2vbh1l9qhcnfm57a60cy10jiagxxy-vimplugin-color_coded-2017-10-30.drv' failed

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: vimPlugins.color_coded

Partial log (click to expand)

CMakeFiles/color_coded_config_test.dir/test/src/config/main.cpp.o: In function `color_coded::clang::detail::resource_impl<CXString>::deleter(CXString&)':
main.cpp:(.text._ZN11color_coded5clang6detail13resource_implI8CXStringE7deleterERS3_[_ZN11color_coded5clang6detail13resource_implI8CXStringE7deleterERS3_]+0xb): undefined reference to `clang_disposeString'
CMakeFiles/color_coded_config_test.dir/test/src/config/main.cpp.o: In function `color_coded::clang::translation_unit::~translation_unit()':
main.cpp:(.text._ZN11color_coded5clang16translation_unitD2Ev[_ZN11color_coded5clang16translation_unitD5Ev]+0xd): undefined reference to `clang_disposeTranslationUnit'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/color_coded_config_test.dir/build.make:128: color_coded_config_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/color_coded_config_test.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
builder for '/nix/store/xdk6hlmzzc89abhqhca3p5qr1f9yq91a-vimplugin-color_coded-2017-10-30.drv' failed with exit code 2
error: build of '/nix/store/xdk6hlmzzc89abhqhca3p5qr1f9yq91a-vimplugin-color_coded-2017-10-30.drv' failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: vimPlugins.color_coded

Partial log (click to expand)

CMakeFiles/color_coded_config_test.dir/test/src/config/main.cpp.o: In function `color_coded::clang::detail::resource_impl<CXString>::deleter(CXString&)':
main.cpp:(.text._ZN11color_coded5clang6detail13resource_implI8CXStringE7deleterERS3_[_ZN11color_coded5clang6detail13resource_implI8CXStringE7deleterERS3_]+0x4): undefined reference to `clang_disposeString'
CMakeFiles/color_coded_config_test.dir/test/src/config/main.cpp.o: In function `color_coded::clang::translation_unit::~translation_unit()':
main.cpp:(.text._ZN11color_coded5clang16translation_unitD2Ev[_ZN11color_coded5clang16translation_unitD5Ev]+0x14): undefined reference to `clang_disposeTranslationUnit'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/color_coded_config_test.dir/build.make:128: color_coded_config_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/color_coded_config_test.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
builder for '/nix/store/gnmb0n86m03wpd3v23ispid8cszg4ccf-vimplugin-color_coded-2017-10-30.drv' failed with exit code 2
error: build of '/nix/store/gnmb0n86m03wpd3v23ispid8cszg4ccf-vimplugin-color_coded-2017-10-30.drv' failed

@LnL7
Copy link
Member

LnL7 commented Jun 15, 2018

Any ideas about the build failures? It worked at some point.

@jeaye
Copy link
Contributor Author

jeaye commented Jun 16, 2018

The source hasn't changed and I'm specifically using llvm_39. This appears to be a fagility between the relationship of llvm_39 and llvmPackages, used here: https://github.com/NixOS/nixpkgs/pull/33060/files#diff-eab8cee5bbb648c553d5b5aba8ec6a10R12

Is there a better way to get access to the clang libs?

@mmahut
Copy link
Member

mmahut commented Aug 7, 2019

Any updates on this pull request, please?

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 3, 2020
@stale
Copy link

stale bot commented Jun 6, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 6, 2021
@Mindavi
Copy link
Contributor

Mindavi commented Oct 13, 2021

If you're still interested in pushing this into nixpkgs, I'd suggest you re-submit. Since there hasn't been any activity for so long, I feel like it's best to close it. Please feel free to reopen if you'd like.

@Mindavi Mindavi closed this Oct 13, 2021
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

8 participants