README: - Quick Start shows kappa add workflow instead of manual configs - New features: indexed repos, env operators (+=, ?=), conflict reporting - Updated subcommand table (add, remove, index, validate-index) - Repo maintenance section (kappa index) - Link to STYLEGUIDE.md, test counts, CI info CONTRIBUTING: - Updated test counts (30+23+85 instead of 31+23) - Added test-full.sh to mandatory test suite - Referenced STYLEGUIDE.md in PR requirements - Updated good-first/ambitious issues for current state
This commit is contained in:
@@ -72,16 +72,45 @@ kappa rebuild config.kap # boot.init = "openrc" — only 5 packages actually r
|
||||
simultaneously, eight jobs each. The scheduler uses depth-based priority
|
||||
grouping so leaf dependencies unblock as much work as possible first.
|
||||
|
||||
- **Package recipe caching.** Declare `remotes = ["https://repo.example.com/"]`
|
||||
in your config. Kappa fetches `.kap` files on demand, caches them, and only
|
||||
re-fetches when the remote version is newer.
|
||||
- **Package recipe caching with indexed repos.** Declare named repos with
|
||||
channels and mirrors in your config. Kappa fetches `index.kap` from each
|
||||
repo, caches it, and only re-fetches when the remote changes. Package recipes
|
||||
are resolved from the index — fast, offline-tolerant, and mirror-aware.
|
||||
|
||||
```kap
|
||||
repos {
|
||||
kappa-os {
|
||||
url = "https://packages.kappa-os.org/"
|
||||
channels = ["stable"]
|
||||
mirrors = [
|
||||
"https://cdn.kappa-os.org/",
|
||||
"https://eu.kappa-os.org/",
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`remotes = [...]` still works. Repos are tried first, then legacy remotes.
|
||||
|
||||
- **Source tarball caching.** Downloaded once, stored at `$KAPPA_ROOT/cache/`
|
||||
(default: `/usr/local/kappa/cache/`). Rebuilds don't touch the network
|
||||
unless versions change.
|
||||
|
||||
- **Env operators.** Three ways to set build environment variables:
|
||||
`=` (hard set), `+=` (append with space), `?=` (soft set — only if not
|
||||
already defined). System-level env propagates to all packages.
|
||||
|
||||
```kap
|
||||
env {
|
||||
CFLAGS = "-O2 -march=native" # overwrite
|
||||
CFLAGS += "-pipe" # append → "-O2 -march=native -pipe"
|
||||
CFLAGS ?= "-g" # soft — only if not set
|
||||
}
|
||||
```
|
||||
|
||||
- **Conflicts.** `systemd` declares `conflicts = ["eudev", "elogind"]`. The
|
||||
resolver catches mutual incompatibility before a build starts.
|
||||
resolver catches mutual incompatibility before a build starts — and now
|
||||
actually reports it, rather than silently ignoring it.
|
||||
|
||||
- **Init-agnostic system config.** `groups { wheel { gid = 998 } }` — kappa
|
||||
creates the groups. `system { hostname = "mybox" }` — kappa writes
|
||||
@@ -113,41 +142,53 @@ kappa rebuild config.kap # boot.init = "openrc" — only 5 packages actually r
|
||||
cmake -B build -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
cmake --build build
|
||||
|
||||
# Write a config
|
||||
cat > system.kap << 'EOF'
|
||||
system { hostname = "kappa.local" }
|
||||
packages { nginx {} }
|
||||
services { nginx { enable = true } }
|
||||
boot {
|
||||
kernel = "linux"; init = "s6"; root = "/dev/sda1"; bootloader = "limine"
|
||||
}
|
||||
users { root { shell = "/bin/zsh" } }
|
||||
remotes = ["https://packages.kappa-os.org/stable/"]
|
||||
EOF
|
||||
# Add packages to your system config
|
||||
build/kappa add make
|
||||
build/kappa add nginx ">=1.24"
|
||||
build/kappa add zlib
|
||||
|
||||
# Parse it
|
||||
build/kappa parse-config system.kap
|
||||
# Rebuild — kappa fetches recipes, resolves deps, builds everything
|
||||
build/kappa rebuild $KAPPA_ROOT/system/config.kap
|
||||
|
||||
# Rebuild
|
||||
build/kappa rebuild system.kap
|
||||
# Remove packages
|
||||
build/kappa remove zlib
|
||||
```
|
||||
|
||||
No config files to write by hand. `kappa add` writes the `packages {}` block
|
||||
for you. `kappa rebuild` handles the rest.
|
||||
|
||||
### Subcommands
|
||||
|
||||
| Command | What it does |
|
||||
|---------|-------------|
|
||||
| `parse-package <file>` | Validate a `.kap` package definition |
|
||||
| `parse-config <file>` | Validate a system configuration |
|
||||
| `validate <file>` | Validate any kappa file |
|
||||
| `format <file>` | Pretty-print to canonical style |
|
||||
| `doctor <file>` | Check for issues and warnings |
|
||||
| `resolve <config>` | Compute a build plan |
|
||||
| `add <pkg> [version]` | Add a package to system config |
|
||||
| `remove <pkg>` | Remove a package from system config |
|
||||
| `build <package>` | Build a single package from its `.kap` definition |
|
||||
| `rebuild <config>` | Diff config against installed state, rebuild changed |
|
||||
| `resolve <config>` | Compute a build plan (shows order, deps, conflicts) |
|
||||
| `doctor <file>` | Check a file for issues and warnings |
|
||||
| `fetch <package>` | Download and verify source tarballs |
|
||||
| `fetch-package <name>` | Fetch a package recipe from remotes |
|
||||
| `build <package>` | Build a single package |
|
||||
| `rebuild <config>` | Diff config against installed state, rebuild changed |
|
||||
| `format <file>` | Pretty-print to canonical style |
|
||||
| `index <dir>` | Build an `index.kap` from `.kap` files in a directory |
|
||||
| `list` | Show installed packages |
|
||||
| `parse-config <file>` | Validate a system configuration |
|
||||
| `parse-package <file>` | Validate a `.kap` package definition |
|
||||
| `rollback` | Show available generations |
|
||||
| `validate <file>` | Validate any kappa file (package, config, or index) |
|
||||
|
||||
### Repo maintenance
|
||||
|
||||
```sh
|
||||
# Generate an index from a directory of .kap files
|
||||
kappa index ./packages/
|
||||
# → packages/index.kap
|
||||
|
||||
# Host the directory behind any HTTP server. That's your repo.
|
||||
```
|
||||
|
||||
The index is a tiny text file listing every package and version.
|
||||
Clients fetch it once, cache it, and check for updates via HTTP headers.
|
||||
|
||||
### License
|
||||
|
||||
@@ -156,4 +197,7 @@ BSD 2-Clause. Do whatever you want. Just don't sue us.
|
||||
### Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md). We're opinionated but we merge good
|
||||
code.
|
||||
code. See [STYLEGUIDE.md](STYLEGUIDE.md) for code conventions.
|
||||
|
||||
Tests: 138 integration tests across three suites. CI runs on Arch Linux.
|
||||
Everything passes or nothing merges.
|
||||
|
||||
Reference in New Issue
Block a user