Commit graph

15 commits

Author SHA1 Message Date
Vincent Ambo
e494a347b5 fix(3p/nix): Build glog as included CMake project 2020-05-29 22:04:06 +01:00
Vincent Ambo
25393d8080 refactor(3p/nix): Introduce CMake as the build system for Nix
Completes the switch from Meson to CMake for the core build system in
Nix.

Meson was added originally because someone else had already done the
work for integrating it in Nix and it was an upgrade from the previous
setup.

However over time it became clear that Meson is not quite mature
enough for projects like Nix that have occasionally peculiar
configuration constraints.

Some issues encountered with Meson (some of these are due to the Meson
setup in Nix):

* Difficulty with generating correct compile_commands.json for
  external tools like clangd
* Difficulty linking to libc++ when using clang
* Ugly shell invocations for certain parts of the build system (I want
  these to be gone!!!)

This CMake setup mimics the Meson configuration, but there are some
differences (some temporary):

* headers are now included separately for each library (see a previous
  commit that changes includes appropriately)
* autoheaders-style configuration is currently hardcoded. Before
  blindly copying this I want to evaluate how much of it actually exists
  for portability concerns that I don't have (such as support for OS
  X).
* Nix is built with libc++ by default.
* [libstore] SQL schema is now inlined via a generated header, not an
  included string literal

Abseil is still built as part of this build, rather than an external
dependency, because it chokes on differently configured compiler
invocations.

Note that because of the move to libc++ an unwanted behaviour is
introduced: glog log messages no longer have a body. I have yet to
debug what is going on there.
2020-05-28 00:11:25 +01:00
Vincent Ambo
2e32ceb523 fix(3p/nix): Default-import depot from a relative path 2020-05-27 00:06:59 +01:00
Vincent Ambo
da9104767e chore(3p/nix): Make build type configurable 2020-05-24 17:53:42 +01:00
Vincent Ambo
f77945ca81 style(3p/nix): Rename derivation to 'tazjix'
This makes it easier to distinguish which thing I'm dealing with in
the store paths. It does not affect anything else.
2020-05-23 23:47:45 +01:00
Vincent Ambo
cac00656cb fix(3p/nix): Set Meson build type to 'release'
Gotta go fast ... (well, not while compiling)
2020-05-23 20:39:02 +01:00
Vincent Ambo
5f728cb428 feat(3p/nix): Add a derivation to launch clangd
This wrapper derivation (which assumes that the depot is available at
~/depot) can be used to actually get clangd working with
//third_party/nix.

In my setup I can launch this with M-x eglot, followed by

  env
    CLANGD_FLAGS='--compile-commands-dir=/home/tazjin/projects/nix-build'
    nix-shell -A third_party.nix --run 'nix-clangd' /home/tazjin/depot
2020-05-22 23:00:23 +01:00
Vincent Ambo
f459332f32 chore: Update from Clang 9 to Clang 10 for all projects 2020-05-22 18:29:47 +01:00
Vincent Ambo
00017ace04 feat(3p/nix): Wrangle Meson/Nix/CMake into (temporary) submission
Meson is unable to use CMake in Nix to determine the internal
structure of the Abseil libraries.

This commit adds an explicit list of most of the Abseil targets that
are relevant (so far) and bundles them into a list that is linked
together.
2020-05-21 04:50:49 +01:00
Vincent Ambo
9dfdf16a8d fix(3p/nix): Fix build of derivation if cmake is present
cmake automatically runs a configure hook which breaks the build,
since this isn't actually a cmake project. This hook is now disabled.

Additionally Abseil's sources are linked to an absolute derivation
path when the build launches, as opposed to the relative path used for
development builds.
2020-05-21 00:24:10 +01:00
Vincent Ambo
e2fad0f0d2 feat(3p/nix): Add Abseil as a CMAKE subproject to Meson
Yep.

This is accomplished by symlinking the sources into the location
expected by Meson for subprojects.
2020-05-20 03:03:08 +01:00
Vincent Ambo
3908732181 style(3p/nix): Final act in the brace-wrapping saga
This last change set was generated by a full clang-tidy run (including
compilation):

    clang-tidy -p ~/projects/nix-build/ \
      -checks=-*,readability-braces-around-statements -fix src/*/*.cc

Actually running clang-tidy requires some massaging to make it play
nice with Nix + meson, I'll be adding a wrapper or something for that soon.
2020-05-19 20:51:32 +01:00
Vincent Ambo
0335b91b93 feat(3p/nix): Add glog dependency 2020-05-17 23:58:51 +01:00
Vincent Ambo
168ef124ef fix(3p/nix): Minor fixes to derivation
* version must be set to use this as the system Nix
* missing busybox path is now set
* fixed build output names
2020-05-17 21:25:50 +01:00
Vincent Ambo
8944370b7f feat(3p/nix): Add new Meson-based derivation for building Nix
This builds the mesonified Nix and is compatible with the depot
structure and nix-shell.
2020-05-17 20:46:06 +01:00