Git Product home page Git Product logo

Comments (6)

TristonianJones avatar TristonianJones commented on May 7, 2024

Hi there, we actually use Bazel for our builds to help resolve protobuf dependencies / codegen from the cel-spec repo. Once Bazel is installed, you can build the project from the root directory using: bazel build ...

Let me know if that helps. An alternative would be to check in all of the generated dependencies into a vendor folder, but the current setup helps us retain parity between internal and open source tooling.

from cel-go.

michilu avatar michilu commented on May 7, 2024

@TristonianJones
Which files should I copy into the vendor directory?

$ bazel build ...
$ find bazel-bin/ -name "*.pb.go" -print
bazel-bin//test/darwin_amd64_stripped/test_all_types_go_proto~/github.com/google/cel-go/test/test_all_types.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/field_mask_go_proto~/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/empty_go_proto~/github.com/golang/protobuf/ptypes/empty/empty.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/compiler_plugin_go_proto~/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/struct_go_proto~/github.com/golang/protobuf/ptypes/struct/struct.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/wrappers_go_proto~/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/api_go_proto~/github.com/golang/protobuf/ptypes/api/api.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/type_go_proto~/google.golang.org/genproto/protobuf/ptype/type.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/descriptor_go_proto~/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/timestamp_go_proto~/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/any_go_proto~/github.com/golang/protobuf/ptypes/any/any.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/source_context_go_proto~/google.golang.org/genproto/protobuf/source_context/source_context.pb.go
bazel-bin//external/io_bazel_rules_go/proto/wkt/darwin_amd64_stripped/duration_go_proto~/github.com/golang/protobuf/ptypes/duration/duration.pb.go
bazel-bin//external/com_google_cel_spec/proto/v1/darwin_amd64_stripped/syntax_go_proto~/github.com/google/cel-spec/proto/v1/syntax/syntax.pb.go
bazel-bin//external/com_google_cel_spec/proto/v1/darwin_amd64_stripped/cel_service_go_proto~/github.com/google/cel-spec/proto/v1/cel_service/cel-service.pb.go
bazel-bin//external/com_google_cel_spec/proto/v1/darwin_amd64_stripped/eval_go_proto~/github.com/google/cel-spec/proto/v1/eval/eval.pb.go
bazel-bin//external/com_google_cel_spec/proto/v1/darwin_amd64_stripped/value_go_proto~/github.com/google/cel-spec/proto/v1/value/value.pb.go
bazel-bin//external/com_google_cel_spec/proto/checked/v1/darwin_amd64_stripped/checked_go_proto~/github.com/google/cel-spec/proto/checked/v1/checked/checked.pb.go
bazel-bin//external/com_google_googleapis/darwin_amd64_stripped/rpc_status_go_proto~/github.com/googleapis/googleapis/google/rpc/status.pb.go

I think so well if helper tool for relocating *.pb.go files.

from cel-go.

TristonianJones avatar TristonianJones commented on May 7, 2024

All of the files under google/cel-spec/../*.pb.go files would need to be copied into the vendor directory using the same structure. I'm not opposed to doing this for the purposes of local development, but not sure this is a change we should check into the main repo.

from cel-go.

michilu avatar michilu commented on May 7, 2024

I tried to copy files. go build works well.
The minimum files are:

vendor/github.com/google/cel-spec/proto/checked/v1/checked/checked.pb.go
vendor/github.com/google/cel-spec/proto/v1/cel_service/cel-service.pb.go
vendor/github.com/google/cel-spec/proto/v1/eval/eval.pb.go
vendor/github.com/google/cel-spec/proto/v1/syntax/syntax.pb.go
vendor/github.com/google/cel-spec/proto/v1/value/value.pb.go
vendor/github.com/googleapis/googleapis/google/rpc/status.pb.go

from cel-go.

TristonianJones avatar TristonianJones commented on May 7, 2024

Great, thanks for mentioning what you found. If you want to check in the vendor files, would you mind adding a sh_binary to the top-level BUILD.bazel to copy the generated source?

from cel-go.

michilu avatar michilu commented on May 7, 2024

Thank you for your information.
I think to want to no get errors when go get. So I will host a git repository includes pb.go files that built by the Bazel.

I will be writing a tool that copies from the bazel-bin directory to the GOPATH. Maybe able to sets the tool to sh_binary on BUILD.bazel.

from cel-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.