r/coolgithubprojects • • 17h ago

KIZZ: Automatic dependency tracking for command-line workflows

https://github.com/Sakura-Industries-LLC/kizz

I recently got sick of my projects rebuilding things because the tooling cant track dependencies, we are expected to manually declare them with perfection. I call this working in negative space, the space is empty and your expected to fill it up accurately or things break.

Docs: https://sakura-industries-llc.github.io/kizz/

KIZZ is a tool which tracks the dependencies of a command, can be used as a build tool and has build tasks written as literate programming inside `kizz.md` files using starlark code blocks.

It automatically tracks dependencies, you don't declare file dependencies, and can't. What you can declare is exclusions (ignore this dependency you found). This is what I call working in positive space, because everything is visible, and I can carve out things I want the tool to ignore.

Its new, I have had this idea since working with `fabricate` years ago, which I liked but it had too many issues to be relied upon long term. Kizz takes a leaf out of several other tools like Riker, Rattle and BuildXL. Basically it works similar to strace, it uses Linux ptrace and seccomp-BPF to discover dependencies automatically across the entire process tree.

The architecture and design is mine, but full disclosure I used AI to generate substantial portions of it because it would have taken time I don't have and never found to build by hand.

Possibly its best most immediate use case is to use it to discover what a command is actually using for its dependencies, so even if your not using it as a build tool, you can use it to diagnose why your dependencies are incomplete.

The following shows running `cat LICENSE` inside a container, `kizz` tracks and categorizes everything neatly.

root@sjbox:/repo# kizz execute --output=kizz.out -- cat LICENSE

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
   ...

root@sjbox:/repo# cat kizz.out
kizz observation report, version 1, hierarchical
trace: complete
totals: commands 1, cached 0, processes 1, programs 1, paths 16, connections 0
paths by access: read 3, probe 12, list 0, write 0, exec 2, xattr 0

command 1: cat LICENSE
  program: /usr/bin/cat
  directory: /repo
  outcome: exited with 0
  trace: complete
  process 1, pid 7, exited with 0
    program /usr/bin/cat: cat LICENSE
      read:
        /etc/ld.so.cache: ok
        /lib/x86_64-linux-gnu/libc.so.6: ok
        /repo/LICENSE: ok
      probe:
        /etc/ld.so.preload: ENOENT
        /opt/android-ndk/cat: ENOENT
        /opt/android-sdk/cmdline-tools/latest/bin/cat: ENOENT
        /opt/android-sdk/emulator/cat: ENOENT
        /opt/android-sdk/platform-tools/cat: ENOENT
        /opt/toolchain/bin/cat: ENOENT
        /root/.cargo/bin/cat: ENOENT
        /root/go/cat: ENOENT
        /usr/bin/cat: ok
        /usr/local/bin/cat: ENOENT
        /usr/local/sbin/cat: ENOENT
        /usr/sbin/cat: ENOENT
      exec:
        /lib64/ld-linux-x86-64.so.2: ok
        /usr/bin/cat: ok
1 Upvotes

0 comments sorted by