From 00017ace042d183400be78269e99e2952746cce1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 21 May 2020 04:50:49 +0100 Subject: [PATCH] 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. --- third_party/nix/default.nix | 2 ++ third_party/nix/meson.build | 54 +++++++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/third_party/nix/default.nix b/third_party/nix/default.nix index 6a05135f6..d7a85bb61 100644 --- a/third_party/nix/default.nix +++ b/third_party/nix/default.nix @@ -36,6 +36,8 @@ in stdenv.mkDerivation { # TODO(tazjin): Some of these might only be required for native inputs buildInputs = with pkgs; [ + # TODO(tazjin): Figure out why meson can't make the Abseil headers visible + abseil_cpp aws-s3-cpp boost brotli diff --git a/third_party/nix/meson.build b/third_party/nix/meson.build index 9020f4f87..1b5e030bd 100644 --- a/third_party/nix/meson.build +++ b/third_party/nix/meson.build @@ -345,13 +345,50 @@ config_h.set('CAN_LINK_SYMLINK', can_link_symlink, description : 'Whether link() works on symlinks') # Import the Abseil cmake project from the (symlinked) depot sources. -# This will need to change if //third_party/nix is every split out as -# a subtree. absl = cmake.subproject('abseil_cpp') -absl_base = absl.dependency('base') -absl_raw_logging = absl.dependency('raw_logging_internal') -absl_int128 = absl.dependency('int128') -absl_strings = absl.dependency('strings') + +# Bundle all relevant Abseil libraries. Meson is not able to resolve +# the internal dependencies of Abseil, and reconstructing them is more +# work than I am willing to invest at the moment. +absl_deps = [ + absl.dependency('algorithm_container'), + absl.dependency('base'), + absl.dependency('bits'), + absl.dependency('city'), + absl.dependency('config'), + absl.dependency('container_common'), + absl.dependency('container_memory'), + absl.dependency('core_headers'), + absl.dependency('debugging_internal'), + absl.dependency('demangle_internal'), + absl.dependency('dynamic_annotations'), + absl.dependency('endian'), + absl.dependency('fixed_array'), + absl.dependency('graphcycles_internal'), + absl.dependency('hash'), + absl.dependency('hash_function_defaults'), + absl.dependency('hashtablez_sampler'), + absl.dependency('int128'), + absl.dependency('malloc_internal'), + absl.dependency('memory'), + absl.dependency('meta'), + absl.dependency('node_hash_policy'), + absl.dependency('node_hash_set'), + absl.dependency('optional'), + absl.dependency('raw_hash_set'), + absl.dependency('raw_logging_internal'), + absl.dependency('spinlock_wait'), + absl.dependency('stacktrace'), + absl.dependency('strings'), + absl.dependency('symbolize'), + absl.dependency('synchronization'), + absl.dependency('throw_delegate'), + absl.dependency('time'), + absl.dependency('time_zone'), + absl.dependency('type_traits'), + absl.dependency('utility'), + absl.dependency('variant'), +] # Look for boost, a required dependency. #-------------------------------------------------- @@ -450,11 +487,6 @@ if not ( 'it is too old? >= 1.14 is required.') endif - -# Optional dependancies -#============================================================================ - - # Look for libsodium, an optional dependency. #-------------------------------------------------- libsodium_lib = cpp.find_library('sodium', required: get_option('with_libsodium'))