Commit 78af34f
Cherry-pick proto_lang_toolchain Starlarkfication and proto_common module (bazelbuild#15854)
* Put protoc label to a constant.
Renamed StrictProtoDepsViolationMessage to ProtoConstants and added protoc label there.
PiperOrigin-RevId: 409142099
* Remove proto_lang_toolchain rule's $(PLUGIN_OUT) placeholder and simplify ProtoCompileActionBuilder.
`$(OUT)` placeholder is replaced with `%s` so it can be directly used in addFormatted. This simplifies construction of proto compile action and makes it possible for Starlark version to have the same performance.
github shows no uses of the placeholder: https://github.com/search?q=%22%24%28PLUGIN_OUT%29%22&type=Repositories
PiperOrigin-RevId: 412286743
* Add plugin_format_flag attribute to ProtoLangToolchainRule
This makes it possible to pair it with command_line attribute which could contain dependent data,
for example:
```
proto_lang_toolchain(
name = "j2objc_proto_toolchain",
blacklisted_protos = [],
command_line = "--PLUGIN_j2objc_out=file_dir_mapping,generate_class_mappings:$(OUT)",
+ plugin_format_flag = "--plugin=protoc-gen-PLUGIN_j2objc=%s",
plugin = "//third_party/java/j2objc:proto_plugin",
runtime = "//third_party/java/j2objc:proto_runtime",
visibility = ["//visibility:public"],
)
```
It also retains reference to the flag on proto_lang_toolchain rule and so doesn't cause a memory regression when proto_lang_libraries are Starlarkyfied.
PiperOrigin-RevId: 412287195
* Proxy proto compiler and proto opts over proto_lang_toolchain rule.
This is needed for the proto_common.generate_code function.
This change doesn't modify any of proto_lang_toolchain public attributes.
PiperOrigin-RevId: 437713619
* Extend proto_lang_toolchain rule with progress_message and mnemonic attributes.
This is needed for proto_common.generate_sources function.
Two public attributes are added to proto_lang_toolchain rule. Both have defaults, so no immediate migration of targets is needed.
PiperOrigin-RevId: 437714094
* Starlarkify proto_lang_toolchain and ProtoLangToolchainInfo provider
Added StarlarkProtoLangToolchainTest which uses starlarkified rule for verification.
I've deleted blacklisted_protos and forbidden_protos since they are not needed anymore.
PiperOrigin-RevId: 444223497
* Roll forward of bazelbuild@ae349e9: Export ProtoLangToolchainInfo provider and flip proto_lang_toolchain rule
NEW: I've moved ProtoLangToolchainProvider from providers.bzl file to proto_common.bzl file since proto_common doesn't allow loading other components. I've also deleted providers.bzl file since we don't need it anymore.
Automated rollback of commit 5a6b1a8.
*** Reason for rollback ***
Good to submit since the blocking error has been resolved.
*** Original change description ***
Automated rollback of commit ae349e9.
*** Reason for rollback ***
This CL breaks proto_common.bzl file which seems that can't load providers.bzl file.
*** Original change description ***
Export ProtoLangToolchainInfo provider and flip proto_lang_toolchain rule
I’ve exported ProtoLangToolchainInfo provider from it’s native class by adding two new functions: one that’s creating starlark provider (create function), and the other that’s wrapping the starlark provider as a nat
***
PiperOrigin-RevId: 446401388
* Use data from transitive_proto_sources instead of transitive_sources in proto_lang_toolchain.
The problem with latter is, that transitive_source can contain "renamed" files (in _virtual_includes subdirectory), which doesn't work for the detection that needs original files (ProtoSource.original_source_file).
PiperOrigin-RevId: 446924924
* Remove allow_files from proto_lang_toolchain's attributes
It's the same behaviour in native code.
PiperOrigin-RevId: 446988764
* Remove native implementation of proto_lang_toolchain rule
PiperOrigin-RevId: 446995789
* Fix name in proto_lang_toolchain rule
Added a wrapper for proto_lang_toolchain in order to have two implementations - one with public proto_compiler attribute, and the other one with the private one.
Restructured proto_lang_toolchain rules' implementation - merged two rule's definitions into one.
PiperOrigin-RevId: 447016335
* Cherry-pick missing things.
* Separate ExecException.java from main actions target.
PiperOrigin-RevId: 413105213
* ResourceSet in StarlarkAction API
Added optional `resource_set` parameter to `run` and `run_shell` in StarlarkActionApi. `resource_set` is `StarlarkCallable` object that returns dict with resource set (cpu, memory, local_test).
PiperOrigin-RevId: 415224490
* Implement and expose proto_common.compile call.
Design doc: https://docs.google.com/document/d/1dY_jfRvnH8SjRXGIfg8av-vquyWsvIZydXJOywvaR1A/edit
PiperOrigin-RevId: 440098122
* Fix ProtoCommon tests.
* Add experimental_progress_message parameter to proto_common.compile.
This will make migration to the new call easier (because we don't have progress_message set yet on the proto_lang_toolchain rules).
Design doc: https://docs.google.com/document/d/1dY_jfRvnH8SjRXGIfg8av-vquyWsvIZydXJOywvaR1A/edit
PiperOrigin-RevId: 440098602
* Implement proto_common.experimental_should_generate_code.
Design doc: https://docs.google.com/document/d/1dY_jfRvnH8SjRXGIfg8av-vquyWsvIZydXJOywvaR1A/edit
PiperOrigin-RevId: 440109298
* Implement proto_common.declare_generated_files.
Design doc: https://docs.google.com/document/d/1dY_jfRvnH8SjRXGIfg8av-vquyWsvIZydXJOywvaR1A/edit
PiperOrigin-RevId: 441097041
* Fix docstring in proto_common
PiperOrigin-RevId: 445149402
* Add proto_info parameter to proto_common.compile
Adding it will make it possible to migrate the uses from proto_library_target to proto_info. When the migration is done proto_library_target will be removed.
The cost of changing this now is still low, because it's not yet released/used in Bazel.
PiperOrigin-RevId: 455616355
Change-Id: Ieb0f03b0600e1f90b72a61f90420675075c79a9e
* Migrate proto_library_target to proto_info in proto_common.declare_generated_files.
PiperOrigin-RevId: 456475071
Change-Id: I2882d80cd4f7fdd9b8dcba3347930eaf1f194d0a
* Migrate proto_library_target to proto_info in proto_common.experimental_should_generate_code
PiperOrigin-RevId: 460162832
Change-Id: I57a6fa4c6e6c9618cf9edb8518e17b46fc90be9f
* Remove proto_library_target from proto_common
PiperOrigin-RevId: 460406536
Change-Id: I10021f32fb40e163ded02ebab8297902b63760fa
Co-authored-by: kotlaja <[email protected]>
Co-authored-by: wilwell <[email protected]>
Co-authored-by: Chenchu K <[email protected]>1 parent 40e485d commit 78af34f
File tree
61 files changed
+2312
-347
lines changed- src
- main
- java/com/google/devtools/build/lib
- actions
- analysis
- actions
- starlark
- test
- bazel
- coverage
- rules/java/proto
- exec
- packages/semantics
- rules
- android
- cpp
- proto
- java
- proto
- objc
- proto
- skyframe
- starlarkbuildapi
- proto
- starlark/builtins_bzl/common
- proto
- test/java/com/google/devtools/build/lib
- packages/semantics
- rules/proto
- standalone
- starlark
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
61 files changed
+2312
-347
lines changedLines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
118 | 160 | | |
119 | 161 | | |
120 | 162 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
301 | | - | |
| 300 | + | |
302 | 301 | | |
303 | 302 | | |
304 | 303 | | |
| |||
344 | 343 | | |
345 | 344 | | |
346 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
127 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
Lines changed: 0 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
| |||
82 | 79 | | |
83 | 80 | | |
84 | 81 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 82 | | |
128 | 83 | | |
129 | 84 | | |
130 | 85 | | |
131 | | - | |
132 | 86 | | |
133 | 87 | | |
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
| 67 | + | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 133 | + | |
| 134 | + | |
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
| 92 | + | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
100 | | - | |
101 | | - | |
| 99 | + | |
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
| |||
0 commit comments