✓
Passing This code compiles and runs correctly.
Code
// Pins that `deps` reports system dependencies declared by IMPORTED LIBRARIES,
// not only by the entry file.
//
// `program.items` is one level deep: an imported module arrives as a single
// `.module_decl` carrying its own items. A scan that walks `program.items` and
// matches `.flow` sees the entry file and nothing else — so a program linking a
// library reported none of that library's requirements.
//
// The entry file declares one dependency and the imported module declares
// another; both must be reported.
//
// Run: koruc input.kz deps
~import std/deps
~import app/mylib
~std/deps:requires.system {
"name": "libfromentry",
"check": "nonexistent-check-command2 --version",
"brew": "libfromentry-brew"
}
~tor main {}
~proc main|zig {
}
~main()
Flows
flow ~requires.system click a branch to expand · @labels scroll to their anchor
requires.system (source: "name": "libfromentry",
"check": "nonexistent-check-command2 --version",
"brew": "libfromentry-brew")
flow ~main click a branch to expand · @labels scroll to their anchor
main
Imported Files
// A library that declares its own system dependency, the way koru/curl does.
// The declaration lives HERE, not in the program that imports it.
~import std/deps
~std/deps:requires.system {
"name": "libfromimport",
"check": "nonexistent-check-command --version",
"brew": "libfromimport-brew",
"apt": "libfromimport-apt"
}
~pub tor ping {} -> string
~proc ping|zig {
return "pong";
}
Test Configuration
Post-validation Script:
#!/bin/bash
set -e
OUT=$(koruc input.kz deps 2>&1)
echo "$OUT" | grep -q "libfromentry" || { echo "FAIL: entry-file dependency missing"; echo "$OUT"; exit 1; }
echo "$OUT" | grep -q "libfromimport" || { echo "FAIL: imported-module dependency missing — the scan is one level deep"; echo "$OUT"; exit 1; }
echo "=== Test passed: deps reached through the imported module ==="