Skip to content

[9.1.1] downloader: fix opaque file URI names (https://github.com/bazelbuild/bazel/pull/29549) - #29658

Merged
Wyverald merged 1 commit into
bazelbuild:release-9.1.1from
bazel-io:cp29393-9.1.1-062909
May 27, 2026
Merged

[9.1.1] downloader: fix opaque file URI names (https://github.com/bazelbuild/bazel/pull/29549)#29658
Wyverald merged 1 commit into
bazelbuild:release-9.1.1from
bazel-io:cp29393-9.1.1-062909

Conversation

@bazel-io

Copy link
Copy Markdown
Member

Fix a Bazel 9.1.0 regression where repository_ctx.download
could crash on opaque file URIs such as file:../archive.tgz. The
URL-to-URI migration changed basename extraction because URI.getPath()
returns null for these inputs, unlike URL#getPath(). DownloadManager
then passed null to PathFragment.create while building distdir
candidate names.

Reuse one basename helper for download destinations and distdir
lookups, falling back to the scheme-specific part for opaque URIs.
Add regression coverage for the explicit-output and typed-download
paths.

Fixes #29393.

Closes #29549.

PiperOrigin-RevId: 921914147
Change-Id: I0adcf96e63f12bd8051979fedb2d4de2891c90c3

Commit 8130596

Fix a Bazel 9.1.0 regression where repository_ctx.download
could crash on opaque file URIs such as file:../archive.tgz. The
URL-to-URI migration changed basename extraction because URI.getPath()
returns null for these inputs, unlike URL#getPath(). DownloadManager
then passed null to PathFragment.create while building distdir
candidate names.

Reuse one basename helper for download destinations and distdir
lookups, falling back to the scheme-specific part for opaque URIs.
Add regression coverage for the explicit-output and typed-download
paths.

Fixes bazelbuild#29393.

Closes bazelbuild#29549.

PiperOrigin-RevId: 921914147
Change-Id: I0adcf96e63f12bd8051979fedb2d4de2891c90c3
@bazel-io bazel-io added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels May 27, 2026
@bazel-io
bazel-io requested a review from a team as a code owner May 27, 2026 06:29
@Wyverald
Wyverald added this pull request to the merge queue May 27, 2026
Merged via the queue into bazelbuild:release-9.1.1 with commit 16339ec May 27, 2026
46 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label May 27, 2026
@Wyverald
Wyverald deleted the cp29393-9.1.1-062909 branch May 27, 2026 15:32
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.

3 participants