-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the generated *.capnp.go and structs.gen.go files in go/proto to version control. This intends to simplify the build process when using the go toolchain, especially for go projects that consume scion as a library. Add make target 'gogen' to update the generated files in go/proto. Use new bazel pkg_tar rule 'build-tools' to compile canpnpc-go for generating the *.capnpc.go files. Add CI check for generated go/proto files; detect uncommitted changes to generated go/proto files by cleaning and regenerating the files.
- Loading branch information
Showing
28 changed files
with
9,806 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM scion:latest | ||
COPY bazelrc.quiet ~/.bazelrc | ||
RUN make -s all setcap && bazel clean | ||
RUN make -s GOGEN_SKIP=1 all setcap && bazel clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.PHONY: all capnp | ||
|
||
PROTO_DIR := ../../proto | ||
SRCS := $(wildcard $(PROTO_DIR)/*.capnp) | ||
SRCS := $(filter-out $(PROTO_DIR)/go.capnp, $(SRCS)) | ||
|
||
all: capnp structs.gen.go | ||
|
||
capnp: | ||
set -eu; \ | ||
TMPDIR=$$(mktemp -d -t scion-build-tools.XXXXXXXXXX); \ | ||
bazel build //:build-tools; \ | ||
tar -xf ../../bazel-bin/build-tools.tar -C $$TMPDIR; \ | ||
rm -f *.capnp.go; \ | ||
capnp compile --verbose -o$$TMPDIR/capnpc-go --src-prefix $(PROTO_DIR) $(SRCS); \ | ||
rm -rf $$TMPDIR | ||
|
||
structs.gen.go: structs_gen_go.sh | ||
./structs_gen_go.sh > structs.gen.go |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.