Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: no such target '@local_config_platform//:constraints.bzl': target 'constraints.bzl' #392

Closed
1 task
gonzojive opened this issue Mar 10, 2023 · 2 comments
Labels
confirmation needed Waiting on confirmation of resolution from reporter before closing question This issue is a question. Close the loop with documentation?

Comments

@gonzojive
Copy link

What happened?

I get an error that seems to be related to this library when executing the stardoc tests in rules_ts_proto. It only occurs with bazel 5.* on CI.

Run bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...
2023/03/10 14:44:17 Downloading https://releases.bazel.build/5.3.2/release/bazel-5.3.2-linux-x8[6](https://github.com/gonzojive/rules_ts_proto/actions/runs/4385596763/jobs/7678527685#step:6:7)_64...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 2b3d3c3c-6[7](https://github.com/gonzojive/rules_ts_proto/actions/runs/4385596763/jobs/7678527685#step:6:8)0d-4bc1-afad-22177f3199d9
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=[8](https://github.com/gonzojive/rules_ts_proto/actions/runs/4385596763/jobs/7678527685#step:6:9)0
INFO: Reading rc options for 'test' from /home/runner/work/rules_ts_proto/rules_ts_proto/.github/workflows/ci.bazelrc:
  Inherited 'build' options: --announce_rc --disk_cache=~/.cache/bazel --repository_cache=~/.cache/bazel-repo
INFO: Reading rc options for 'test' from /home/runner/work/rules_ts_proto/rules_ts_proto/.github/workflows/ci.bazelrc:
  'test' options: --test_output=errors --test_env=XDG_CACHE_HOME
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 2 packages loaded
    currently loading: docs ... (2 packages)
DEBUG: Rule 'rules_proto_grpc' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1675443033 -0800"
DEBUG: Repository rules_proto_grpc instantiated at:
  /home/runner/work/rules_ts_proto/rules_ts_proto/WORKSPACE:18:28: in <toplevel>
  /home/runner/work/rules_ts_proto/rules_ts_proto/ts_proto/repositories.bzl:40:1[9](https://github.com/gonzojive/rules_ts_proto/actions/runs/4385596763/jobs/7678527685#step:6:10): in rules_ts_proto_dependencies
  /home/runner/work/rules_ts_proto/rules_ts_proto/ts_proto/repositories.bzl:15:[10](https://github.com/gonzojive/rules_ts_proto/actions/runs/4385596763/jobs/7678527685#step:6:11): in git_repository
  /home/runner/.cache/bazel/_bazel_runner/c1a8ca0554eb96646292b108389786d1/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule git_repository defined at:
  /home/runner/.cache/bazel/_bazel_runner/c1a8ca0554eb96646292b108389786d1/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Analyzing: 18 targets (6 packages loaded, 0 targets configured)
DEBUG: Rule 'com_github_grpc_grpc_web' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1673335627 -0800"
DEBUG: Repository com_github_grpc_grpc_web instantiated at:
  /home/runner/work/rules_ts_proto/rules_ts_proto/WORKSPACE:18:28: in <toplevel>
  /home/runner/work/rules_ts_proto/rules_ts_proto/ts_proto/repositories.bzl:[11](https://github.com/gonzojive/rules_ts_proto/actions/runs/4385596763/jobs/7678527685#step:6:12)1:19: in rules_ts_proto_dependencies
  /home/runner/work/rules_ts_proto/rules_ts_proto/ts_proto/repositories.bzl:15:10: in git_repository
  /home/runner/.cache/bazel/_bazel_runner/c1a8ca0554eb96646292b108389786d1/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule git_repository defined at:
  /home/runner/.cache/bazel/_bazel_runner/c1a8ca0554eb96646292b108389786d1/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
Analyzing: 18 targets (65 packages loaded, 156 targets configured)
DEBUG: Rule 'com_google_protobuf_javascript' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1678429505 -0800"
DEBUG: Repository com_google_protobuf_javascript instantiated at:
  /home/runner/work/rules_ts_proto/rules_ts_proto/WORKSPACE:18:28: in <toplevel>
  /home/runner/work/rules_ts_proto/rules_ts_proto/ts_proto/repositories.bzl:46:19: in rules_ts_proto_dependencies
  /home/runner/work/rules_ts_proto/rules_ts_proto/ts_proto/repositories.bzl:15:10: in git_repository
  /home/runner/.cache/bazel/_bazel_runner/c1a8ca0554eb96646292b108389786d1/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule git_repository defined at:
  /home/runner/.cache/bazel/_bazel_runner/c1a8ca0554eb96646292b108389786d1/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
ERROR: /home/runner/.cache/bazel/_bazel_runner/c1a8ca0554eb96646292b108389786d1/external/aspect_bazel_lib/lib/private/docs/BUILD.bazel:10:[12](https://github.com/gonzojive/rules_ts_proto/actions/runs/4385596763/jobs/7678527685#step:6:13): no such target '@local_config_platform//:constraints.bzl': target 'constraints.bzl' not declared in package ''; however, a source file of this name exists.  (Perhaps add 'exports_files(["constraints.bzl"])' to /BUILD?) defined by /home/runner/.cache/bazel/_bazel_runner/c1a8ca0554eb96646292b108389786d1/external/local_config_platform/BUILD.bazel and referenced by '@aspect_bazel_lib//lib/private/docs:local_config_platform_constraints'
ERROR: Analysis of target '//docs:rules' failed; build aborted: 
INFO: Elapsed time: 6.809s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (67 packages loaded, [15](https://github.com/gonzojive/rules_ts_proto/actions/runs/4385596763/jobs/7678527685#step:6:16)8 targets configured)
ERROR: Couldn't start the build. Unable to run tests
FAILED: Build did NOT complete successfully (67 packages loaded, 158 targets configured)
Error: Process completed with exit code 1.

Version

Development (host) and target OS/architectures:

Output of bazel --version:

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

Language(s) and/or frameworks involved:

How to reproduce

git clone [email protected]:gonzojive/rules_ts_proto.git
cd rules_test_proto
git checkout 84c449c804515328f9a3a8302c28862d30c4bff2
bazel test //...

Any other information?

No response

Fund our work

  • Sponsor our open source work by donating a bug bounty
@gonzojive gonzojive added the bug Something isn't working label Mar 10, 2023
@github-actions github-actions bot added the untriaged Requires traige label Mar 10, 2023
gonzojive added a commit to gonzojive/rules_ts_proto that referenced this issue Mar 10, 2023
gonzojive added a commit to gonzojive/rules_ts_proto that referenced this issue Mar 10, 2023
* Update stardoc-related BUILD.bazel entries to get stardoc tests passing.
* Disable bazel 5.* testing on CI due to bazel-contrib/bazel-lib#392.
@gregmagolan
Copy link
Collaborator

The @local_config_platform//:constraints.bzl export_files was only added in Bazel 6.

For Bazel 5 there is a work-around required.

load("//lib:repositories.bzl", "aspect_bazel_lib_dependencies")

aspect_bazel_lib_dependencies(override_local_config_platform = True)

which creates a local_config_platform instead of relying on the Bazel created one.

@gregmagolan gregmagolan added question This issue is a question. Close the loop with documentation? and removed untriaged Requires traige bug Something isn't working labels Mar 10, 2023
@gregmagolan gregmagolan moved this to ❓Pending confirmation in Open Source Mar 10, 2023
@gregmagolan gregmagolan added the confirmation needed Waiting on confirmation of resolution from reporter before closing label Mar 10, 2023
@alexeagle
Copy link
Collaborator

Hey @gonzojive I'm assuming Greg's answer solved this, please comment again if not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmation needed Waiting on confirmation of resolution from reporter before closing question This issue is a question. Close the loop with documentation?
Projects
None yet
Development

No branches or pull requests

3 participants