Skip to content

Commit 02e1625

Browse files
committed
The openkal 0.25 family: linux 0.26.0, macos 0.23.0, windows 0.21.0, emscripten 0.14.0, opensbi 0.9.0; the examples moved to it, and openkal-kit has a consumer
tests/examples/openkal names the family and observes a second name for a file where the volume states it. tests/examples/openkal-kit consumes the kit through the index, so the candidate gate has a member that names it.
1 parent 8f6de57 commit 02e1625

9 files changed

Lines changed: 182 additions & 7 deletions

File tree

‎pkgs/o/openkal-emscripten.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ package = {
4646

4747
xpm = {
4848
linux = {
49+
["0.14.0"] = {
50+
url = {
51+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.14.0.tar.gz",
52+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.14.0/openkal-emscripten-0.14.0.tar.gz",
53+
},
54+
sha256 = "d8d9e4b437bc0deeccab274d54a6f99eba7b9e77b9333c22377949893d5e7aab",
55+
},
4956
["0.13.0"] = {
5057
url = {
5158
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.13.0.tar.gz",
@@ -153,6 +160,13 @@ package = {
153160
},
154161
},
155162
macosx = {
163+
["0.14.0"] = {
164+
url = {
165+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.14.0.tar.gz",
166+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.14.0/openkal-emscripten-0.14.0.tar.gz",
167+
},
168+
sha256 = "d8d9e4b437bc0deeccab274d54a6f99eba7b9e77b9333c22377949893d5e7aab",
169+
},
156170
["0.13.0"] = {
157171
url = {
158172
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.13.0.tar.gz",
@@ -260,6 +274,13 @@ package = {
260274
},
261275
},
262276
windows = {
277+
["0.14.0"] = {
278+
url = {
279+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.14.0.tar.gz",
280+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.14.0/openkal-emscripten-0.14.0.tar.gz",
281+
},
282+
sha256 = "d8d9e4b437bc0deeccab274d54a6f99eba7b9e77b9333c22377949893d5e7aab",
283+
},
263284
["0.13.0"] = {
264285
url = {
265286
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.13.0.tar.gz",

‎pkgs/o/openkal-linux.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.26.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.26.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.26.0/openkal-linux-0.26.0.tar.gz",
26+
},
27+
sha256 = "07b9a68742a3d40a9d74cf1a60f9dabb73ebebf594d4321333fa9ac88dccaa49",
28+
},
2229
["0.25.0"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.25.0.tar.gz",
@@ -245,6 +252,13 @@ package = {
245252
},
246253
},
247254
macosx = {
255+
["0.26.0"] = {
256+
url = {
257+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.26.0.tar.gz",
258+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.26.0/openkal-linux-0.26.0.tar.gz",
259+
},
260+
sha256 = "07b9a68742a3d40a9d74cf1a60f9dabb73ebebf594d4321333fa9ac88dccaa49",
261+
},
248262
["0.25.0"] = {
249263
url = {
250264
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.25.0.tar.gz",
@@ -471,6 +485,13 @@ package = {
471485
},
472486
},
473487
windows = {
488+
["0.26.0"] = {
489+
url = {
490+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.26.0.tar.gz",
491+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.26.0/openkal-linux-0.26.0.tar.gz",
492+
},
493+
sha256 = "07b9a68742a3d40a9d74cf1a60f9dabb73ebebf594d4321333fa9ac88dccaa49",
494+
},
474495
["0.25.0"] = {
475496
url = {
476497
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.25.0.tar.gz",

‎pkgs/o/openkal-macos.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.23.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.23.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.23.0/openkal-macos-0.23.0.tar.gz",
26+
},
27+
sha256 = "b1a061939bd99b8a888182223f1e68c9a2e036266af34569d5c4307abc2d151c",
28+
},
2229
["0.22.1"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.22.1.tar.gz",
@@ -259,6 +266,13 @@ package = {
259266
},
260267
},
261268
macosx = {
269+
["0.23.0"] = {
270+
url = {
271+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.23.0.tar.gz",
272+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.23.0/openkal-macos-0.23.0.tar.gz",
273+
},
274+
sha256 = "b1a061939bd99b8a888182223f1e68c9a2e036266af34569d5c4307abc2d151c",
275+
},
262276
["0.22.1"] = {
263277
url = {
264278
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.22.1.tar.gz",
@@ -499,6 +513,13 @@ package = {
499513
},
500514
},
501515
windows = {
516+
["0.23.0"] = {
517+
url = {
518+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.23.0.tar.gz",
519+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.23.0/openkal-macos-0.23.0.tar.gz",
520+
},
521+
sha256 = "b1a061939bd99b8a888182223f1e68c9a2e036266af34569d5c4307abc2d151c",
522+
},
502523
["0.22.1"] = {
503524
url = {
504525
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.22.1.tar.gz",

‎pkgs/o/openkal-opensbi.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ package = {
2020

2121
xpm = {
2222
linux = {
23+
["0.9.0"] = {
24+
url = {
25+
GLOBAL = "https://github.com/mcpplibs/openkal-opensbi/archive/refs/tags/0.9.0.tar.gz",
26+
CN = "https://gitcode.com/mcpp-res/openkal-opensbi/releases/download/0.9.0/openkal-opensbi-0.9.0.tar.gz",
27+
},
28+
sha256 = "70bf7414283bb431bf1d1db05f75e432bf1187d60e7000063bb7d103088576a7",
29+
},
2330
["0.8.3"] = {
2431
url = {
2532
GLOBAL = "https://github.com/mcpplibs/openkal-opensbi/archive/refs/tags/0.8.3.tar.gz",
@@ -127,6 +134,13 @@ package = {
127134
},
128135
},
129136
macosx = {
137+
["0.9.0"] = {
138+
url = {
139+
GLOBAL = "https://github.com/mcpplibs/openkal-opensbi/archive/refs/tags/0.9.0.tar.gz",
140+
CN = "https://gitcode.com/mcpp-res/openkal-opensbi/releases/download/0.9.0/openkal-opensbi-0.9.0.tar.gz",
141+
},
142+
sha256 = "70bf7414283bb431bf1d1db05f75e432bf1187d60e7000063bb7d103088576a7",
143+
},
130144
["0.8.3"] = {
131145
url = {
132146
GLOBAL = "https://github.com/mcpplibs/openkal-opensbi/archive/refs/tags/0.8.3.tar.gz",
@@ -234,6 +248,13 @@ package = {
234248
},
235249
},
236250
windows = {
251+
["0.9.0"] = {
252+
url = {
253+
GLOBAL = "https://github.com/mcpplibs/openkal-opensbi/archive/refs/tags/0.9.0.tar.gz",
254+
CN = "https://gitcode.com/mcpp-res/openkal-opensbi/releases/download/0.9.0/openkal-opensbi-0.9.0.tar.gz",
255+
},
256+
sha256 = "70bf7414283bb431bf1d1db05f75e432bf1187d60e7000063bb7d103088576a7",
257+
},
237258
["0.8.3"] = {
238259
url = {
239260
GLOBAL = "https://github.com/mcpplibs/openkal-opensbi/archive/refs/tags/0.8.3.tar.gz",

‎pkgs/o/openkal-windows.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ package = {
2121

2222
xpm = {
2323
linux = {
24+
["0.21.0"] = {
25+
url = {
26+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.21.0.tar.gz",
27+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.21.0/openkal-windows-0.21.0.tar.gz",
28+
},
29+
sha256 = "585370e929875f996ec0283695c3d7768ce00f4c126be1c0cbd6d40ef1cc0757",
30+
},
2431
["0.20.0"] = {
2532
url = {
2633
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.20.0.tar.gz",
@@ -254,6 +261,13 @@ package = {
254261
},
255262
},
256263
macosx = {
264+
["0.21.0"] = {
265+
url = {
266+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.21.0.tar.gz",
267+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.21.0/openkal-windows-0.21.0.tar.gz",
268+
},
269+
sha256 = "585370e929875f996ec0283695c3d7768ce00f4c126be1c0cbd6d40ef1cc0757",
270+
},
257271
["0.20.0"] = {
258272
url = {
259273
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.20.0.tar.gz",
@@ -487,6 +501,13 @@ package = {
487501
},
488502
},
489503
windows = {
504+
["0.21.0"] = {
505+
url = {
506+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.21.0.tar.gz",
507+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.21.0/openkal-windows-0.21.0.tar.gz",
508+
},
509+
sha256 = "585370e929875f996ec0283695c3d7768ce00f4c126be1c0cbd6d40ef1cc0757",
510+
},
490511
["0.20.0"] = {
491512
url = {
492513
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.20.0.tar.gz",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# openkal-kit test project: the facilities composed from openkal's interfaces,
2+
# consumed as a program consumes them --- the kit, the specification it is
3+
# written against, and the implementation for this system. The observation is
4+
# of behaviour (tests/kit.cpp): an endpoint is parsed and written back, and a
5+
# malformed one is refused.
6+
[package]
7+
name = "openkal-kit-tests"
8+
version = "0.1.0"
9+
10+
[dependencies.mcpplibs]
11+
openkal = "0.25.0"
12+
openkal-kit = "0.3.0"
13+
14+
[target.'cfg(os = "linux")'.dependencies.mcpplibs]
15+
openkal-linux = "0.26.0"
16+
17+
[target.'cfg(os = "macos")'.dependencies.mcpplibs]
18+
openkal-macos = "0.23.0"
19+
20+
[target.'cfg(windows)'.dependencies.mcpplibs]
21+
openkal-windows = "0.21.0"
22+
23+
# This member names mcpplibs packages, which the workspace root's single
24+
# redirect does not carry, so it states its own.
25+
[indices]
26+
mcpplibs = { path = "../../.." }
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// openkal-kit through the index: an endpoint parsed, written back and refused
2+
// when malformed, which is the kit's behaviour and not only its declarations.
3+
#include <cstdio>
4+
#include <cstring>
5+
import openkal.types;
6+
import openkal.kit.endpoint;
7+
8+
int main() {
9+
using namespace kal::kit;
10+
int failures = 0;
11+
auto check = [&](bool held, const char* what) {
12+
if (!held) { std::printf("FAIL: %s\n", what); ++failures; }
13+
};
14+
const auto r = parse_v4("127.0.0.1:443", 13);
15+
check(r.ok && r.ep.addr_len == 4 && r.ep.port == 443, "an address with a port parses");
16+
char out[32];
17+
const auto f = format_v4(r.ep, out, sizeof out);
18+
check(f.ok && f.n == 13 && std::memcmp(out, "127.0.0.1:443", 13) == 0,
19+
"and is written back as it was given");
20+
check(!parse_v4("256.0.0.1", 9).ok, "an octet past 255 is refused");
21+
check(!parse_v4("1.2.3", 5).ok, "three octets are refused");
22+
if (failures == 0) std::printf("openkal-kit: an endpoint parsed, written back and refused\n");
23+
return failures == 0 ? 0 : 1;
24+
}

‎tests/examples/openkal/mcpp.toml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ name = "openkal-tests"
1818
version = "0.1.0"
1919

2020
[dependencies.mcpplibs]
21-
openkal = "0.24.0"
21+
openkal = "0.25.0"
2222

2323
[target.'cfg(os = "linux")'.dependencies.mcpplibs]
24-
openkal-linux = "0.25.0"
24+
openkal-linux = "0.26.0"
2525

2626
[target.'cfg(os = "macos")'.dependencies.mcpplibs]
27-
openkal-macos = "0.22.1"
27+
openkal-macos = "0.23.0"
2828

2929
[target.'cfg(windows)'.dependencies.mcpplibs]
30-
openkal-windows = "0.20.0"
30+
openkal-windows = "0.21.0"
3131

3232
[target.'cfg(all(os = "linux", env = "musl"))'.dependencies.mcpplibs]
3333
openkal-llvm-runtime = "0.19.2"
3434

3535
[target.'cfg(arch = "wasm32")'.dependencies.mcpplibs]
36-
openkal-emscripten = "0.13.0"
36+
openkal-emscripten = "0.14.0"
3737

3838
[target.'cfg(arch = "riscv64")'.dependencies.mcpplibs]
39-
openkal-opensbi = "0.8.3"
39+
openkal-opensbi = "0.9.0"
4040

4141
# This member names mcpplibs packages, which the workspace root's single
4242
# redirect does not carry, so it states its own (mcpp.toml at the root says why

‎tests/examples/openkal/tests/kal.cpp‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
// (0.22) the null device beside a stream at one position is refused, and is
1818
// refused as unsupported where the implementation does not state it; (0.23) a
1919
// region at an address, zero; a read-only attenuation; the machine's memory
20-
// and the resource preference.
20+
// and the resource preference; (0.25) where the volume states it, a second name
21+
// for a file reads as the first, and a name that is taken is refused.
2122
// The terminal is not observed here,
2223
// because a test run has none; the implementations observe it on a terminal
2324
// they make.
@@ -109,6 +110,25 @@ int main() {
109110
kal_fs_remove(root, "okt.a", 5);
110111
kal_fs_remove(root, "okt.b", 5);
111112
}
113+
if (root.h && (kal_fs_props(root) & KAL_FS_PROP_HARD_LINKS) != 0) {
114+
kal_file f{};
115+
if (kal_fs_open(root, "okt.h", 5, KAL_OPEN_WRITE | KAL_OPEN_CREATE | KAL_OPEN_TRUNCATE, &f) == kal_ok) {
116+
kal_stream_write(kal_fs_stream(f), "linked", 6);
117+
kal_fs_close_file(f);
118+
}
119+
check(kal_fs_hard_link(root, "okt.h", 5, root, "okt.l", 5) == kal_ok, "a file is given a second name");
120+
char b[8] = {};
121+
kal_file g{};
122+
if (kal_fs_open(root, "okt.l", 5, KAL_OPEN_READ, &g) == kal_ok) {
123+
check(kal_stream_read(kal_fs_stream(g), b, sizeof b) == 6 && b[0] == 'l' && b[5] == 'd',
124+
"and the second name reads as the first");
125+
kal_fs_close_file(g);
126+
}
127+
check(kal_fs_hard_link(root, "okt.h", 5, root, "okt.l", 5) == kal_err_exists,
128+
"a second name that is taken is refused");
129+
kal_fs_remove(root, "okt.l", 5);
130+
kal_fs_remove(root, "okt.h", 5);
131+
}
112132

113133
if ((kal_process_props() & KAL_PROCESS_PROP_ONE_STRING) == 0 && root.h) {
114134
// Where a program receives a vector, a joined command line has no

0 commit comments

Comments
 (0)