0.9.0 --- a build can state which version of this library it holds - #21
Merged
Conversation
Two rounds of mcpplibs/openkal-linux#13 were answered against the wrong version, and the software gave no way to settle the question. The only version-shaped thing a program could read was `uname`'s `release` field, which was the string literal "0.5.0" through every release after 0.5.0. It was therefore not a missing answer but a WRONG one: a consumer who checked it was misled rather than left uncertain. --- what changes -------------------------------------------------------------- `build.mcpp` reads the version from `mcpp.toml` and defines it. THE NUMBER IS STATED IN ONE PLACE: a `defines` entry in the manifest would state it a second time, four lines below where it already is, and the two would agree until one of them was edited. A manifest the program cannot read yields no definition, and the field then reports "unknown" -- a true statement, unlike the constant it replaces. `uname`'s release field is that version. `OPENKAL_MUSL_TRACE=enosys` names it before the program runs, and WHETHER OR NOT ANYTHING IS MISSING. That last part is the substance rather than a detail. A run in which nothing was refused printed nothing at all, so three situations were one reading: the version is right and no operation is absent; the variable did not take effect; this is not the binary the reader thinks it is. The report that began this round could not distinguish them, and neither could we. --- the quoting, because it failed first -------------------------------------- `-DOKM_VERSION="0.9.0"` reaches a build file that a shell executes, so the compiler received `-DOKM_VERSION=0.9.0`: <command-line>: error: too many decimal points in number naming a line in build.mcpp that was correct. The escape is what the shell removes now, and the quote survives. --- criteria ------------------------------------------------------------------ Three, and the third is the one that protects everybody who is NOT debugging: ok silent unless asked ok the banner names 0.9.0 ok uname reports 0.9.0 Without the third this could become noise in every ordinary run and nothing would say so. Measured: with the variable unset the probe writes zero bytes to the error stream. Confirmed by putting the previous behaviour back: banner: FAIL got=[] uname: FAIL got=[0.5.0] `examples/posix` asserts that the field is neither empty nor the placeholder, and deliberately does NOT assert a particular number -- one that named a version would have to be edited by every release rather than checked by it. The workflow is what compares the number against `mcpp.toml`. --- what a program above this observes ----------------------------------------⚠️ The release field MOVES AT EVERY RELEASE. Nothing here or in musl reads it --- `gethostname` and `getdomainname` are musl's only consumers of `uname` and both read `nodename` --- but a program that compares the field against a fixed string will see it change. `sysname` is "openkal" and not "Linux", so nothing can have been reading it as a kernel version. Recorded in README.md's divergence table. Nothing else changes: 49 observations, 0 failures.
… too
The macOS row reported
##[error]the program wrote 0 line(s) to the error stream without
being asked
on a program that wrote nothing. BSD `wc' pads its count with spaces where GNU
`wc' does not, so `[ "$quiet" = 0 ]' compared " 0" against "0".
The step above this one does the same thing and never met it: it carries
`if: runner.os == 'Linux'`. This one deliberately runs on every row, because
the property it asserts --- that the library says nothing unless asked --- is
one every system's consumers depend on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two rounds of mcpplibs/openkal-linux#13 were answered against the wrong version, and the software gave no way to settle the question.
The only version-shaped thing a program could read was
uname'sreleasefield, which was the string literal"0.5.0"through every release after 0.5.0. That is not a missing answer but a wrong one — a consumer who checked it was misled rather than left uncertain.What changes
build.mcppreads the version frommcpp.tomland defines it. The number is stated in one place: adefinesentry in the manifest would state it a second time, four lines below where it already is, and the two would agree until one of them was edited. A manifest the program cannot read yields no definition, and the field then reportsunknown— a true statement, unlike the constant it replaces.uname'sreleasefield is that version.OPENKAL_MUSL_TRACE=enosysnames it before the program runs, and whether or not anything is missing:That last part is the substance rather than a detail. A run in which nothing was refused printed nothing at all, so three situations were one reading: the version is right and no operation is absent; the variable did not take effect; this is not the binary the reader thinks it is. The report that began that round could not distinguish them, and neither could we.
One process contributes one such line, so a program that starts another produces one for each and they must agree.
Criteria
Three, and the third is the one that protects everybody who is not debugging:
Without the third this feature would be free to become noise in every ordinary run and nothing would say so. Measured: with the variable unset the probe writes zero bytes to the error stream.
Confirmed by putting the previous behaviour back:
examples/posixasserts the field is neither empty nor the placeholder, and deliberately does not assert a particular number — an observation naming one would have to be edited by every release rather than checked by it. The workflow is what compares the number againstmcpp.toml.The quoting, because it failed first
-DOKM_VERSION="0.9.0"reaches a build file that a shell executes, so the compiler received-DOKM_VERSION=0.9.0:naming a line in
build.mcppthat was correct. The escape is what the shell removes now, and the quote survives.What a program above this observes
gethostnameandgetdomainnameare musl's only consumers ofunameand both readnodename— but a program that compares the field against a fixed string will see it change.sysnameisopenkaland notLinux, so nothing can have been reading it as a kernel version. Recorded inREADME.md's divergence table.Nothing else changes: 49 observations, 0 failures.