Skip to content

[8.7.0] Add strip_components to extract/download_and_extract `http_arch…#29367

Merged
meteorcloudy merged 1 commit intobazelbuild:release-8.7.0from
willstranton:release-8.7.0
Apr 22, 2026
Merged

[8.7.0] Add strip_components to extract/download_and_extract `http_arch…#29367
meteorcloudy merged 1 commit intobazelbuild:release-8.7.0from
willstranton:release-8.7.0

Conversation

@willstranton
Copy link
Copy Markdown
Contributor

@willstranton willstranton commented Apr 22, 2026

…… (#29281)

Add strip_components to extract/download_and_extract http_archive

Description

The strip_components attribute functions similar to tar --strip-components:

Strip NUMBER leading components from file names on extraction.

This is an alternative to the existing strip_prefix attribute, which required knowing the exact prefix to be stripped. Only one of the two attributes (strip_prefix, strip_components) can be set at one time.

Motivation

See #28879

Build API Changes

  1. Has this been discussed in a design doc or issue? (Please link it)

See #28879

  1. Is the change backward compatible?

Yes

  1. If it's a breaking change, what is the migration plan?

N/A - this is not a breaking change.

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES[NEW]: Adds the strip_components attribute to extract/download_and_extract/http_archive to allow stripping of path components when extracting files.

Closes #29281.

Fixes #28879

PiperOrigin-RevId: 902961227
Change-Id: I3fda77ec42c3d052f6655e42c8b57ec27667c758

bazelbuild#29281)

Add `strip_components` to `extract`/`download_and_extract` `http_archive`

### Description

The `strip_components` attribute functions similar to `tar --strip-components`:

> Strip NUMBER leading components from file names on extraction.

This is an alternative to the existing `strip_prefix` attribute, which required knowing the exact prefix to be stripped. Only one of the two attributes (`strip_prefix`, `strip_components`) can be set at one time.

### Motivation
See bazelbuild#28879

### Build API Changes

> 1. Has this been discussed in a design doc or issue? (Please link it)

See bazelbuild#28879

> 2. Is the change backward compatible?

Yes

> 3. If it's a breaking change, what is the migration plan?

N/A - this is not a breaking change.

### Checklist

- [X] I have added tests for the new use cases (if any).
- [X] I have updated the documentation (if applicable).

### Release Notes

RELNOTES[NEW]: Adds the `strip_components` attribute to `extract`/`download_and_extract`/`http_archive` to allow stripping of path components when extracting files.

Closes bazelbuild#29281

PiperOrigin-RevId: 902961227
Change-Id: I3fda77ec42c3d052f6655e42c8b57ec27667c758
@willstranton willstranton marked this pull request as ready for review April 22, 2026 04:04
@willstranton willstranton requested a review from a team as a code owner April 22, 2026 04:04
@github-actions github-actions Bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-Core Skyframe, bazel query, BEP, options parsing, bazelrc awaiting-review PR is awaiting review from an assigned reviewer labels Apr 22, 2026
@meteorcloudy meteorcloudy changed the title Add strip_components to extract/download_and_extract `http_arch… [8.7.0] Add strip_components to extract/download_and_extract `http_arch… Apr 22, 2026
@meteorcloudy meteorcloudy added this pull request to the merge queue Apr 22, 2026
Merged via the queue into bazelbuild:release-8.7.0 with commit e48ca93 Apr 22, 2026
47 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Core Skyframe, bazel query, BEP, options parsing, bazelrc team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants