diff --git a/hole-punch-interop/Makefile b/hole-punch-interop/Makefile index b88717757..787e23184 100644 --- a/hole-punch-interop/Makefile +++ b/hole-punch-interop/Makefile @@ -1,19 +1,27 @@ RUST_SUBDIRS := $(wildcard impl/rust/*/.) GO_SUBDIRS := $(wildcard impl/go/*/.) +NIM_SUBDIRS := $(wildcard impl/nim/*/.) + +# Combine all sub-directory lists into a single list +ALL_SUBDIRS := $(RUST_SUBDIRS) $(GO_SUBDIRS) $(NIM_SUBDIRS) + +all: rust-relay router $(ALL_SUBDIRS) -all: rust-relay router $(RUST_SUBDIRS) $(GO_SUBDIRS) rust-relay: $(MAKE) -C rust-relay + router: $(MAKE) -C router -$(RUST_SUBDIRS): - $(MAKE) -C $@ -$(GO_SUBDIRS): + +$(ALL_SUBDIRS): $(MAKE) -C $@ + clean: $(MAKE) -C rust-relay clean $(MAKE) -C router clean - $(MAKE) -C $(RUST_SUBDIRS) clean - $(MAKE) -C $(GO_SUBDIRS) clean + for dir in $(ALL_SUBDIRS); do \ + $(MAKE) -C $$dir clean; \ + done + +.PHONY: rust-relay router all $(ALL_SUBDIRS) -.PHONY: rust-relay router all $(RUST_SUBDIRS) $(GO_SUBDIRS) diff --git a/hole-punch-interop/impl/nim/.gitignore b/hole-punch-interop/impl/nim/.gitignore new file mode 100644 index 000000000..c3a35de68 --- /dev/null +++ b/hole-punch-interop/impl/nim/.gitignore @@ -0,0 +1,6 @@ +nim-libp2p-*.zip +nim-libp2p-* +nim-libp2p +nim-libp2p-*/* +image.json +hole_punching.nim diff --git a/hole-punch-interop/impl/nim/v1.1/Makefile b/hole-punch-interop/impl/nim/v1.1/Makefile new file mode 100644 index 000000000..220078b2d --- /dev/null +++ b/hole-punch-interop/impl/nim/v1.1/Makefile @@ -0,0 +1,21 @@ +image_name := nim-v1.1 +commitSha := 93925ac28b04cd94d06a332412973e90f80f35df + +all: image.json + +image.json: nim-libp2p-${commitSha} + cd nim-libp2p-${commitSha} && IMAGE_NAME=${image_name} ../../../../dockerBuildWrapper.sh -f tests/hole-punching-interop/Dockerfile . + docker image inspect ${image_name} -f "{{.Id}}" | \ + xargs -I {} echo "{\"imageID\": \"{}\"}" > $@ + +nim-libp2p-${commitSha}: nim-libp2p-${commitSha}.zip + unzip -o nim-libp2p-${commitSha}.zip + +nim-libp2p-${commitSha}.zip: + wget -O $@ "https://github.com/status-im/nim-libp2p/archive/${commitSha}.zip" + +clean: + rm -f image.json + rm -rf nim-libp2p* + +.PHONY: all clean diff --git a/hole-punch-interop/impl/rust/v0.53/Makefile b/hole-punch-interop/impl/rust/v0.53/Makefile index 500107636..240b14a92 100644 --- a/hole-punch-interop/impl/rust/v0.53/Makefile +++ b/hole-punch-interop/impl/rust/v0.53/Makefile @@ -15,6 +15,6 @@ rust-libp2p-${commitSha}.zip: wget -O $@ "https://github.com/libp2p/rust-libp2p/archive/${commitSha}.zip" clean: - rm image.json - rm rust-libp2p-*.zip + rm -f image.json + rm -f rust-libp2p-*.zip rm -rf rust-libp2p-* diff --git a/hole-punch-interop/router/Makefile b/hole-punch-interop/router/Makefile index 3117f4b4f..8dc2128fb 100644 --- a/hole-punch-interop/router/Makefile +++ b/hole-punch-interop/router/Makefile @@ -7,4 +7,4 @@ image.json: Dockerfile run.sh docker image inspect ${image_name} -f "{{.Id}}" | \ xargs -I {} echo "{\"imageID\": \"{}\"}" > $@ clean: - rm image.json + rm -f image.json diff --git a/hole-punch-interop/rust-relay/Makefile b/hole-punch-interop/rust-relay/Makefile index fd6c21ac8..f30c89832 100644 --- a/hole-punch-interop/rust-relay/Makefile +++ b/hole-punch-interop/rust-relay/Makefile @@ -7,4 +7,4 @@ image.json: Cargo.lock src/** Dockerfile docker image inspect ${image_name} -f "{{.Id}}" | \ xargs -I {} echo "{\"imageID\": \"{}\"}" > $@ clean: - rm image.json + rm -f image.json diff --git a/hole-punch-interop/versions.ts b/hole-punch-interop/versions.ts index 9d35b6de9..82533e09b 100644 --- a/hole-punch-interop/versions.ts +++ b/hole-punch-interop/versions.ts @@ -13,6 +13,10 @@ export const versions: Array = [ id: "rust-v0.53", transports: ["tcp", "quic"] } as Version, + { + id: "nim-v1.1", + transports: ["tcp"], + }, ].map((v: Version) => (typeof v.containerImageID === "undefined" ? ({ ...v, containerImageID: readImageId(canonicalImagePath(v.id)) }) : v)) function readImageId(path: string): string {