Konrad, 2026-11-22: "i want mcde to support 'make debian' and it'll fully
create and download all required build dependencies and shit and make debian
debian-install would make the deb and all and then even install" and
"inkluding our own motif stuff xyz".
tools/mcde-debian.sh does the three steps in one lock:
build installs the build dependencies through apt-get (the ones
configure.ac stops on and each -dev the tree compiles against),
builds MCDE from a copy of ext/src/mcde with the path step of
tools/mcde-host.sh, installs into build/mcde-debian-stage, strips,
and packs build/mcde-debian/mcde_<version>_<arch>.deb
install installs that package
clean removes both directories
The package carries its own Motif: libXm, libMrm, libUil, the uil compiler
and the headers live in /usr/mdt, so the desktop runs from its own toolkit
and never from the system's libxm4 (--with-private-motif, as Konrad asked).
Four things cost a run each and are written where they bit:
- dpkg-shlibdeps matches a shlibs line on the SONAME version (libXm.so.4 ->
4), not on the file version (4.0.4). With 4.0.4 it ignored the line, found
the system's libxm4 and put it in Depends.
- -L is the override file dpkg-shlibdeps READS; -T is where it writes the
substvars it produced. The first version passed -T and got nothing.
- -x$PKG, or the package depends on itself (every binary links /usr/mdt/lib).
- The version carries the commit, so a rebuild leaves a second .deb beside
the first and `dpkg -i *.deb' installs both -- the older wins. One package,
one file: the old one goes.
debian-mcde/ holds what the package manager cannot do for the desktop: the
control paragraph, a postinst that indexes the fonts MCDE carries under
/usr/mdt/fonts for the X server, and the session entry (Type=XSession,
/usr/share/xsessions/mcde.desktop) -- without it a display manager lists the
host's desktops and not MCDE.
Verified on this host (2026-11-22):
bmake debian from an empty build/mcde-debian exit=0,
build/mcde-debian/mcde_0.1.0+git420f66c19e_amd64.deb (42M, 180280 KiB
installed, 4583 files)
Depends is free of libxm4/libuil4/libmrm4 and free of mcde itself
the package carries usr/mdt/lib/libXm.so.4.0.4, libMrm, libUil and the
uil compiler; /etc/pam.d/dtlogin and dtsession are conffiles
dpkg -i installs it, postinst runs
ldd /usr/mdt/bin/dtwm -> /usr/mdt/lib/libXm.so.4 (its own)
on a private Xvfb: dtsession, dtwm, dtlaunch, dtpad, dtfile and the
front panel (Applications/Files/Desktop/System/Network) run, no errors
bmake debian-install exit=0, "mcde 0.1.0+git420f66c19e install ok
installed", 0 upgraded / 0 newly installed
AGENTS.md and docs/BUILD-CONTRACT.md list mcde-debian.sh among the tools that
need the build lock, next to mcde-host.sh.
t0768
188 lines
10 KiB
Markdown
188 lines
10 KiB
Markdown
# AGENTS.md -- how work happens in this tree
|
|
|
|
Makronix is a NetBSD, built and shaped on purpose. Read this before changing
|
|
anything; the rules are few and they are binding.
|
|
|
|
Read in this order, every time: `GOAL.md` (what Makronix is and when a part is
|
|
done), this file, `docs/BUILD-CONTRACT.md` (the one way to build). Every
|
|
directory below the root carries its own `AGENTS.md`: what lives there, what
|
|
may be changed, what may not. Read the one in the directory you work in
|
|
before you touch it.
|
|
|
|
Where this file and a measurement disagree, the measurement wins and this file
|
|
is wrong: fix the file, name the log line that settled it. The old measurements
|
|
and narratives (media sizes, the CDE/MCDE build-host story, what was measured
|
|
when) are in `docs/reference/agents-history-2026-11-13.txt`; they are history,
|
|
not rules.
|
|
|
|
## The rule before all others
|
|
|
|
**Read the documentation first, every time, and save what you read.** In this
|
|
order: the docs in the tree (`AGENTS.md`, `src/BUILDING`, man pages, the comment
|
|
at the top of the file), then the project's own upstream documentation. Keep a
|
|
copy under `docs/reference/<topic>.txt` with source and date so the next session
|
|
does not start over. Quote the sentence that settles a question -- with its
|
|
location -- before acting on it. "The docs say" without having opened them is
|
|
the failure this rule exists to prevent; it has cost this project days.
|
|
|
|
## The one rule
|
|
|
|
**NetBSD first, in this order:** read the documentation in the tree (`AGENTS.md`,
|
|
`src/BUILDING`, `src/share/misc/style`, `src/distrib/sets/README`,
|
|
`src/etc/rc.subr`); look for the pattern already in the tree with `git grep`;
|
|
use the building block that exists. Only then write code -- and the comment
|
|
says which NetBSD pattern it follows.
|
|
|
|
A patch that breaks a NetBSD convention is a finding for the report, never a
|
|
quiet change in the tree.
|
|
|
|
## Licence
|
|
|
|
What Makronix wrote itself is under the CNCL (Could Not Care Less License 1.0,
|
|
`LICENSE` at the root; files carry the line `License: CNCL 1.0 ...`). What
|
|
comes from elsewhere keeps its own licence: `src/` (NetBSD, BSD), `xsrc/`,
|
|
`pkgsrc/`, `refs/*`, the imported trees under `ext/` (MCDE is CDE: LGPL 2.0
|
|
or later) and their changes to files that already had a licence. A new file
|
|
in a fork gets the CNCL line; a changed upstream file keeps the notice it has.
|
|
|
|
## What belongs where
|
|
|
|
- `src/` is **Makronix's NetBSD tree**, tracked here. It began as the upstream
|
|
commit in `src/BASE` and is edited directly: no patches, no overlay.
|
|
`refs/netbsd/src` is upstream trunk, shallow and read-only -- look there,
|
|
never build from it.
|
|
- `xsrc/` is **Makronix's X tree** (since 2026-11-13 again), tracked the same
|
|
way: the upstream commit in `xsrc/BASE`, built by `build.sh -x -X xsrc` into
|
|
the X sets; pkgsrc uses it (`X11_TYPE=native`).
|
|
- `mobile/` is the Linux tree for the phones: kernel from `refs/linux/7.0.14`,
|
|
our changes as `mobile/kernel/patches/`. The imported tree is read-only.
|
|
- `ext/` holds third-party sources Makronix ships and changes (MCDE, afpfs-ng,
|
|
...): `ext/src/<name>/` the tree, `.../pkgsrc/` its recipe, `IMPORT` where it
|
|
came from. First commit of a tree is the upstream archive unchanged; every
|
|
change after it is a visible diff (`ext/AGENTS.md`).
|
|
- `pkgsrc/` and `refs/*` are their own repositories, pinned. Moving a pin is a
|
|
decision; editing inside them is not allowed.
|
|
- `distfiles/` is part of the repository (Konrad, 2026-11-19: everything the
|
|
build needs lives in the repository -- today the source archives and the
|
|
binary packages, later the sources of what now comes as a binary).
|
|
|
|
## Building
|
|
|
|
Everything builds from the root `Makefile`. It is NetBSD make (Konrad,
|
|
2026-11-19): `make` on Makronix, `bmake` on a Linux host; GNU make does not
|
|
read it. The interface is meant to stay this small -- **do not add targets**:
|
|
|
|
make the build (sets)
|
|
make release the release: sets, kernels, ramdisks, media
|
|
make install over a running Makronix, idempotent, incremental
|
|
make mobile the phones (wanted; not there yet -- mobile/Makefile
|
|
has its own targets, mobile/AGENTS.md)
|
|
|
|
The other targets that exist (`iso`, `usb`, `compress`, `sourcesets`, `isosrc`,
|
|
`userland`, `binaries`, `test`, `cdtest`) package or check what `release`
|
|
built; `docs/BUILD-CONTRACT.md` says in which order.
|
|
|
|
**Cross and native are one build** (decided 2026-11-13). The build host may be
|
|
NetBSD (native) or anything else (cross); the build detects which at the start
|
|
and sets the toolchain up once. A package that builds only on one of them is
|
|
broken, and the fix is in our recipe (`ext/`), in `tools/pkgsrc-cross.mk.conf`
|
|
(host tools such as `CC_FOR_BUILD`), or in the source -- never "build it in a
|
|
VM". `pkgsrc/` itself is not patched.
|
|
|
|
**The VM is for testing only**: installations from the media, upgrades,
|
|
smoke tests. Nothing is built in it.
|
|
|
|
Rules for a build:
|
|
|
|
- `make release` is the whole release: sets, kernels, the signed source set,
|
|
the ISO and the USB image, in one lock (since 2026-11-18). `make iso` and
|
|
`make usb` alone only repackage what the last release built: they check the
|
|
stamp (`build-stamp.sh -c`) and stop without removing anything.
|
|
- Long builds: start the one named target in the background with its output in
|
|
`build/logs/<target>-<date>.log` and end the turn. The status is the last
|
|
line, `make <target> exit=N`, not the wrapper's. No transient units.
|
|
- One build at a time in one tree: the root Makefile takes
|
|
`tools/build-lock.sh`; a second build is refused with the holder's pid
|
|
(t0286, `METALOG.sanitised` and the CD staging). The lock is re-entrant
|
|
(`BUILD_LOCK_HELD`), so `make cdtest` holds it across release, iso and the
|
|
VM test; `make mcde-linux` and `make mcde-host` take it too. Tools that
|
|
write `build/obj` or `releasedir` (`build-stamp.sh`, `cd2.sh`, `cd3.sh`,
|
|
`cd-source.sh`, `images.sh`, `srctree-stage.sh`, `userland.sh`,
|
|
`mcde-linux.sh`, `mcde-host.sh`, `mcde-debian.sh`) refuse to run outside it;
|
|
start them through make or `tools/build-lock.sh '...'`. The tests
|
|
(`test.sh`, `mediacheck.sh`, `install-simple.sh`, `install-cgd.sh`,
|
|
`mcde-tests.sh`) call `build-lock.sh --check` and refuse to start beside a
|
|
build; `make test` and `make cdtest` hold the lock while they run.
|
|
- The gate on a build is `checkflist`, run the way NetBSD runs it (`cd
|
|
src/distrib/sets && DESTDIR=build/obj/destdir.amd64 MACHINE=amd64
|
|
MACHINE_ARCH=x86_64 build/obj/tooldir.*/bin/nbmake-amd64 checkflist`). Extra
|
|
or missing files fail the build. Do not hand-roll its environment.
|
|
- A boot message `WARNING: 1 module failed to load` for `cd9660` is not a
|
|
defect (the INSTALL kernel has it built in).
|
|
|
|
## Third-party packages (pkgsrc)
|
|
|
|
pkgsrc builds FOR the target with this tree's toolchain
|
|
(`tools/pkgsrc-cross.mk.conf` is the whole configuration, `--prefer-native=yes`
|
|
is not optional). Packages are installed into the sysroot's `/usr/pkg` and
|
|
belong to one set, `makronix`, which is **generated**: `tools/makronix-set.sh`
|
|
reads the installed tree back and writes `src/distrib/sets/lists/makronix/mi`
|
|
and the METALOG records; since 2026-11-15 `packages.list` also knows the
|
|
art `bin` (vim, git-base, sysupgrade, flex, ksh93, tcl; commit 51c89ff23a),
|
|
so `makronix-set.sh` starts from `set`+`bin` and removes every other registered
|
|
package from the sysroot with pkg_delete (x11-links, osabi stay; commit
|
|
909271b3d7). sysinst installs it (`SET_MAKRONIX` in `defs.h`,
|
|
`util.c`, every `msg.mi.*`). Removing a package means removing its list
|
|
entries and marking them `obsolete`.
|
|
|
|
The target's `pkg_install` comes from the distribution, not from pkgsrc. A fork
|
|
from `ext/` is built from an archive `git archive` makes of its last commit
|
|
(`tools/ext-dist.sh`, `tools/mcde-dist.sh`), its recipe is copied into pkgsrc by
|
|
`tools/ext-sync.sh`.
|
|
|
|
Where pkgsrc's cross mode stops on a Linux host (`awk:run`, xbase looked up on
|
|
the host, host-only tools) is a finding for the report and a setting in our
|
|
configuration; see the history file for the details measured so far.
|
|
|
|
## Definition of done
|
|
|
|
A change is done when its test is green and it is committed. A build is done
|
|
when `checkflist` reports no missing and no extra files. A medium is done when
|
|
an install from it reaches a login prompt and shuts down cleanly -- with the
|
|
log kept in the tree.
|
|
|
|
No claim without a measurement: file and line, exit code, log excerpt.
|
|
|
|
## Forbidden
|
|
|
|
Enforced by the build gate `tools/claude-build-gate.sh` where a harness hook can
|
|
see it, binding everywhere else:
|
|
|
|
- building through `systemd-run` or any transient unit; `make -C build`,
|
|
`cd build && make`, hand-chained `build.sh` operations.
|
|
- writing, moving or deleting anything under `build/obj/releasedir/**` by hand.
|
|
(The hook is textual: a command that names `releasedir` and contains `rm `,
|
|
`mv `, `cp `, `touch `, `chmod `, `sed -i` or `>` is refused, a `2>&1`
|
|
included. Read without redirections, or in a script under `tools/`.)
|
|
- `git reset --hard`, `git checkout -- .`, `git clean -fdx` in the root. Undo
|
|
with `git restore <file>` after looking at what it is.
|
|
- deleting `src/distrib/sets/lists/**` to make `checkflist` pass.
|
|
- unattended loops: cron jobs, timers, "tick" scripts that start builds or
|
|
tests or hand work to an agent.
|
|
|
|
## How to work
|
|
|
|
- Plan before acting on anything non-trivial: say which command you will run
|
|
and what you expect, run it, compare.
|
|
- Every claim carries `file:line` or a log line. A sentence without one is a
|
|
guess.
|
|
- Do not trust a status document, a commit message or an old log over a
|
|
measurement you can repeat. Repeat it.
|
|
- `tools/` is POSIX `sh`: no Python, no bashisms (`dash -n`, `checkbashisms`).
|
|
- Commit with explicit paths in one command (`git commit -m ... -- <paths>`);
|
|
a second agent works in `mobile/` in the same repository.
|
|
- Each directory has its own `AGENTS.md` (what it is for, what is in it, what
|
|
may change, what must not be touched); when a directory gains a purpose, a
|
|
rule or a hazard, its file changes in the same commit. Not below the
|
|
top-level directories of `src/`, `pkgsrc/` or the reference trees.
|