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

A file:// registry URI missing a slash leads the "domain" being used as the error message #24423

Open
Silic0nS0ldier opened this issue Nov 21, 2024 · 1 comment
Labels
help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug

Comments

@Silic0nS0ldier
Copy link
Contributor

Description of the bug:

It is very easy to neglect adding the extra slash required to produce a valid file:// URI.

For example;

--registry=file://home/coder/work/bazel-central-registry

At a glance this looks right, but at runtime you'll end up with an error like the following.

ERROR: Error accessing registry file://home/coder/work/bazel-central-registry: Failed to fetch registry file file://home/coder/work/bazel-central-registry/modules/protobuf/25.3/MODULE.bazel: home. Type 'bazel help mod' for syntax and help.

The only hint as to the cause is the first path segment being the error message, otherwise this is a poor error message that doesn't actually explain what went wrong.

The correct argument would have been;

--registry=file:///home/coder/work/bazel-central-registry
                  ^

Which category does this issue belong to?

Documentation, External Dependency

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

Linux (Ubuntu)

What is the output of bazel info release?

release 7.4.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@github-actions github-actions bot added team-Documentation Documentation improvements that cannot be directly linked to other team labels team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. labels Nov 21, 2024
@meteorcloudy meteorcloudy added P3 We're not considering working on this, but happy to review a PR. (No assignee) help wanted Someone outside the Bazel team could own this and removed untriaged labels Nov 26, 2024
@meteorcloudy
Copy link
Member

Thanks for reporting! Feel free to send a PR to help us improve the error message!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug
Projects
None yet
Development

No branches or pull requests

5 participants