Mica 7.8.0 is the ground of the 7.8 train: a small release that makes the floor beneath every program a whole contract, the shipped compiler free of its build machine’s paths, and the container that carries the compiler a thing that can be fixed and published on its own. The runtime floor contract now names every entry anything above the floor reaches, and every link checks the whole floor against it before a tool runs, so a floor written by somebody else is refused by the entry it lacks, never by a linker’s undefined reference. The shipped compiler records no path of the machine that built it. An image fix of the user container ships under a tag of its own, v7.7.10-2, with no compiler release.

The floor beneath every program is a contract

Every program a Mica build links stands on the Dragon runtime floor, an archive of C that the generated code reaches by linkage name alone: the allocator, the strings, the scheduler, the tensor kernels, /usr/lib/mica-dragon-rt-arm64.a on an AArch64 machine and -amd64 on x86-64, with its memory and tasking variants beside it. The compiler carries the floor’s contract inside itself, a document that names each entry a floor owes and what the generated code may assume of it. A floor states which version of the contract it satisfies by defining one marker, which is what lets a link read a floor’s contract out of an archive’s symbol index without opening a member.

Until now the contract named the entries the generated code itself calls, and a link checked the ones the program’s own code reached. The standard library’s own calls into the floor, the compiler’s C, POSIX and Linux contracts, the program’s start and the device floor’s calls stood outside it, so a floor that lacked one of them passed the check and failed inside the linker, as a program importing ReadLine : files did over a floor missing the routine. In 7.8.0 the contract names every entry anything above the floor reaches, 451 entries at version 10 where version 9 named 364, and every link checks the whole floor against it before a tool runs: a release program’s link checks 347 entries where it checked 250.

You can watch the check at work. Copy the standard library and the floor beside each other, link a program against the copy, take one member out of the copy, and link again. The names are an AArch64 machine’s; an x86-64 machine says amd64.

mkdir -p /tmp/floor
cp /usr/lib/mica-stdlib-arm64.a /usr/lib/mica-dragon-rt-arm64.a /tmp/floor
mica --compile --link --optimize release --stdlib /tmp/floor/mica-stdlib-arm64.a --source Hello.mica --build /tmp/floor/out
ar d /tmp/floor/mica-dragon-rt-arm64.a deadline.o
mica --compile --link --optimize release --stdlib /tmp/floor/mica-stdlib-arm64.a --source Hello.mica --build /tmp/floor/out

The first link says Using Dragon runtime '/tmp/floor/mica-dragon-rt-arm64.a' and the program runs. The second stops before any tool runs:

The runtime floor '/tmp/floor/mica-dragon-rt-arm64.a' does not satisfy the contract this compiler was built against, so it cannot serve this program; 1 finding
  'mica-dragon-rt-arm64.a' does not define '__mica_task_scope_deadline', which this build requires

A floor of an earlier release is refused the same way, by the contract version it states: the 7.7.10 floor beside the 7.8.0 library draws states contract version '__mica_floor_contract_v9', which this compiler does not know. The point is replaceability. A floor written by somebody else, a vendor’s own or a freestanding one for a board, links exactly as the shipped one does, up to the moment it lacks an entry, and then the contract names the entry instead of a linker’s undefined reference or a jump into nothing at run time. The Dragon SDK asks the same question for a frontend of its own, dragon_floor_check in mica_dragon.h, and learns which entries its floor still owes before it links.

The shipped compiler records no path of the machine that built it

The package build trims the compiler’s own source paths, so a trace names a source file as the repository names it, gitlab.com/mica-dev/mica-compiler/..., and never the checkout of the machine that built the release. The package verification refuses a compiler that still carries a build-machine path, so a package that reaches you has none.

An image fix of the container ships on its own

The user container, micalang/mica, installs the compiler’s packages, and until now it could change only when the compiler released: an image fix had no name of its own. The image now has a revision of its own beside the compiler’s version. The tag v7.7.10-2 of the container repository publishes micalang/mica:7.7.10-2 and moves :7.7.10, :7.7 and :latest to it; a compiler release publishes its first image as :7.8.0-1. For an image that never changes under you, pin the revision, micalang/mica:7.8.0-1; for the newest image of a compiler release, :7.8.0; and the publish refuses a tag whose revision the image’s own revision file does not hold, so a tag and an image cannot disagree.

Fixed

  • A floor refused for one missing entry said 1 findings; it says 1 finding.

Upgrading

Things a 7.7.10 build meets differently in 7.8.0:

  • A program linked against a floor of your own meets the whole contract: the link checks every entry the contract names for the program’s class, where 7.7.10 checked the entries the program’s own code reached. A floor that served 7.7.10 and lacks a standard-library entry is refused by that entry’s name, and a 7.7.10 floor beside the 7.8.0 compiler by its contract version. The shipped floors need nothing.
  • micalang/mica:7.8.0 is a moving tag from this release on: it follows the newest image of the release. Pin micalang/mica:7.8.0-1 for an exact image.
  • The Mica extension for VS Code needs no new version for this release.

The packages and the commands that install them are on the install page.