about summary refs log tree commit diff
path: root/tvix/eval/src/tests/nix_tests/notyetpassing
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-10-12T09·26-0700
committertazjin <tazjin@tvl.su>2022-10-24T12·20+0000
commitf7ba502005d6376328e1e2591d70973d4f1d6b15 (patch)
treec1a78d6a960cc4766b69d77de00e5b4f599c4f83 /tvix/eval/src/tests/nix_tests/notyetpassing
parente2f0967d3fd44cac78ac50425bc2dbe65fd4a8c4 (diff)
feat(tvix/eval): implement builtins.currentSystem r/5190
This commit implements builtins.currentSystem, by capturing the
cargo environment variable `TARGET` and exposing it to rustc as
`TVIX_CURRENT_SYSTEM` so it can be inserted into the source code
using `env!()`.

The resulting value needs to be massaged a bit, since it is an "LLVM
triple".  The current code should work for all the platforms for
which cppnix works (thanks qyliss for generating the list!).  It
does *not* reject all of the triples that cppnix's configure.ac
rejects -- it is much more forgiving.  We can tighten this up in a
future commit.

Signed-off-by: Adam Joseph <adam@westernsemico.com>
Change-Id: I947f504b2af5a7fee8cf0cb301421d2fc9174ce1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6986
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/tests/nix_tests/notyetpassing')
-rw-r--r--tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.exp1
-rw-r--r--tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.nix12
2 files changed, 0 insertions, 13 deletions
diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.exp
deleted file mode 100644
index 0661686d611d..000000000000
--- a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.exp
+++ /dev/null
@@ -1 +0,0 @@
-/foo
diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.nix
deleted file mode 100644
index e9d65e88a817..000000000000
--- a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-assert builtins ? currentSystem;
-assert !builtins ? __currentSystem;
-
-let {
-
-  x = if builtins ? dirOf then builtins.dirOf /foo/bar else "";
-
-  y = if builtins ? fnord then builtins.fnord "foo" else "";
-
-  body = x + y;
-  
-}