about summary refs log tree commit diff
path: root/third_party/nix/default.nix (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-05 r/1597 refactor(tvix): Use SANDBOX_SHELL from environment in CMakeVincent Ambo1-2/+1
This makes the configuration work out-of-the-box using CMake in a Nix shell, rather than having to pass the additional variable to CMake on the command line. Change-Id: I04d3cc4f2e5ecf47bf2ee459d5e48588b84ae4dd Reviewed-on: https://cl.tvl.fyi/c/depot/+/1643 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: glittershark <grfn@gws.fyi>
2020-08-04 r/1575 fix(3p/nix): Properly configure SANDBOX_SHELLGriffin Smith1-1/+12
point the SANDBOX_SHELL macro at the actual path to busybox on the build machine, or allow it to be configured at build-time with a cmake option. Change-Id: I044a1315ba9baa3bc9ceddf29f36d14f9f9ccd96 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1632 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-08-03 r/1569 refactor(3p/nix): Build nix-daemon as a separate binaryVincent Ambo1-1/+0
Skips over all the monobinary stuff and moves to a separate binary for nix-daemon. This also replaces the flag parsing logic with absl::flags. This causes a behaviour change for --help, which no longer tries to display a man page but instead shows the actual command-line help. Note: This binary no longer links to the Boehm GC. Change-Id: Ib852e994b82f2d56e91262878c10650e656427a9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1622 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-08-03 r/1566 feat(3p/nix/build-shell): add run_clang_tidy scriptKane York1-1/+8
This makes it easy to quickly run clang-tidy on tvix without seeing errors from the generated files. Change-Id: I0e25089c5626aebdb5c016629a68da9ccd26c124 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1556 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-25 r/1477 chore(3p/nix): build in RelWithDebInfo modeKane York1-1/+1
This eases debugging of live crashes. Change-Id: Ie15a7f8fb3f091cae0fbe012e58862d416a42891 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1433 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-25 r/1471 feat(3p/nix): Template systemd unit files in buildGriffin Smith1-0/+13
Template the systemd unit file templates as part of the nix installPhase, putting them in the same place that the upstream nix derivation does. Change-Id: I3ceabfc0c837564e33b9ae7f9eeb7185d6fbe907 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1429 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi> Reviewed-by: tazjin <mail@tazj.in>
2020-07-25 r/1466 fix(3p/nix): Don't include depotPath in the main drvGriffin Smith1-8/+11
Including depotPath in the shellHook of the main derivation for tvix was, unsurprisingly, causing spurious rebuilds. It's still useful when developing locally, though, so I've extracted it to a `build-shell` derivation as a passthru attribute and updated the documentation. Fixes: #20 Change-Id: Ibc686b9f06ec68e79759ca2c989414bd5fbce696 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1426 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-07-25 r/1465 feat(3p/nix): Add build for VM for testing tvixGriffin Smith1-1/+5
Add an expression, based on the nixos qemu virtualisation framework, for a basic system whose nix is tvix, to be used for testing tvix Change-Id: I3c7422bb10d3ce05a3094671cb770f1f745d814c Reviewed-on: https://cl.tvl.fyi/c/depot/+/1423 Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: Alyssa Ross <hi@alyssa.is> Tested-by: BuildkiteCI
2020-07-23 r/1435 feat(3p/nix): run clang-tidy during buildsKane York1-1/+3
We need to -isystem the libcxx header files in order for clang-tidy to ignore them, as the Nix clang toolchain isn't doing that automatically. Change-Id: I05b9e9bd522de4c0e2ad543214f6bf6ab66a306b Reviewed-on: https://cl.tvl.fyi/c/depot/+/1359 Reviewed-by: glittershark <grfn@gws.fyi> Tested-by: BuildkiteCI
2020-07-20 r/1413 chore(3p/nix): Compile under `-Wall -Werror`Vincent Ambo1-0/+1
Change-Id: Ia44c68678a0b62e14228fafec88e7591ce3f4cee Reviewed-on: https://cl.tvl.fyi/c/depot/+/1295 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-19 r/1399 chore(3p/nix): Enable clang-format check in derivation buildVincent Ambo1-1/+6
This is the easiest way to get the checks up and running for now, but we will probably want to separate out things like this into a separate build step in the future. Change-Id: I8e1a1095aef09b1eee97abad5b6240bc64d14b8c Reviewed-on: https://cl.tvl.fyi/c/depot/+/1287 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-19 r/1398 test(3p/nix): Enable output comparison for evaluator success testsVincent Ambo1-0/+2
Enables loading of the expected output of evaluator tests from the corresponding .exp files, and checks that the output matches. This again leaves some tests behind in the disabled folder, but we now have almost the entire suite up and running so I can get around to cleaning up the disabled ones. Other note: Some tests had XML output, despite not being related to XML testing at all - I'm not sure why they chose to do this, but have converted those test outputs to normal Nix instead. We have a separate test suite for JSON & XML serialisation already, which was contributed by andi-. Change-Id: Id7c42c836edfec4c22db9d893e35489f3e6dd559 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1285 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi> Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-19 r/1395 test(3p/nix): Add property tests for attribute setGriffin Smith1-1/+5
Add a set of property tests for the attribute set (Bindings) class checking that the Merge operation satisfies the monoid laws. This will hopefully become useful to make sure we're not breaking the language semantics as we work towards optimizing or replacing the implementation, but also serves as a test bed for adding rapidcheck-based property tests to the codebase. Change-Id: I1b4b7b6503d08d80c1c5a8f9408fd4b787d00e8e Reviewed-on: https://cl.tvl.fyi/c/depot/+/1283 Reviewed-by: isomer <isomer@tvl.fyi> Tested-by: BuildkiteCI
2020-07-18 r/1380 chore(3p/nix): don't rebuild nix-proto-srcs as muchAlyssa Ross1-1/+1
Interpolating a path into a string will copy the referenced path into the Nix store, so this got a dependency on all of src. By first constructing a path to the src/proto directory using the + operator, and then interpolating it, we limit what is copied to the store, and therefore what code triggers a nix-proto-srcs rebuild. Change-Id: I8dd750f6bc5902b74ffb56470bc8a5f2c01c8cf1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1263 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi> Reviewed-by: tazjin <mail@tazj.in>
2020-07-18 r/1370 feat(3p/nix): Add NIX_DATA_DIR to shell hookGriffin Smith1-1/+8
all of the executables that get built during regular development depend on this being set to a directory that contains the nix directory - previously we had been doing it manually every time, this automates it. Change-Id: I4c957c0abf0a92ca7122a47d3b141a8ede280e13 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1258 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-18 r/1369 test(3p/nix): Set up scaffolding & fix up tests for value-to-{json|xml}Vincent Ambo1-0/+27
Configures the CMake build to load & run the GoogleTest tests. I (grfn) also updated this to get the tests running as part of the nix derivation, which required defining our own manual configurePhase and installCheckPhase, rather than depending on the one provided by stdenv. Not doing this would cause cmake to attempt to *run* the tests as part of the buildPhase, which wouldn't work because the dynamic libraries hadn't been put into a place where the test executables knew where to find them. We're not sure *why* this fixes it, and for some reason fixing this also breaks the automatic behavior of nixpkgs of passing -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES to make, but that's eaasy enough to fix manually in a preBuild Paired-With: Griffin Smith <grfn@gws.fyi> Change-Id: I79d61854a3ff47301cdce8a40c76820a97bdf901 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1240 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-16 r/1317 style(3p/nix): Rename the project to tvixVincent Ambo1-1/+1
Changes the derivation name & README overview to say "Tvix" instead of "tazjix". The previous name was mostly intended as a joke, and a way for me to distinguish output paths. It's certainly not the intention to have a portmanteau with my name here, especially now that several people are contributing to the fork. Change-Id: Icface5484d52355111eca23b2f6bd3b9e5567275 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1212 Reviewed-by: glittershark <grfn@gws.fyi> Tested-by: BuildkiteCI
2020-07-05 r/1216 feat(3p/nix): Add protobuf & gRPC dependencies and generate sourcesVincent Ambo1-1/+21
Adds dependencies on the gRPC & protobuf libraries, and implements Nix code to generate the C++ sources from the included proto definitions. This is theoretically supported via CMake, but practically doesn't work and I don't care to debug why. Doing it like this lets us instead add a CMake library target for our proto definitions based on the sources generated by Nix. Pros: * no need to deal with the gRPC CMake mess * it works! Cons: * iteration requires nix-shell restart Change-Id: Ie1fe9807fc96c49cb8f7161ba59d093456062b15 Reviewed-on: https://cl.tvl.fyi/c/depot/+/927 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi>
2020-07-05 r/1212 fix(3p/nix): Link to glog built by NixVincent Ambo1-5/+1
Same as cl/921, it seems that the trick to making this work is indeed overriding the C++ standard used in the dependency. Change-Id: I3c5984d71014d774c161ecc283844f504fd44719 Reviewed-on: https://cl.tvl.fyi/c/depot/+/922 Tested-by: BuildkiteCI Reviewed-by: lukegb <lukegb@tvl.fyi>
2020-07-05 r/1211 fix(3p/nix): Link to Abseil built by NixVincent Ambo1-1/+1
This didn't work previously ... but now it does. I think setting the standard explicitly is what did the trick, but it's slightly unclear to me why. Either way this means that Abseil is no longer constantly getting recompiled when building Nix, which is nice. Change-Id: I377f7b68bf1ef9045df6a2eee8fdd0c92f243547 Reviewed-on: https://cl.tvl.fyi/c/depot/+/921 Tested-by: BuildkiteCI Reviewed-by: lukegb <lukegb@tvl.fyi>
2020-06-23 r/1069 fix(3p/nix): Revert "feat(3p/nix): Add installCheckPhase"glittershark1-13/+0
This reverts commit 368e8d1eddb8cd95ded7b2f78e4805c67d28ff91. Reason for revert: Didn't mean to submit, and the phase is currently failing (which breaks the otherwise-functional derivation) Change-Id: I515b2fb45188dc90f09ae2458453192487c74d71 Reviewed-on: https://cl.tvl.fyi/c/depot/+/581 Reviewed-by: tazjin <mail@tazj.in>
2020-06-23 r/1067 feat(3p/nix): Add installCheckPhaseGriffin Smith1-0/+13
Add an installCheckPhase that runs the appropriate substituteAll on common.sh and runs the lang.sh tests with the build artifacts in the PATH. Change-Id: I2df5a93b8f3ffdfdc194a0e7d6b6669ef520c345 Reviewed-on: https://cl.tvl.fyi/c/depot/+/561 Reviewed-by: glittershark <grfn@gws.fyi>
2020-06-21 r/1055 fix(3p/nix): propagate dependencies which are needed by people linking in nixLuke Granger-Brown1-2/+5
This includes absl, which we install into the output, and boost and the boehm GC, which are moved to propagated deps. Change-Id: I8f9f9795ff92e26b2320359064241d7fd59c2d33 Reviewed-on: https://cl.tvl.fyi/c/depot/+/549 Reviewed-by: tazjin <mail@tazj.in>
2020-05-29 r/870 fix(3p/nix): Build glog as included CMake projectVincent Ambo1-4/+2
2020-05-28 r/868 refactor(3p/nix): Introduce CMake as the build system for NixVincent Ambo1-15/+3
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-27 r/861 fix(3p/nix): Default-import depot from a relative pathVincent Ambo1-1/+1
2020-05-24 r/838 chore(3p/nix): Make build type configurableVincent Ambo1-3/+3
2020-05-23 r/832 style(3p/nix): Rename derivation to 'tazjix'Vincent Ambo1-1/+1
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 r/831 fix(3p/nix): Set Meson build type to 'release'Vincent Ambo1-0/+2
Gotta go fast ... (well, not while compiling)
2020-05-22 r/816 feat(3p/nix): Add a derivation to launch clangdVincent Ambo1-1/+1
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 r/810 chore: Update from Clang 9 to Clang 10 for all projectsVincent Ambo1-1/+1
2020-05-21 r/793 feat(3p/nix): Wrangle Meson/Nix/CMake into (temporary) submissionVincent Ambo1-0/+2
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 r/790 fix(3p/nix): Fix build of derivation if cmake is presentVincent Ambo1-0/+8
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-20 r/784 feat(3p/nix): Add Abseil as a CMAKE subproject to MesonVincent Ambo1-0/+1
Yep. This is accomplished by symlinking the sources into the location expected by Meson for subprojects.
2020-05-19 r/777 style(3p/nix): Final act in the brace-wrapping sagaVincent Ambo1-0/+1
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-17 r/750 feat(3p/nix): Add glog dependencyVincent Ambo1-0/+1
2020-05-17 r/747 fix(3p/nix): Minor fixes to derivationVincent Ambo1-4/+6
* version must be set to use this as the system Nix * missing busybox path is now set * fixed build output names
2020-05-17 r/745 feat(3p/nix): Add new Meson-based derivation for building NixVincent Ambo1-0/+71
This builds the mesonified Nix and is compatible with the depot structure and nix-shell.