Skip to content

http_file: add root BUILD to improve error when referencing repo root#29136

Closed
abishekgiri wants to merge 7 commits intobazelbuild:masterfrom
abishekgiri:bug-http-file-error
Closed

http_file: add root BUILD to improve error when referencing repo root#29136
abishekgiri wants to merge 7 commits intobazelbuild:masterfrom
abishekgiri:bug-http-file-error

Conversation

@abishekgiri
Copy link
Copy Markdown
Contributor

Summary

  • add a repo-root BUILD alias for http_file repositories so @repo//:file resolves from the repository root
  • keep the existing file/BUILD target layout while exposing a friendlier root target
  • fix the regression test so it is defined before run_suite, uses setup_module_dot_bazel, and validates the correct file checksum

Testing

  • bazel test //src/test/shell/bazel:starlark_repository_test --test_filter=test_http_file_root_build_alias --test_output=errors

@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Mar 28, 2026
@abishekgiri abishekgiri force-pushed the bug-http-file-error branch from 6041337 to 2fbed8c Compare March 28, 2026 01:59
@iancha1992 iancha1992 added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Mar 31, 2026
@meteorcloudy
Copy link
Copy Markdown
Member

Maybe we should have an alias at @repo//:repo so that @repo just works?

@meteorcloudy meteorcloudy self-requested a review April 1, 2026 15:10
@abishekgiri
Copy link
Copy Markdown
Contributor Author

Maybe we should have an alias at @repo//:repo so that @repo just works?

Implemented this in 385ff83. http_file now exposes a root alias for the repo name as well, so @repo//:repo and bare @repo resolve to the downloaded file. I also updated the regression coverage accordingly.

Comment thread tools/build_defs/repo/http.bzl Outdated
@meteorcloudy meteorcloudy added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. and removed team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website labels Apr 8, 2026
@abishekgiri abishekgiri requested a review from meteorcloudy April 8, 2026 16:07
@meteorcloudy
Copy link
Copy Markdown
Member

Sorry for the delay here, can you please rebase and run bazel run //src/test/tools/bzlmod:update_default_lock_file to fix the lockfile?

@abishekgiri abishekgiri force-pushed the bug-http-file-error branch from 36b57d1 to 0f07408 Compare April 10, 2026 18:12
@abishekgiri
Copy link
Copy Markdown
Contributor Author

Sorry for the delay here, can you please rebase and run bazel run //src/test/tools/bzlmod:update_default_lock_file to fix the lockfile?

Rebased onto the latest upstream/master and pushed the updated branch. I also refreshed src/test/tools/bzlmod/MODULE.bazel.lock in 0f074080f5.

The helper target bazel run //src/test/tools/bzlmod:update_default_lock_file is still blocked on this machine by the local Xcode license issue during build (xcrun code 69), so I regenerated the lockfile via the same empty-workspace mod deps flow using the checkout’s pinned Bazel version (9.0.1).

@meteorcloudy meteorcloudy added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Apr 13, 2026
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants