Skip to content

Commit f6f8d03

Browse files
committed
Drop tinygo requirement
Signed-off-by: Sascha Grunert <sgrunert@redhat.com> Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com> Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
1 parent 36baf63 commit f6f8d03

File tree

30 files changed

+83
-99
lines changed

30 files changed

+83
-99
lines changed

.github/actions/install-go/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: "Reusable action to install Go, so there is one place to bump Go ve
33
inputs:
44
go-version:
55
required: true
6-
default: "1.23.9"
6+
default: "1.24.3"
77
description: "Go version to install"
88

99
runs:

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
- uses: ./.github/actions/install-go
4343

4444
# needed for wasm plugins
45-
- uses: acifani/setup-tinygo@v2
45+
- uses: actions/setup-go@v5
4646
with:
47-
tinygo-version: "0.34.0"
47+
go-version-file: go.mod
4848

4949
- name: Set env
5050
shell: bash
@@ -74,7 +74,7 @@ jobs:
7474

7575
strategy:
7676
matrix:
77-
go-version: ["1.23.9", "1.24.3"]
77+
go-version: ["1.24.3"]
7878
os: [ubuntu-22.04]
7979

8080
steps:
@@ -99,7 +99,7 @@ jobs:
9999

100100
strategy:
101101
matrix:
102-
go-version: ["1.23.9", "1.24.3"]
102+
go-version: ["1.24.3"]
103103

104104
steps:
105105
- uses: actions/checkout@v4

.github/workflows/codeql.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ jobs:
2929

3030
- uses: actions/setup-go@v5
3131
with:
32-
go-version: 1.23.x
33-
34-
- uses: acifani/setup-tinygo@v2
35-
with:
36-
tinygo-version: "0.34.0"
32+
go-version-file: go.mod
3733

3834
- name: Initialize CodeQL
3935
uses: github/codeql-action/init@v2
4036

37+
- name: Install protoc and plugins
38+
run: |
39+
sudo make install-protoc
40+
make install-protoc-dependencies install-ttrpc-plugin install-wasm-plugin
41+
4142
- run: make
4243

4344
- name: Perform CodeQL Analysis

Makefile

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ GO_MODULES := $(shell $(GO_CMD) list ./...)
3434
GOLANG_CILINT := golangci-lint
3535
GINKGO := ginkgo
3636

37-
TINYGO_CMD := tinygo
38-
TINYGO_BUILD := $(TINYGO_CMD) build -scheduler=none -target=wasi -no-debug
39-
TINYGO_DOCKER ?= 0
40-
# Keep the tinygo version in sync with .github/workflows/ci.yml
41-
tinygo-docker-build = \
42-
echo "Docker-tinygo-building $(1)..."; \
43-
docker run --rm -v $(RESOLVED_PWD):$(RESOLVED_PWD) tinygo/tinygo:0.34.0 \
44-
/bin/bash -c "cd $(RESOLVED_PWD); make TINYGO_DOCKER=0 $(1)"
45-
4637
RESOLVED_PWD := $(shell realpath $(shell pwd))
4738
BUILD_PATH := $(RESOLVED_PWD)/build
4839
BIN_PATH := $(BUILD_PATH)/bin
@@ -134,17 +125,10 @@ $(BIN_PATH)/template: $(wildcard plugins/template/*.go)
134125
$(Q)echo "Building $@..."; \
135126
cd $(dir $<) && $(GO_BUILD) -o $@ .
136127

137-
ifneq ($(TINYGO_DOCKER),1)
138128
$(BIN_PATH)/wasm: $(wildcard plugins/wasm/*.go)
139129
$(Q)echo "Building $@..."; \
140130
mkdir -p $(BIN_PATH) && \
141-
cd $(dir $<) && $(TINYGO_BUILD) -o $@ .
142-
else
143-
$(BIN_PATH)/wasm: $(wildcard plugins/wasm/*.go)
144-
$(Q)echo "Building $@..."; \
145-
mkdir -p $(BIN_PATH) && \
146-
$(call tinygo-docker-build,$@)
147-
endif
131+
cd $(dir $<) && GOOS=wasip1 GOARCH=wasm $(GO_BUILD) -o $@ -buildmode=c-shared .
148132

149133
#
150134
# test targets
@@ -208,7 +192,7 @@ validate-repo-no-changes:
208192
%.pb.go: %.proto
209193
$(Q)echo "Generating $@..."; \
210194
$(PROTO_COMPILE) $<
211-
sed -i '1s;^;//go:build !tinygo.wasm\n\n;' pkg/api/api_ttrpc.pb.go
195+
sed -i '1s;^;//go:build !wasip1\n\n;' pkg/api/api_ttrpc.pb.go
212196

213197
#
214198
# targets for installing dependencies
@@ -221,7 +205,7 @@ install-ttrpc-plugin:
221205
$(Q)$(GO_INSTALL) -mod=mod github.com/containerd/ttrpc/cmd/protoc-gen-go-ttrpc@74421d10189e8c118870d294c9f7f62db2d33ec1
222206

223207
install-wasm-plugin:
224-
$(Q)$(GO_INSTALL) -mod=mod github.com/knqyf263/go-plugin/cmd/protoc-gen-go-plugin@d8d42059d8f1b52968cff7226b7094e5c6a0c342
208+
$(Q)$(GO_INSTALL) -mod=mod github.com/knqyf263/go-plugin/cmd/protoc-gen-go-plugin@$(shell go list -m -f {{.Version}} github.com/knqyf263/go-plugin)
225209

226210
install-protoc-dependencies:
227211
$(Q)$(GO_INSTALL) -mod=mod google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.0

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/containerd/nri
22

3-
go 1.22.0
3+
go 1.24.3
44

55
require (
66
github.com/containerd/ttrpc v1.2.7
77
github.com/google/go-cmp v0.7.0
8-
github.com/knqyf263/go-plugin v0.8.1-0.20240827022226-114c6257e441
8+
github.com/knqyf263/go-plugin v0.9.0
99
github.com/moby/sys/mountinfo v0.6.2
1010
github.com/onsi/ginkgo/v2 v2.19.1
1111
github.com/onsi/gomega v1.34.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/U
2525
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
2626
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
2727
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
28-
github.com/knqyf263/go-plugin v0.8.1-0.20240827022226-114c6257e441 h1:Q/sZeuWkXprbKJSs7AwXryuZKSEL/a8ltC7e7xSspN0=
29-
github.com/knqyf263/go-plugin v0.8.1-0.20240827022226-114c6257e441/go.mod h1:CvCrNDMiKFlAlLFLmcoEfsTROEfNKbEZAMMrwQnLXCM=
28+
github.com/knqyf263/go-plugin v0.9.0 h1:CQs2+lOPIlkZVtcb835ZYDEoyyWJWLbSTWeCs0EwTwI=
29+
github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q=
3030
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
3131
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
3232
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=

pkg/api/api_host.pb.go

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/api_options.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/api_plugin.pb.go

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/api_ttrpc.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)