Comments (6)
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.
@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.
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.
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.
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.
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)
- Move the cost estimator back into cel-go from Kubernetes
- Registering custom type casts with CEL env HOT 3
- Return unknown parameters despite the expression being evaluable HOT 1
- Document CEL Cost Limit Evaluation
- Unable to run codelab HOT 3
- Variable Keys in Struct Literals
- Testing timestamppb fields against null HOT 1
- Issue importing github.com/google/cel-go HOT 3
- Is it possible to define a getter? HOT 2
- OSS-Fuzz issue 65461 HOT 1
- Exposing Default CEL checker.CostEstimator and interpreter.ActualCostEstimator HOT 2
- Concurrent map read/write in `common/ast/expr.go` HOT 5
- Ability to natively deal with types derived from go scalar types
- Native types: Allow adding a type including all its nested subtypes HOT 1
- Non-public bazel visibility for common/ast HOT 2
- Can we allow users to disable specific functions in Checker? HOT 2
- Estimated size information lost when `.map()` result is chained HOT 7
- Constrain acceptable any values HOT 2
- Has macro returns no such key error HOT 1
- document cel.Constant environment option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cel-go.