Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
65c272b
chore: update flake
theoparis Jun 11, 2026
00b0e7d
fix(toString): correct boolean and float formatting for toString builtin
theoparis Jun 11, 2026
1228657
fix(display): match Nix display format for functions, builtins, floats
theoparis Jun 11, 2026
ba04af5
fix(toString): implement proper toString for lists, attrs, __toString…
theoparis Jun 11, 2026
98279c1
feat(builtins): add deepSeq, genericClosure, dirOf, fromTOML, getEnv,…
theoparis Jun 11, 2026
0b823e7
fix(fromJSON): use serde_json for all JSON parsing, fixing escape seq…
theoparis Jun 11, 2026
1c53b36
chore: add ci
theoparis Jun 11, 2026
801ec20
feat(tco): implement tail-call optimization to prevent stack overflow
theoparis Jun 11, 2026
2a8d842
refactor: fix clippy warnings
theoparis Jun 11, 2026
eea207f
fix(thunk): force result thunks to detect infinite recursion(blackhole)
theoparis Jun 11, 2026
e13c46c
fix(builtins): add self-referential builtins.builtins attrset
theoparis Jun 11, 2026
a0b8dfe
fix(select): support or-default when selecting from non-attrset
theoparis Jun 11, 2026
f57b36d
fix(foldl): don't force initial accumulator, lazily pass args to buil…
theoparis Jun 11, 2026
2f8a589
fix(getEnv): read from actual environment variables
theoparis Jun 11, 2026
79c33a4
fix(dirOf): implement correct Nix dirOf semantics
theoparis Jun 11, 2026
9f07ba6
fix(substring): support toString coercion for third argument
theoparis Jun 11, 2026
46355b6
fix(toJSON): auto-unwrap outPath attributes
theoparis Jun 11, 2026
a1bf667
fix(genList): don't eagerly force generator to support recursive defi…
theoparis Jun 11, 2026
08b726d
fix(deepSeq): add cycle detection to deep_force to prevent stack over…
theoparis Jun 11, 2026
a196c34
fix(deepSeq): use cycle-aware deep forcing to prevent stack overflow …
theoparis Jun 11, 2026
e8b3dd1
fix(nixVersion): bump to 2.19 to pass version comparison tests
theoparis Jun 11, 2026
d3c1ee6
fix: lower max recursion depth, add display cycle guard
theoparis Jun 11, 2026
d8507b3
fix(compare): support function pointer comparison for < > <= >=
theoparis Jun 11, 2026
6d3b2e0
docs: final summary of remaining failures
theoparis Jun 11, 2026
0cc340f
fix(tco): handle curried builtins and foldl' directly in trampoline loop
theoparis Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Rust

on:
merge_group:
branches: [ "canon" ]
pull_request:
branches: [ "canon" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@e7cc28468cf17df7cb288daea80c0c5437af360b
- name: install cargo-nextest
run: cargo binstall cargo-nextest
- name: Run tests
run: cargo nextest run --no-fail-fast
11 changes: 11 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"check": {
"command": "clippy",
},
},
},
},
}
55 changes: 55 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ criterion = "0.8.2"
expect-test = "1.5.1"
proptest = "1.11.0"
quick-xml = "0.39.2"
toml = "1.1.2"
4 changes: 2 additions & 2 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
description = "Theos — Windows NT-compatible kernel in Rust";

inputs = {
nixpkgs.url = "github:tinted-software/nixpkgs";
};
Expand Down Expand Up @@ -47,6 +45,7 @@
cargo
clippy
rustfmt
rust-analyzer
cargo-nextest
];
shellHook = ''
Expand Down
1 change: 0 additions & 1 deletion rix-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use clap::Parser;
use nix_eval::Evaluator;
use rootcause::{Report, report};
use serde_json;
use std::fs;
use std::io::{self, Read};

Expand Down
1 change: 1 addition & 0 deletions rix-eval/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ codespan.workspace = true
codespan-reporting.workspace = true
regex.workspace = true
quick-xml.workspace = true
toml.workspace = true
rix-parser.workspace = true

[dev-dependencies]
Expand Down
1 change: 0 additions & 1 deletion rix-eval/benches/evaluation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ fn bench_evaluate_complex_expression(c: &mut Criterion) {

fn bench_variable_resolution(c: &mut Criterion) {
use nix_eval::VariableScope;
use std::collections::HashMap;

let mut evaluator = Evaluator::new();
let mut scope = VariableScope::new();
Expand Down
46 changes: 33 additions & 13 deletions rix-eval/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,32 +159,52 @@ fn find_files(dir: &Path, prefix: &str, suffix: &str) -> Vec<PathBuf> {
let path = entry.path();
if path.is_dir() {
files.extend(find_files(&path, prefix, suffix));
} else if path.is_file() {
if let Some(file_name) = path.file_name().and_then(|n| n.to_str()) {
if file_name.starts_with(prefix) && file_name.ends_with(suffix) {
files.push(path);
}
}
} else if path.is_file()
&& let Some(file_name) = path.file_name().and_then(|n| n.to_str())
&& file_name.starts_with(prefix)
&& file_name.ends_with(suffix)
{
files.push(path);
}
}
}

files
}

/// Convert a CamelCase or PascalCase string to snake_case
fn to_snake_case(s: &str) -> String {
let mut result = String::with_capacity(s.len() + 4);
let mut chars = s.chars().peekable();
while let Some(c) = chars.next() {
if c.is_uppercase() {
if !result.is_empty() && !result.ends_with('_') {
// Check if previous char was lowercase (transition) or
// next char is lowercase (acronym followed by word)
let prev_was_lower = result.chars().last().is_some_and(|pc| pc.is_lowercase());
let next_is_lower = chars.peek().is_some_and(|nc| nc.is_lowercase());
if prev_was_lower || next_is_lower {
result.push('_');
}
}
result.push(c.to_lowercase().next().unwrap_or(c));
} else {
result.push(c);
}
}
result
}

fn path_to_test_name(path: &Path, prefix: &str) -> String {
// Get relative path from tests/tvix-tests
let test_dir = PathBuf::from("tests/tvix-tests");
let relative = path.strip_prefix(&test_dir).unwrap_or(path);

// Convert to a valid Rust identifier
let name = relative
// Convert to a valid Rust identifier, with snake_case conversion
let raw = relative
.to_string_lossy()
.replace('/', "_")
.replace('-', "_")
.replace('.', "_")
.replace(' ', "_")
.replace('\\', "_");
.replace(['/', '-', '.', ' ', '\\'], "_");
let name = to_snake_case(&raw);

format!("{}_{}", prefix, name)
}
Loading
Loading