Bring back zig-libp2p (#172)

* Revert "Revert "Add zig-libp2p to interop tester (#167)" (#170)"

This reverts commit 3856de32fc.

* Print CPU info during make of zig-libp2p

* Show stdout output

* Use image id from json file

* Update zig-libp2p to log why a connection was shutdown

* Update zig to play nice with rust mss
This commit is contained in:
Marco Munizaga 2023-05-01 09:04:44 -07:00 committed by GitHub
parent d17c40e4e8
commit f0c82d3d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 4 deletions

View File

@ -2,8 +2,9 @@ GO_SUBDIRS := $(wildcard impl/go/*/.)
JS_SUBDIRS := $(wildcard impl/js/*/.)
RUST_SUBDIRS := $(wildcard impl/rust/*/.)
NIM_SUBDIRS := $(wildcard impl/nim/*/.)
ZIG_SUBDIRS := $(wildcard impl/zig/*/.)
all: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS)
all: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS)
$(JS_SUBDIRS):
$(MAKE) -C $@
$(GO_SUBDIRS):
@ -12,6 +13,8 @@ $(RUST_SUBDIRS):
$(MAKE) -C $@
$(NIM_SUBDIRS):
$(MAKE) -C $@
$(ZIG_SUBDIRS):
$(MAKE) -C $@
.PHONY: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) all
.PHONY: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS) all

View File

@ -106,10 +106,10 @@ switch (modeStr) {
console.log("Building any remaining things from image.json")
// We're building using -o image.json. This tells make to
// not bother building image.json or anything it depends on.
child_process.execSync(`make -o image.json`, { cwd: implFolder })
child_process.execSync(`make -o image.json`, { cwd: implFolder, stdio: 'inherit' })
} else {
console.log("No cache, building from scratch")
child_process.execSync(`make`, { cwd: implFolder })
child_process.execSync(`make`, { cwd: implFolder, stdio: "inherit" })
}
}
}

1
multidim-interop/impl/zig/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
zig-libp2p-*

View File

@ -0,0 +1,19 @@
image_name := zig-v0.0.1
commitSha := d6c7afe0d02bf8a314547acdf0483653a9b84bea
all: image.json print-cpu-info
print-cpu-info: image.json
docker run --rm --entrypoint /app/zig/bin/zig $$(jq -r .imageID image.json) build-exe --show-builtin
image.json:
wget -O zig-libp2p-${commitSha}.zip "https://github.com/marcopolo/zig-libp2p/archive/${commitSha}.zip"
unzip -o zig-libp2p-${commitSha}.zip
cd zig-libp2p-${commitSha} && docker build -t ${image_name} -f interop/Dockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
clean:
rm -rf image.json zig-libp2p-*.zip zig-libp2p-*
.PHONY: all clean print-cpu-info

View File

@ -11,6 +11,7 @@ import jsV042 from "./impl/js/v0.42/node-image.json"
import nimv10 from "./impl/nim/v1.0/image.json"
import chromiumJsV041 from "./impl/js/v0.41/chromium-image.json"
import chromiumJsV042 from "./impl/js/v0.42/chromium-image.json"
import zigv001 from "./impl/zig/v0.0.1/image.json"
export type Version = {
id: string,
@ -114,4 +115,11 @@ export const versions: Array<Version> = [
secureChannels: ["noise"],
muxers: ["mplex", "yamux"],
},
{
id: "zig-v0.0.1",
containerImageID: zigv001.imageID,
transports: ["quic-v1"],
secureChannels: [],
muxers: [],
},
]