You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0.9.0 --- a build can state which version of this library it holds (#21)
* 0.9.0 --- a build can state which version of this library it holds
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.
* ci: the count comparison is arithmetic, because this step runs on BSD 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.
Copy file name to clipboardExpand all lines: README.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ the claim can be checked rather than repeated.
8
8
9
9
```toml
10
10
[dependencies]
11
-
openkal-musl = "0.8.0"
11
+
openkal-musl = "0.9.0"
12
12
```
13
13
14
14
It names no implementation and no platform: a C library is the one consumer that
@@ -118,6 +118,7 @@ answer that leaves a program wrong without telling it.
118
118
| an immediate answer about a started program |`waitpid(…, WNOHANG)` returns without the program having finished, but may wait up to one polling interval of the implementation beneath (one millisecond on Linux) |`kal_timeout_wait_process` takes a bound and openkal spells "no bound" as zero, so a caller that does not want to wait asks for the smallest bound there is. An environment rounds a bound up to what its clock can distinguish; a bound shorter than the clock is a promise no environment can keep. |
119
119
| closing a standard stream in a program being started |`posix_spawn_file_actions_addclose(&fa, 0…2)` makes the spawn report `ENOSYS`; above position two it is performed, because nothing there is inherited | openkal has no value meaning "no stream", and the value that looks like one — zero — means the opposite: the stream the caller has. Accepting the action and not performing it would hand a program the standard input its caller had just taken away. |
120
120
| starting a program upon a stream whose handle is zero | a caller that redirects its **output** onto its own standard input and then starts a program gets `ENOSYS`|`kal_spawn_streams` reserves zero for inheritance and `kal_stream` reserves nothing, so an implementation whose streams are the environment's own descriptors hands out zero for standard input. The two agree at position zero and cannot be told apart anywhere else. Reported upstream; refused here rather than answered wrongly. |
121
+
|~~a version a program can read~~|**answered since 0.9.0.**`uname`'s `release` field is this package's version, and `OPENKAL_MUSL_TRACE=enosys` names it on the error stream once per process before the program runs | It was the string literal `0.5.0` through every release after 0.5.0, so a program that asked was not left without an answer -- it was given a false one. ⚠️ It therefore 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 above it 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. |
121
122
|**setting** the modification time of a directory |`utimensat` on a directory is refused, so `std::filesystem::last_write_time(dir, t)` throws. **Reading** it is unaffected and correct. The value differs by implementation and is the implementation's to give: `EISDIR` on Linux and macOS, `EACCES` on Windows — both measured |`kal_fs_set_modified` takes a `kal_file` and openkal has neither a `kal_dir` form of it nor a form that takes a name, so this port opens the name as a file, which a directory refuses. What a backend says about that is its own: one distinguishes a directory and one does not. Note that libc++ gives both overloads of `last_write_time` the same name in the message it throws, so the text does not say which of the two failed: the reading overload is `stat` and works on a directory. A caller using a lock directory's timestamp reads it to decide staleness and writes it to refresh the lock, and only the second fails. |
122
123
123
124
**⭐ What carries confinement here, since a mode word does not.** A program that
@@ -181,9 +182,22 @@ spent on exactly that question.
181
182
Each operation the dispatcher has no case for is then named on the standard
182
183
error stream, **once**, whatever the number of attempts:
183
184
185
+
openkal-musl 0.9.0
184
186
openkal-musl: no operation for system call 266
185
187
186
-
Three properties, each of them asserted in continuous integration because each
188
+
**The first line is the version, and it is printed whether or not anything is
189
+
missing.** That is the whole reason it exists. Before 0.9.0 a run in which
190
+
nothing was refused printed nothing at all, and three situations were then
191
+
indistinguishable: the version is right and no operation is absent, the variable
192
+
did not take effect, or this is not the binary the reader thinks it is. Two
193
+
rounds of [openkal-linux#13](https://github.com/mcpplibs/openkal-linux/issues/13)
194
+
were answered against the wrong version because of it.
195
+
196
+
A report pasted into an issue therefore carries its own provenance, and one
197
+
process contributes one such line — a program that starts another produces one
198
+
for each, and they must agree.
199
+
200
+
Four properties, each of them asserted in continuous integration because each
187
201
of the corresponding failures is quiet:
188
202
189
203
-**Nothing is reported unless the variable is set.** A diagnostic that appears
@@ -195,6 +209,10 @@ of the corresponding failures is quiet:
195
209
answer `ENOSYS` from cases of their own, each a decision with a reason
196
210
recorded beside it. Reporting those would name a facility as missing that this
197
211
port deliberately does not have, which is a different sentence.
212
+
-**The version named is the one in `mcpp.toml`.** It is read from the manifest
213
+
by `build.mcpp` rather than written out a second time, and the workflow
214
+
compares the printed line against the manifest. A version stated in two places
215
+
agrees until one of them is edited.
198
216
199
217
The report is written to the stream directly rather than through this library's
200
218
own output, because what failed may be the operation that output was about to
Copy file name to clipboardExpand all lines: mcpp.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
[package]
2
2
namespace = "mcpplibs"
3
3
name = "openkal-musl"
4
-
version = "0.8.0"
4
+
version = "0.9.0"
5
5
description = "musl 1.2.5 redirected onto openkal: one C library, ported once, above every implementation of the specification rather than above one kernel."
0 commit comments