Open SinimaWath opened 8 months ago
Read again code of ts_proto_library
.
As I understand, generating and copy files on bazel build proto_grpc
was not even planned (Am I right?)
And I need to run bazel run logger_ts_proto.copy
before bazel build proto_grpc
to always have updated typings:
bazel run logger_ts_proto.copy && bazel build proto_grpc
Maybe there is a way to make it easier in Bazel?
When the copy_files
is True in ts_proto_library
it generates the *.copy_0
and *.copy_0_test
bazel targets.
When running bazel build //...
, the build fails because the *.copy_0_test
will fail until the *.copy_0
target is called (or command with same effect)
Is there a way to prevent ts_proto_library
to create the *.copy_0_test
targets or not to build when bazel build //...
is called?
Based on this I think it is not, but would be very welcome.
Using bzlmod, bazel 7 and aspect_rules_ts 3.0.0-rc1
According this document there should be an attribute for proto_srcs
but I haven't found anything related to that in this file
Downgrading to aspect_rules_ts 2.4.2 (also ubuntu 22.04)
I get this error
ERROR: /path/to/project/proto/BUILD:16:17: in ts_proto_library rule //project/proto:hello_world_ts_proto:
Traceback (most recent call last):
File "/home/username/.cache/bazel/username/965fb35944158111184471dacc5db77b/external/aspect_rules_ts~/ts/private/ts_proto_library.bzl", line 101, column 53, in _ts_proto_library_impl
transitive_declarations = js_lib_helpers.gather_transitive_declarations(
Error: 'struct' value has no field or method 'gather_transitive_declarations'
Available attributes: envs_for_log_level, gather_files_from_js_infos, gather_npm_package_store_infos, gather_npm_sources, gather_runfiles, gather_transitive_sources, gather_transitive_types
ERROR: /path/to/project/proto/BUILD:16:17: Analysis of target '//project/proto:hello_world_ts_proto' failed
ERROR: Analysis of target '//project/proto:hello_world_ts_proto' failed; build aborted
INFO: Elapsed time: 11.196s, Critical Path: 0.10s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
What happened?
Read that
ts_proto_library
copy generated files automaticly to source tree: https://github.com/aspect-build/rules_ts/blob/main/ts/proto.bzl#L59But that behaviour doesn't work in
rule_ts
examplesVersion
Development (host) and target OS/architectures: MacOS, darwin_arm64
Output of
bazel --version
: aspect 5.8.19Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file: Reproducing in source code of https://github.com/aspect-build/rules_ts/Language(s) and/or frameworks involved: Reproducing in source code of https://github.com/aspect-build/rules_ts/
How to reproduce