Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ COVERAGE_PATH := $(BUILD_PATH)/coverage

PROTOBUF_VERSION = 3.20.1
PROTO_SOURCES = $(shell find pkg -name '*.proto' | grep -v /vendor/)
PROTO_GOFILES = $(patsubst %.proto,%.pb.go,$(PROTO_SOURCES))
PROTO_INCLUDE = -I $(PWD) -I$(PROTOC_PATH)/include
PROTO_OPTIONS = --proto_path=. $(PROTO_INCLUDE) \
--go_opt=paths=source_relative --go_out=. \
Expand Down Expand Up @@ -80,14 +79,11 @@ FORCE:
# build targets
#

build-proto: check-protoc install-ttrpc-plugin install-wasm-plugin install-protoc-dependencies $(PROTO_GOFILES)

.PHONY: build-proto-dockerized
build-proto-dockerized:
$(Q)docker build --build-arg ARTIFACTS="$(dir $(PROTO_GOFILES))" --target final \
--output type=local,dest=$(RESOLVED_PWD) \
-f hack/Dockerfile.buildproto .
$(Q)tar xf artifacts.tgz && rm -f artifacts.tgz
Comment on lines -86 to -90
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we keep a target to allow building on non-Linux machines? Don't think the native target works on macOS currently:

arm64)
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-aarch_64.zip"
unzip "$PROTOBUF_DIR/protobuf" -d "$INSTALL_DIR"
;;
amd64|386)
if [ "$GOOS" = windows ]; then
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-win32.zip"
elif [ "$GOOS" = linux ]; then
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip"
fi
unzip -o "$PROTOBUF_DIR/protobuf" -d "$INSTALL_DIR"
;;
ppc64le)
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-ppcle_64.zip"
unzip -o "$PROTOBUF_DIR/protobuf" -d "$INSTALL_DIR"
;;
*)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mm, true. Maybe we should keep it. I just need to fix it (I think). WDYT @klihub

Copy link
Member

@thaJeztah thaJeztah Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my comment was a bit short (it was late 😂)

Yeah, these are tricky; I think the changes to install the tools locally were at least are good; there's various projects that require you to either "have the tools installed" already, or "figure out how to install", which may result in having to install different (system-wide) versions of the tools, which is a big pain if you happen to be jumping between various such projects for contributions 😅

Then again, depending on the situation, having a containerized option available is good as well, as sometimes the (version of) tools to install can differ between branches for the same project, so having an option to generate code without tools lingering around on your system ... is really great to have.

build-proto: check-protoc install-ttrpc-plugin install-wasm-plugin install-protoc-dependencies
for src in $(PROTO_SOURCES); do \
$(PROTO_COMPILE) $$src; \
done
sed -i '1s;^;//go:build !wasip1\n\n;' pkg/api/api_ttrpc.pb.go

build-plugins: $(PLUGINS)

Expand Down Expand Up @@ -176,15 +172,6 @@ validate-repo-no-changes:
exit 1; \
}

#
# proto generation targets
#

%.pb.go: %.proto
$(Q)echo "Generating $@..."; \
$(PROTO_COMPILE) $<
sed -i '1s;^;//go:build !wasip1\n\n;' pkg/api/api_ttrpc.pb.go

#
# targets for installing dependencies
#
Expand Down
36 changes: 0 additions & 36 deletions hack/Dockerfile.buildproto

This file was deleted.

Loading