[PR #133] [MERGED] Test & fix extracting .tar.gz packages on macOS #250

Closed
opened 2026-01-29 16:31:36 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/quamotion/dotnet-packaging/pull/133
Author: @qmfrederik
Created: 11/29/2019
Status: Merged
Merged: 11/29/2019
Merged by: @qmfrederik

Base: masterHead: fixes/tarball


📝 Commits (7)

  • a72ccda Test extracting .tar.gz packages on macOS
  • e02c9d7 Bump SharpZipLib version
  • 7f19d0e Use built-in ArchiveBuilder and TarFileCreator to create .tar.gz files
  • f35ee6d DebTask: Be more conservative when adding directories
  • 1794185 ArchiveEntry: Don't use prefix when not needed
  • 262aef6 Use GZipStream instead of GZipOutputStream
  • 711916c TarFileCreator: Support streams which don't report on their current Position

📊 Changes

10 files changed (+214 additions, -69 deletions)

View changed files

.azure-pipelines-shared.yml (+31 -0)
📝 .azure-pipelines.yml (+43 -30)
📝 Packaging.Targets.Tests/Deb/DebTaskTests.cs (+70 -1)
📝 Packaging.Targets/ArchiveBuilder.cs (+8 -1)
📝 Packaging.Targets/DebTask.cs (+9 -5)
📝 Packaging.Targets/IO/TarFileCreator.cs (+17 -5)
📝 Packaging.Targets/Packaging.Targets.csproj (+3 -6)
📝 Packaging.Targets/StreamExtensions.cs (+2 -1)
📝 Packaging.Targets/TarballTask.cs (+27 -19)
📝 Packaging.Targets/build/Packaging.Targets.targets (+4 -1)

📄 Description

The output from dotnet tarball includes an empty nameless directory (see #52). This causes tar xvzf {output} to fail on macOS:

tar: Failed to set default locale
tar: Archive entry has empty or unreadable filename ... skipping.
~ % tar --version
tar: Failed to set default locale
bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6

The Tarball uses SharpZipLib and the error seems to originate from there. dotnet-packaging now ships with its own implementation for writing .tar files, so use that instead.

Fixes a couple of bugs/adds unit tests as well:

  • Support for relative paths in DebTask.EnsureDirectories
  • ArchiveBuilder supports / or . as root for file names
  • TarFileCreator doesn't require the Stream to which it is writing to report on its Position, but calculates the position locally.

Fixes #52


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/quamotion/dotnet-packaging/pull/133 **Author:** [@qmfrederik](https://github.com/qmfrederik) **Created:** 11/29/2019 **Status:** ✅ Merged **Merged:** 11/29/2019 **Merged by:** [@qmfrederik](https://github.com/qmfrederik) **Base:** `master` ← **Head:** `fixes/tarball` --- ### 📝 Commits (7) - [`a72ccda`](https://github.com/quamotion/dotnet-packaging/commit/a72ccdac38df6f48353e94dfefea2be57638d904) Test extracting .tar.gz packages on macOS - [`e02c9d7`](https://github.com/quamotion/dotnet-packaging/commit/e02c9d792dc0889db4b1d8f7da83789e6d0b580a) Bump SharpZipLib version - [`7f19d0e`](https://github.com/quamotion/dotnet-packaging/commit/7f19d0e752e17de46506b43dccd2891b0138e424) Use built-in ArchiveBuilder and TarFileCreator to create .tar.gz files - [`f35ee6d`](https://github.com/quamotion/dotnet-packaging/commit/f35ee6d97c0603cfc2874423cb9cf3525317b6a3) DebTask: Be more conservative when adding directories - [`1794185`](https://github.com/quamotion/dotnet-packaging/commit/179418530eb23b3e9efa3e30b3cb246f7ca48633) ArchiveEntry: Don't use prefix when not needed - [`262aef6`](https://github.com/quamotion/dotnet-packaging/commit/262aef6ca387178d461f0dbddb165ee8445e5f4b) Use GZipStream instead of GZipOutputStream - [`711916c`](https://github.com/quamotion/dotnet-packaging/commit/711916ccb3adf7c86175187c4ef0127c9c8c1726) TarFileCreator: Support streams which don't report on their current Position ### 📊 Changes **10 files changed** (+214 additions, -69 deletions) <details> <summary>View changed files</summary> ➕ `.azure-pipelines-shared.yml` (+31 -0) 📝 `.azure-pipelines.yml` (+43 -30) 📝 `Packaging.Targets.Tests/Deb/DebTaskTests.cs` (+70 -1) 📝 `Packaging.Targets/ArchiveBuilder.cs` (+8 -1) 📝 `Packaging.Targets/DebTask.cs` (+9 -5) 📝 `Packaging.Targets/IO/TarFileCreator.cs` (+17 -5) 📝 `Packaging.Targets/Packaging.Targets.csproj` (+3 -6) 📝 `Packaging.Targets/StreamExtensions.cs` (+2 -1) 📝 `Packaging.Targets/TarballTask.cs` (+27 -19) 📝 `Packaging.Targets/build/Packaging.Targets.targets` (+4 -1) </details> ### 📄 Description The output from `dotnet tarball` includes an empty nameless directory (see #52). This causes `tar xvzf {output}` to fail on macOS: ``` tar: Failed to set default locale tar: Archive entry has empty or unreadable filename ... skipping. ``` ``` ~ % tar --version tar: Failed to set default locale bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6 ``` The Tarball uses SharpZipLib and the error seems to originate from there. dotnet-packaging now ships with its own implementation for writing .tar files, so use that instead. Fixes a couple of bugs/adds unit tests as well: - Support for relative paths in `DebTask.EnsureDirectories` - ArchiveBuilder supports `/` or `.` as root for file names - `TarFileCreator` doesn't require the `Stream` to which it is writing to report on its `Position`, but calculates the position locally. Fixes #52 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 16:31:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#250