rix
rix copied to clipboard
A reimplementation of nix in Rust.
Propagate ctx around lambdas for access to current file path We need to be able to access ctx for certain builtins, e.g. import which needs to know the directory of...
Improved "other" error testing with error codename This should allow easier testing of more obscure error cases. I might even replace other more rarely used errors with "other" because of...
Improved path handling for imports Slightly improved path handling for the import builtin, non-absolute string handling will be fixed in the future. --- [//]: # (BEGIN SAPLING FOOTER) Stack created...
Improve error handling for toStrict when calling `toStrict`, there was no try/catch for propagating the error back to Rust correctly. However, `call_js_function` didn't have the ability to correctly pass in...
Propagate current path through the rust code Propagating current path (workdir) through the rust code. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/urbas/rix/pull/130). *...
More robust import tests Everything I've done in previous PRs fixed issues with these tests. They test importing both using paths and strings, importing from the same folder, from a...
```rs assert_eq!( eval_ok("{a = 1; b = 2;} // {a = 3; c = 1;"), Value::AttrSet(HashMap::from([ ("a".to_owned(), Value::Int(3)), ("b".to_owned(), Value::Int(2)), ("c".to_owned(), Value::Int(1)), ])) ); ``` (missing a closing curly brace)...
These 2 test cases: ```rs assert_eq!( eval_ok("builtins.baseNameOf /foo/bar/baz/"), Value::Str("baz".into()) ); assert_eq!( eval_ok("(builtins.baseNameOf (/foo/bar/baz/))"), Value::Str("baz".into()) ); ``` Produce some very weird/unexpected results, including a panic on the second one.
Currently working on the tests, spotted some weird bug, turns out typescript wasn't catching it because strict mode isn't on. Turning on strict mode shows all sorts of potential bugs,...
Rix is currently not packaged. Since Rix is all about Nix, it would be sensible to use Nix to package Rix. A nix package definition in flake.nix should do.