An artifact says which operating system it is built for
First of the steps in novox/hq ADR 0142, and it ships alone: a new manifest word reaches the builder and the controller one release before any manifest uses it. A toolchain deliberately accepts nothing from the module — anything a module could override there it would be writing a Dockerfile to override — and yet a compiled binary is per operating system, pinned at link time so a host refuses to touch a machine it was not built for (ADR 0005). The way out is that the target belongs to the artifact: one artifact per system, one build each, recipe still the mesh's. A bundle in a language that compiles to a binary must name a system, or it would be built for whatever the build machine happened to be — which reads as portable and is not. A bundle in a language that runs anywhere may not name one, because a system that decides nothing reads as though it did. The list is the host's own names, not a compiler's: the difference between two of them is a C library rather than a kernel. Nothing declares a system yet, and no toolchain compiles to a binary yet, so this changes no build.
This commit is contained in:
@@ -571,6 +571,21 @@ type Artifact struct {
|
||||
// image built from this same module's own repository, the same as every other artifact.
|
||||
Context *ArtifactContext `json:"context,omitempty"`
|
||||
|
||||
// System is the operating system this artifact is compiled for, for a bundle whose output is a
|
||||
// binary rather than portable code (novox/hq ADR 0142).
|
||||
//
|
||||
// **Named by the artifact, not by the recipe.** A toolchain deliberately accepts nothing from
|
||||
// the module — anything a module could override there it would be writing a Dockerfile to
|
||||
// override — and yet a compiled binary is per operating system, pinned at link time so a host
|
||||
// refuses to touch a machine it was not built for (novox/hq ADR 0005). The way out is that the
|
||||
// target is a property of the artifact: one artifact declared per system, one build each, and
|
||||
// the recipe stays the mesh's.
|
||||
//
|
||||
// Empty for a bundle whose output runs anywhere, which is every interpreted language, and for
|
||||
// every other kind. A bundle in a language that compiles to a binary must say one, because
|
||||
// "compiled for whatever the build machine happened to be" is the fault this exists to prevent.
|
||||
System string `json:"system,omitempty"`
|
||||
|
||||
// Language is what this module's code is written in, for a bundle.
|
||||
//
|
||||
// **Declared, never guessed.** Inferring it from what files happen to be present makes a
|
||||
|
||||
Reference in New Issue
Block a user