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

Help users move the colon in their label #7834

Closed
alexeagle opened this issue Mar 25, 2019 · 3 comments
Closed

Help users move the colon in their label #7834

alexeagle opened this issue Mar 25, 2019 · 3 comments
Labels
bad error messaging Issues where users get stuck because they don't understand what they did wrong P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols type: feature request

Comments

@alexeagle
Copy link
Contributor

In Angular, I have a lot of users being confused about how to formulate a label that addresses their file.

For example, we install stuff from npm, and the user wants to reference
node_modules/@package/name/path/to/file.json
They used a rule to install the dependencies which creates a workspace called npm.

How does the developer know which of these labels to use?

  • @npm//node_modules/@package/name/path/to:file.json (this is the intuitive one since slashes after the colon are unusual)
  • @npm//:node_modules/@package/name/path/to/file.json (might look right to them since their package.json was in the root of their WORKSPACE and they already typed this once)

Of course the answer is to look around for the nearest ancestor BUILD.bazel file in the tree, but that requires they know how to look in $(bazel info output_base)/external/npm/... to locate files.

The error from bazel is target not declared in package or no such package depending where the wrong colon is, and also maybe add exports_files which is not helpful in an external BUILD file.

The right error message would be you probably meant to put the colon here: @npm//node_modules/@package/name:path/to/file.json

@jin jin added untriaged team-Bazel General Bazel product/strategy issues bad error messaging Issues where users get stuck because they don't understand what they did wrong labels Mar 26, 2019
@dslomov dslomov added team-Starlark and removed team-Bazel General Bazel product/strategy issues labels Jul 5, 2019
@laurentlb laurentlb added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Jul 8, 2019
@Jonathan34
Copy link

Of course the answer is to look around for the nearest ancestor BUILD.bazel file in the tree, but that requires they know how to look in $(bazel info output_base)/external/npm/... to locate files.

that is actually a must to understand what s going on and fix the deps and import path. Thank you for that!

@jin
Copy link
Member

jin commented Sep 13, 2019

Related: #9364

@brandjon brandjon added P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) team-Build-Language type: feature request team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols and removed P2 We'll consider working on this in future. (Assignee optional) team-Starlark labels Feb 17, 2021
@sgowroji sgowroji added the stale Issues or PRs that are stale (no activity for 30 days) label Feb 16, 2023
@sgowroji
Copy link
Member

Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.

@sgowroji sgowroji closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bad error messaging Issues where users get stuck because they don't understand what they did wrong P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols type: feature request
Projects
None yet
Development

No branches or pull requests

7 participants