Repository navigation
Conversation
|
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the source-extraction changes.
No open issues 🎉
What changed in this PR
Updates Debian package source extraction to follow dpkg-source behavior, removing the dependency on archive directory names and addressing GH-55495.
Changes:
- Extracts source archives into a temporary directory.
- Uses a sole top-level directory if it is not a symbolic link; otherwise, uses the entire extracted tree.
- Removes special-case directory renaming for
~devand~rcversions.
| File | Description |
|---|---|
dev/tasks/linux-packages/apt/build.sh |
Normalizes extracted sources to ${PACKAGE}-${VERSION} regardless of archive layout. |
Review effort: Balanced
…rce in apt/build.sh
### Rationale for this change
`dev/tasks/linux-packages/apt/build.sh` assumes that the top-level directory in the source archive is `${PACKAGE}-${VERSION}/`. It needs special cases for `~dev` and `~rc` versions because their source archives use different top-level directory names.
`dpkg-source` doesn't assume the top-level directory name. If the archive has only one top-level directory, it uses the directory whatever its name is.
### What changes are included in this PR?
Extract the source archive like `dpkg-source` does:
1. Extract the archive into a temporary directory.
2. If the temporary directory has only one entry and it's a directory (not a symbolic link), rename it to `${PACKAGE}-${VERSION}`. Otherwise, rename the temporary directory itself to `${PACKAGE}-${VERSION}`.
The `~dev`/`~rc` special cases are removed.
`apache-arrow-apt-source` no longer needs to re-create its source archive to rename the top-level directory for `apt/build.sh`. It just copies the source archive like `apache-arrow` does.
### Are these changes tested?
Yes.
I tested the extraction logic locally with archives that have one top-level directory with an arbitrary name, a hidden top-level directory, multiple entries, a single file, a dot file with a directory and a symbolic link to a directory. I also tested it with the 23.0.1 source archive.
Package builds are tested by CI.
### Are there any user-facing changes?
No.
### Was AI used for this PR?
In accordance to the [AI generation guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code), please disclose below whether and how AI was used in this PR.
**PR code and description written by:**
- [x] Human
- [x] AI
**Reviewed before submission by:**
- [x] Human
- [ ] AI
- [ ] Not reviewed
* GitHub Issue: apache#55495
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kou
force-pushed
the
apt-build-top-dir
branch
from
November 11, 2026 21:44
38aed0f to
389c57f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
dev/tasks/linux-packages/apt/build.shassumes that the top-level directory in the source archive is${PACKAGE}-${VERSION}/. It needs special cases for~devand~rcversions because their source archives use different top-level directory names.dpkg-sourcedoesn't assume the top-level directory name. If the archive has only one top-level directory, it uses the directory whatever its name is.What changes are included in this PR?
Extract the source archive like
dpkg-sourcedoes:${PACKAGE}-${VERSION}. Otherwise, rename the temporary directory itself to${PACKAGE}-${VERSION}.The
~dev/~rcspecial cases are removed.apache-arrow-apt-sourceno longer needs to re-create its source archive to rename the top-level directory forapt/build.sh. It just copies the source archive likeapache-arrowdoes.Are these changes tested?
Yes.
Are there any user-facing changes?
No.
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: