From 2ef1060361b582990f6b7335e16ce37bee6756f2 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 19 Jul 2020 14:35:05 -0400 Subject: chore(3p/nix): Remove support for plugins Plugins seem to not really be used anywhere (I can find one plugin that's actually defined, and it doesn't seem very useful, especially since we got rid of builtins.exec) and their presence is adding additional complexity and potential sources of bugs to an already unsteady refactor. At some point we may want to bring back something *like* plugins, but their design will likely be different and it will definitely be after we have a functioning Nix again. Change-Id: I3bc40e55917f70bf260fbc208c1705e2e6a7c626 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1291 Tested-by: BuildkiteCI Reviewed-by: Alyssa Ross Reviewed-by: isomer --- third_party/nix/tests/plugins.sh | 7 ------- third_party/nix/tests/plugins/plugintest.cc | 23 ----------------------- 2 files changed, 30 deletions(-) delete mode 100644 third_party/nix/tests/plugins.sh delete mode 100644 third_party/nix/tests/plugins/plugintest.cc (limited to 'third_party/nix/tests') diff --git a/third_party/nix/tests/plugins.sh b/third_party/nix/tests/plugins.sh deleted file mode 100644 index 4b1baeddce32..000000000000 --- a/third_party/nix/tests/plugins.sh +++ /dev/null @@ -1,7 +0,0 @@ -source common.sh - -set -o pipefail - -res=$(nix eval '(builtins.anotherNull)' --option setting-set true --option plugin-files $PWD/plugins/libplugintest*) - -[ "$res"x = "nullx" ] diff --git a/third_party/nix/tests/plugins/plugintest.cc b/third_party/nix/tests/plugins/plugintest.cc deleted file mode 100644 index 353166cffe3b..000000000000 --- a/third_party/nix/tests/plugins/plugintest.cc +++ /dev/null @@ -1,23 +0,0 @@ -#include "libutil/config.hh" -#include "primops.hh" - -using namespace nix; - -struct MySettings : Config { - Setting settingSet{this, false, "setting-set", - "Whether the plugin-defined setting was set"}; -}; - -MySettings mySettings; - -static GlobalConfig::Register rs(&mySettings); - -static void prim_anotherNull(EvalState& state, const Pos& pos, Value** args, - Value& v) { - if (mySettings.settingSet) - mkNull(v); - else - mkBool(v, false); -} - -static RegisterPrimOp rp("anotherNull", 0, prim_anotherNull); -- cgit 1.4.1