Comments (4)
The main issue is that skylark starlark rules do not allow one to "work" outside the package they are defined in. So, when you ctx.action.declare_file
, any file you create must within that package, which has the downstream ramifications you observe. Without having reviewed the specific implementation of the native rules, I don't think they have this restriction.
Arguably the "best" way to accomplish proto compilation is via an aspect-based implementation (which may solve the aforementioned issue), but doing that in a generic way for multiple languages is not trivial.
In any case, I agree the paths for generated protos can get confusing and problematic.
from rules_proto.
Hi @pcj:
Thanks for the response! I researched and experimented a little bit more and reached the same point (root cause and solution) you brought up. I am happy that problem is ACK'ed and the root problem is thoroughly exposed. Will work around this issue by copying .proto
files around for now.
I believe that the Bazel built-in {cc,java}_proto_library
rules use an aspect-based approach. This belief came from this blog post. Though that blog post (2017/02/27) was pretty old by now (2018/12/20).
I am very interested in 'doing that (the aspect way) in a generic way for multiple languages is not trivial' you mentioned. I know it could be hard and a little far fetching, but would you like to shed more light on the difficulties that you can envision?
from rules_proto.
OK I have an initial working aspect-based implementation on the "aspect" branch. It still makes my brain hurt, and the code is in complete chaos but you're welcome to try it out.
It works well for dynamic languages like python but will make rules like cpp_proto_library implementations quite difficult.
https://github.com/stackb/rules_proto/tree/aspect
from rules_proto.
Thanks for the response. I won't have time to try it out right at the moment. But I will keep an eye on this and try to get this to work when I get some time.
Thanks for everything. Closing for now.
from rules_proto.
Related Issues (20)
- grpc server reflection failed in golang HOT 1
- WorkspaceSnippet is ignored in deps gen HOT 2
- Migrate to new rules_js/aspect_rules_ts? HOT 3
- rules_proto & rules_go problems / general dependency problems HOT 1
- checksum changed for `rules_proto` and dependencies HOT 1
- question: could you pinpoint the protoc version of this repository compared to bazelbuild/rules_proto? HOT 1
- bzlmod support HOT 4
- No such package '@com_github_grpc_grpc// HOT 1
- Bad syntax for proto_repository_tools_srcs.bzl HOT 3
- Publish a new release? HOT 2
- Support for rules_go 0.41.0 and gazelle 0.32.0
- proto_gazelle is not gathering up all data for runfiles
- fatal error: concurrent map read and map write HOT 4
- proto_compile_assets not working when strip_import_prefix is used HOT 3
- imports calculation for proto_py_library is broken
- Document starlark API better
- gazelle <0.35 no longer supported HOT 2
- error loading package '@build_stack_rules_proto//': cannot load '//rules:proto_gazelle.bzl' HOT 2
- Support linux arm64 prebuilt protoc
- Importing a proto_py_library fails to resolve with gazelle HOT 1
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 rules_proto.