Skip to content

Commit eccc6dc

Browse files
authored
openkal-musl 0.3.1: name the implementation by version, because a published package must (#3)
The manifest named the implementation of openkal for each system by a path. That is right in a working tree that has the three repositories side by side, and it is wrong in a package: a path names a directory that exists where the manifest was written and nowhere else, so a consumer resolving this package from the index was handed a dependency pointing at nothing --- reported as "path dependency 'openkal-linux' has no mcpp.toml", inside the registry's own store. It is named by version now, with the feature travelling beside it, because a program above this library carries no other runtime and that is what the feature states. The defect was found by resolving the package the way a stranger would, from a store with no local copy of it. That check exists for exactly this: a working tree masks every mistake in a manifest's dependencies, because the tree is what the manifest was written against. tools/working-trees.sh rewrites the implementation reference as well as the specification's, so that continuous integration goes on asserting what it is for --- that these sources and that implementation as written today work together --- while the published manifest says what a published manifest must.
1 parent e0ec7d2 commit eccc6dc

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ the claim can be checked rather than repeated.
88

99
```toml
1010
[dependencies]
11-
openkal-musl = "0.3.0"
11+
openkal-musl = "0.3.1"
1212
```
1313

1414
It names no implementation and no platform: a C library is the one consumer that

mcpp.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
namespace = "mcpplibs"
33
name = "openkal-musl"
4-
version = "0.3.0"
4+
version = "0.3.1"
55
description = "musl 1.2.5 redirected onto openkal: one C library, ported once, above every implementation of the specification rather than above one kernel."
66
license = "Apache-2.0"
77
authors = ["mcpplibs"]
@@ -23,13 +23,13 @@ openkal = "0.5.1"
2323
#
2424
# The consequence for a program is that it names this package and nothing else.
2525
[target.'cfg(os = "linux")'.dependencies]
26-
openkal-linux = { path = "../openkal-linux", features = ["standalone"] }
26+
openkal-linux = { version = "0.5.1", features = ["standalone"] }
2727

2828
[target.'cfg(os = "macos")'.dependencies]
29-
openkal-macos = { path = "../openkal-macos", features = ["standalone"] }
29+
openkal-macos = { version = "0.3.1", features = ["standalone"] }
3030

3131
[target.'cfg(windows)'.dependencies]
32-
openkal-windows = { path = "../openkal-windows", features = ["standalone"] }
32+
openkal-windows = { version = "0.1.1", features = ["standalone"] }
3333

3434
# The feature macros musl's own build establishes.
3535
#

tools/working-trees.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,17 @@ point() {
6969
point "$here/mcpp.toml"
7070
point "$beside/$implementation/mcpp.toml"
7171

72+
# And this package's own reference to the implementation. It names a version,
73+
# because a published package must: a path names a directory that exists in the
74+
# working tree it was written in and nowhere else, and a consumer resolving from
75+
# the index would be handed a manifest pointing at nothing. The feature travels
76+
# with the version, because a program above this library carries no other
77+
# runtime and that is what the feature states.
78+
impl_path="$(native "$beside/$implementation")"
79+
sed "s|^$implementation = .*$|$implementation = { path = \"$impl_path\", features = [\"standalone\"] }|" \
80+
"$here/mcpp.toml" > "$here/mcpp.toml.next"
81+
mv "$here/mcpp.toml.next" "$here/mcpp.toml"
82+
echo "pointed this package at $implementation's working tree"
83+
sed -n '/^\[target/,/^$/p' "$here/mcpp.toml"
84+
7285
echo "$implementation"

0 commit comments

Comments
 (0)