Build
Build tool usage and dependency management. Use when building, adding dependencies, or fixing build errors.
Process
- Identify the namespace or file you need to build.
- Run
bild <namespace>and review errors. - If dependencies are missing, add dep comments or whitelist packages.
- Re-run
bilduntil the build succeeds. - Run
bild --test <namespace>when tests exist.
Examples
bild Omni/Task.hs
bild --test Omni/Task.hs
Common Commands
bild Omni/Task.hs # Build a namespace
bild --test Omni/Task.hs # Build and run tests
bild --plan Omni/Task.hs # Analyze without building
bild --time 0 Omni/Task.hs # Build with no timeout
Output goes to _/bin/:
bild Omni/Task.hs
_/bin/task --help
Adding Dependencies
Python (in nixpkgs)
Just add the dep comment:
# : dep requests
import requests as Requests
Note: Use import X as Y pattern, not from X import Y.
Haskell (in nixpkgs)
Add to Omni/Bild/Deps/Haskell.nix whitelist:
[
"aeson"
"your-package" # alphabetically
]
Not in nixpkgs
deps add owner/repo -n package-name- Set
"auto-override": falsein Sources.json - Create derivation in
Omni/Bild/Deps/
Lint and Type Check
lint Omni/Task.hs # Lint
lint --fix Omni/Task.py # Lint and auto-fix
typecheck.sh Omni/Example.py # Type check Python
Common Errors
“attribute ‘foo’ missing”
The Haskell package isn’t whitelisted. Add it to Omni/Bild/Deps/Haskell.nix:
[
...
"foo" # Add alphabetically
...
]
Python “ModuleNotFoundError”
Check package name in nixpkgs:
nix-env -qaP -A nixpkgs.python312Packages | grep <name>
The nixpkgs name may differ from pip name.
Timeout during build
Use no timeout:
bild --time 0 <namespace>
“module X not found” (Haskell)
Check:
- File exists at the import path
- Module name matches file path
- Dep comment is present:
-- : dep Omni/Other/Module.hs
Import not detected (Python)
bild only detects import X as Y pattern. Change:
# Wrong - bild won't detect
from requests import get
# Right - bild will detect
import requests as Requests
Package Name Lookup
# Find Python packages
nix-env -qaP -A nixpkgs.python312Packages | grep <name>
# Find Haskell packages
nix-env -qaP -A nixpkgs.haskellPackages | grep <name>
# Find system packages
nix-env -qaP -A nixpkgs | grep <name>
Dep Comments
Haskell:
-- : out myapp -- Output binary name
-- : dep aeson -- Hackage dependency
-- : dep Omni/Other.hs -- Local module dependency
Python:
# : out myapp # Output binary name
# : dep requests # PyPI dependency
# : dep Omni/Other.py # Local module dependency