@@ -5,7 +5,8 @@ following the Bazel-first approach instead of using shell scripts or wit-deps to
55
66Provides WASI versions:
77- 0.2.0 (maximum compatibility with older toolchains)
8- - 0.2.3 (default - stable release with versioned dependencies)
8+ - 0.2.3 (default - stable release, used by wasi-sdk 26/27)
9+ - 0.2.6 (used by wasi-sdk 29)
910- 0.2.8 (latest stable - newest features)
1011
1112See docs-site/src/content/docs/guides/external-wit-dependencies.mdx for usage guide.
@@ -19,7 +20,7 @@ def wasi_wit_dependencies():
1920 This follows the Bazel-native approach by using http_archive rules
2021 instead of shell scripts or external dependency management tools.
2122
22- Provides WASI 0.2.0, 0.2.3, and 0.2.8 versions with correct dependency chains.
23+ Provides WASI 0.2.0, 0.2.3, 0.2.6, and 0.2.8 versions with correct dependency chains.
2324 """
2425
2526 # ========================================================================
@@ -303,6 +304,154 @@ wit_library(
303304""" ,
304305 )
305306
307+ # ========================================================================
308+ # WASI 0.2.6 (Used by wasi-sdk 29)
309+ # ========================================================================
310+
311+ # WASI IO interfaces v0.2.6
312+ http_archive (
313+ name = "wasi_io_v026" ,
314+ urls = ["https://github.com/WebAssembly/wasi-io/archive/refs/tags/v0.2.6.tar.gz" ],
315+ sha256 = "e3cb3c21d7c49219e885b4564f2dd34beec7403062749c35d73c016043ad6c95" ,
316+ strip_prefix = "wasi-io-0.2.6" ,
317+ build_file_content = """
318+ load("@rules_wasm_component//wit:defs.bzl", "wit_library")
319+
320+ wit_library(
321+ name = "streams",
322+ srcs = glob(["wit/*.wit"]),
323+ package_name = "wasi:io@0.2.6",
324+ interfaces = ["error", "poll", "streams"],
325+ visibility = ["//visibility:public"],
326+ )
327+ """ ,
328+ )
329+
330+ # WASI CLI interfaces v0.2.6
331+ http_archive (
332+ name = "wasi_cli_v026" ,
333+ urls = ["https://github.com/WebAssembly/wasi-cli/archive/refs/tags/v0.2.6.tar.gz" ],
334+ sha256 = "91fa27b6f83c0199e2fe7912d770609871d350b5242edf44bbdc3fbf17e3e1aa" ,
335+ strip_prefix = "wasi-cli-0.2.6" ,
336+ build_file_content = """
337+ load("@rules_wasm_component//wit:defs.bzl", "wit_library")
338+
339+ wit_library(
340+ name = "cli",
341+ srcs = glob(["wit/*.wit"]),
342+ package_name = "wasi:cli@0.2.6",
343+ interfaces = ["environment", "exit", "stdin", "stdout", "stderr", "terminal-input", "terminal-output", "terminal-stdin", "terminal-stdout", "terminal-stderr"],
344+ deps = ["@wasi_io_v026//:streams"],
345+ visibility = ["//visibility:public"],
346+ )
347+ """ ,
348+ )
349+
350+ # WASI Clocks interfaces v0.2.6
351+ http_archive (
352+ name = "wasi_clocks_v026" ,
353+ urls = ["https://github.com/WebAssembly/wasi-clocks/archive/refs/tags/v0.2.6.tar.gz" ],
354+ sha256 = "771f45e21ba86d4cfefc4e3e1348059bc6d3f95400728feaa4c1c77708f531a6" ,
355+ strip_prefix = "wasi-clocks-0.2.6" ,
356+ build_file_content = """
357+ load("@rules_wasm_component//wit:defs.bzl", "wit_library")
358+
359+ wit_library(
360+ name = "clocks",
361+ srcs = glob(["wit/*.wit"]),
362+ package_name = "wasi:clocks@0.2.6",
363+ interfaces = ["wall-clock", "monotonic-clock"],
364+ deps = ["@wasi_io_v026//:streams"],
365+ visibility = ["//visibility:public"],
366+ )
367+ """ ,
368+ )
369+
370+ # WASI Filesystem interfaces v0.2.6
371+ http_archive (
372+ name = "wasi_filesystem_v026" ,
373+ urls = ["https://github.com/WebAssembly/wasi-filesystem/archive/refs/tags/v0.2.6.tar.gz" ],
374+ sha256 = "5d1d01dad6e873ceaf7c04ab92cf2a1243842b4798680003c44c57216eb65e78" ,
375+ strip_prefix = "wasi-filesystem-0.2.6" ,
376+ build_file_content = """
377+ load("@rules_wasm_component//wit:defs.bzl", "wit_library")
378+
379+ wit_library(
380+ name = "filesystem",
381+ srcs = glob(["wit/*.wit"]),
382+ package_name = "wasi:filesystem@0.2.6",
383+ interfaces = ["types", "preopens"],
384+ deps = ["@wasi_io_v026//:streams", "@wasi_clocks_v026//:clocks"],
385+ visibility = ["//visibility:public"],
386+ )
387+ """ ,
388+ )
389+
390+ # WASI Sockets interfaces v0.2.6
391+ http_archive (
392+ name = "wasi_sockets_v026" ,
393+ urls = ["https://github.com/WebAssembly/wasi-sockets/archive/refs/tags/v0.2.6.tar.gz" ],
394+ sha256 = "ae27539cf51c44d3a3b4ec16a7343ed1d1705c8a2a101b5c78b1be346cf5febc" ,
395+ strip_prefix = "wasi-sockets-0.2.6" ,
396+ build_file_content = """
397+ load("@rules_wasm_component//wit:defs.bzl", "wit_library")
398+
399+ wit_library(
400+ name = "sockets",
401+ srcs = glob(["wit/*.wit"]),
402+ package_name = "wasi:sockets@0.2.6",
403+ interfaces = ["network", "udp", "tcp", "udp-create-socket", "tcp-create-socket", "instance-network", "ip-name-lookup"],
404+ deps = ["@wasi_io_v026//:streams", "@wasi_clocks_v026//:clocks"],
405+ visibility = ["//visibility:public"],
406+ )
407+ """ ,
408+ )
409+
410+ # WASI Random interfaces v0.2.6
411+ http_archive (
412+ name = "wasi_random_v026" ,
413+ urls = ["https://github.com/WebAssembly/wasi-random/archive/refs/tags/v0.2.6.tar.gz" ],
414+ sha256 = "91c68fb6b22de83b9bdcd775b489086febeaa07bb95fd609b48e6a9dc5b46583" ,
415+ strip_prefix = "wasi-random-0.2.6" ,
416+ build_file_content = """
417+ load("@rules_wasm_component//wit:defs.bzl", "wit_library")
418+
419+ wit_library(
420+ name = "random",
421+ srcs = glob(["wit/*.wit"]),
422+ package_name = "wasi:random@0.2.6",
423+ interfaces = ["random", "insecure", "insecure-seed"],
424+ visibility = ["//visibility:public"],
425+ )
426+ """ ,
427+ )
428+
429+ # WASI HTTP interfaces v0.2.6
430+ http_archive (
431+ name = "wasi_http_v026" ,
432+ urls = ["https://github.com/WebAssembly/wasi-http/archive/refs/tags/v0.2.6.tar.gz" ],
433+ sha256 = "d65e9b04faa28333fb008a1e89e5ee704474007b36e7c798f5fbb27025ce9ddc" ,
434+ strip_prefix = "wasi-http-0.2.6" ,
435+ build_file_content = """
436+ load("@rules_wasm_component//wit:defs.bzl", "wit_library")
437+
438+ wit_library(
439+ name = "http",
440+ srcs = glob(["wit/*.wit"]),
441+ package_name = "wasi:http@0.2.6",
442+ interfaces = ["types", "incoming-handler", "outgoing-handler"],
443+ world = "proxy",
444+ deps = [
445+ "@wasi_io_v026//:streams",
446+ "@wasi_clocks_v026//:clocks",
447+ "@wasi_cli_v026//:cli",
448+ "@wasi_random_v026//:random",
449+ ],
450+ visibility = ["//visibility:public"],
451+ )
452+ """ ,
453+ )
454+
306455 # ========================================================================
307456 # WASI 0.2.8 (Latest stable release)
308457 # ========================================================================
0 commit comments