aspect-build / aspect-build/rules_ts

[Bug]: ts_proto_library descriptor database error in nested workspace

Open
#451 8 comments 0 reactions 0 assignees View on GitHub
bug need: investigation
Dominant language
Starlark
Stars
138
Forks
87
Avg merge
2d 8h
Merged PRs (30d)
3

Description

### What happened?

repro: https://github.com/binoche9/repros/tree/ts-proto-library-nested-workspace

```
bazel build @inner//:settings_ts --override_repository=aspect_rules_ts=$HOME/Projects/rules_ts

DEBUG: (this is the args to protoc) /shared/cache/bazel/user_base/6756fcacb63b1eda5fcd3118a702b979/external/aspect_rules_ts/ts/private/ts_proto_library.bzl:38:10:
--plugin=protoc-gen-es=bazel-out/k8-opt-exec-2B5CBBC6/bin/external/inner/_settings_ts.gen_es.sh |
--es_opt=keep_empty_files=true --es_opt=target=js+dts
--es_out=bazel-out/k8-fastbuild/bin
--descriptor_set_in bazel-out/k8-fastbuild/bin/external/inner/settings_proto-descriptor-set.proto.bin
external/inner/settings.proto

INFO: Analyzed target @inner//:settings_ts (1 packages loaded, 24 targets configured).
INFO: Found 1 target...
ERROR: /shared/cache/bazel/user_base/6756fcacb63b1eda5fcd3118a702b979/external/inner/BUILD:11:17: Generating .js/.d.ts from @inner//:settings_ts failed: (Exit 1): protoc failed: error executing command (from target @inner//:settings_ts) bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc '--plugin=protoc-gen-es=bazel-out/k8-opt-exec-2B5CBBC6/bin/external/inner/_settings_ts.gen_es.sh' '--es_opt=keep_empty_files=true' ... (remaining 5 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Could not find file in descriptor database: external/inner/settings.proto: No such file or directory
Target @inner//:settings_ts failed to build
```

Reported by @binoche9 and I think @pcj as well.

### Version

HEAD

### How to reproduce

_No response_

### Any other information?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked reproduction at https://github.com/binoche9/repros/tree/ts-proto-library-nested-workspace and run the reported bazel build command. Inspect ts/private/ts_proto_library.bzl at line 38 and the descriptor_set_in path shown in the debug output. Done means the nested @inner//:settings_ts target builds without the descriptor database error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.