Repository navigation
sysl 0.0.162 — __NAME__, sysl tidy, and a match arm that hands its payload back without copying it
Latest__NAME__, sysl tidy, and a match arm that hands its payload back without copying it
One behaviour change, two features and one code-generation change. sysl run and sysl test no longer replay a stale binary after a manifest's version moves. __NAME__ reads the name in the code's own package.hocon, as __VERSION__ reads its version. sysl tidy rewrites sysl.sum to exactly the lines the project's graph still reads. And a match arm that hands back a large payload now builds it where it is going, which halves musicbox-pico's boot frame.
Behaviour change
- The run cache now keys on each package's manifest: its path, name and version (3437cfe).
sysl runandsysl testused to key a built binary on the source files alone. The manifest__VERSION__folds in was not part of the key, so bumpingversionin an otherwise unchanged tree replayed the old binary and printed the old version. A change to any package'spackage.hoconname or version now rebuilds. Tests:RunCacheTests.AstCodec.Version61 → 62, because the manifest a source carries through a.syslibnow holds its name. A.syslibwritten by an older compiler is rebuilt rather than read.
Features
__NAME__is thenamein thepackage.hoconof the package a file belongs to (3437cfe). It is the twin of__VERSION__, read from the same manifest under the same rules. A library's__NAME__is the library's own name. Written as a default argument it is the caller's, so a logging library'slogcat(msg: string, tag: string = __NAME__)tags every message with the name of the application that called it. It is a string literal, so it folds into aconstor a module-levelval. A file that belongs to no package, or a manifest with nonamekey, is refused at the use: "'NAME' is the 'name' in package.hocon, and this file is not part of a package", or "… and …/package.hocon declares none".reference/lexical.md § __NAME__ is the package's name. Tests:NameBuiltinTests.sysl tidy [<path>] [--check](8af9806). A build only ever adds a line tosysl.sum, so moving a dependency from 0.1.0 to 0.3.0 left the 0.1.0 line recorded for good.tidyresolves the whole graph (every feature, anddev_dependenciestoo, since pruning by the features one build asked for would drop the others) and keeps exactly the lines that resolution reads. Live lines are kept byte for byte and in place. It printsremoved <coordinate> <tag>oradded <coordinate> <tag>for each line it changes, and nothing when the file was already tidy. A project depending on nothing, or only on paths, ends with nosysl.sum, which is what a build leaves for one.sysl tidy --checkwrites nothing and exits non-zero where the file is not tidy, for CI. Outside a project it is refused. Builds are unchanged and stay append-only. Tests:TidyTests.
Code generation
- A
matcharm that hands back a large payload no longer copies it (e4514a4). Inval p: &Big = make() matchwithOk(s) -> sandErr(_) -> return 1, the box is built and the payload copied straight from the call's result into it. Invar p = make() match …, where every other arm leaves,pis the payload inside the result's own storage, with no copy at all. The call's result is written into one slot and read through its address; only its tag is loaded to pick the arm. It used to be loaded whole, stored again and bound a third time. An arm that does anything else with the binding still binds it, and every count is given back exactly once. Tests:MatchMoveTests.- On
thumb-freestanding-softfp, with a 4,104-byteBig,boot's frame goes from 8,224 B to 4,128 B for the boxed form and from 12,304 B to 4,120 B for the local one, against 4,128 B forunwrap(). musicbox-pico'sbootgoes from 11,384 B to 5,904 B.
- On
Verification
- Full Native gate on
3ff7165e(./run-gate.sh): GATE: GREEN, 12502 succeeded, 0 failed, no retries, nothing timed out. The release is that sha plus the version bump. - Warnings census clean (JVM / JS / Native / syslDocJVM / syslDocNative): after
clean, two / three / three / one / two. Every warning is named, and none is in this repository:Reader.scala:26:6comes from scala-parser-combinators,Set.scala:62:15from the Scala.js scaladoc, and the rest are the build-infra-Xpluginand-classpathlines. - The darwin tarball was extracted to a scratch prefix and checked there:
sysl --versionreports 0.0.162 andsysl docdispatches tosysl-doc. A package naming itselfprobe-appprints[ probe-app ] startedthrough atag: string = __NAME__default, and bumping itsversionfrom 1.2.3 to 1.2.4 with nothing else changed makes the nextsysl runprint 1.2.4.