[MacPorts] #67336: BSD tar can create corrupted archives on Catalina, Big Sur, Monterey, Ventura

MacPorts noreply at macports.org
Thu May 25 15:09:41 UTC 2023


#67336: BSD tar can create corrupted archives on Catalina, Big Sur, Monterey,
Ventura
---------------------+-------------------------------------------------
  Reporter:  catap   |      Owner:  (none)
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  base    |    Version:  2.8.1
Resolution:          |   Keywords:  catalina, bigsur, monterey, ventura
      Port:          |
---------------------+-------------------------------------------------

Comment (by ryandesign):

 Replying to [comment:29 catap]:
 > The issue that we need to setup gnutar. And if we're switching to ship
 that, why not to switch to xz which should decrease bandwish / diskusage?
 :)

 As I've explained several times already, we don't have a mechanism for
 switching the archive compression method, at least not within a major OS
 version. It is specified in the user's macports.conf, in the
 `portarchivetype` option, and all the user's installed ports use archives
 of this type. There's no code in MacPorts base to, for example, recompress
 all the user's installed archives with a new compression method if the
 user changes `portarchivetype` after having ports installed, so changing
 it when ports are installed will just break everything. We also don't have
 anything in place to convert the vast number of tbz2 archives on the
 packages server to txz. Obviously a script could be written to do that.
 But we would either have to keep all archives available in both formats
 during the transition period, modifying mpbb as well to upload both
 archive types, or there would be a period of time during the transition
 where some users would not receive archives, either because we have
 converted all the archives and they haven't upgraded MacPorts base yet or
 because we haven't converted all the archives and they have upgraded
 MacPorts base already. Or we would have to modify MacPorts base so that it
 would attempt downloading archives in both formats.

 Fortunately `portarchivetype` is commented out in the default
 macports.conf, so if we decided to change the default value (for example
 to `txz`) starting from macOS 14, even users who upgraded from an older
 system and retained their old macports.conf would get the new archive
 type.

 Bundling gnutar with MacPorts base is potentially problematic as its
 license is GPL while MacPorts' license is BSD.

 Bundling xz is potentially problematic because its license is public
 domain which is legally ambiguous.

 See #47255 and #52000 and #56237 for prior discussion of these issues.

 bsdtar from libarchive 3.6.0 and later has a `--no-sparse-read` flag to
 turn off its handling of sparse files, which should fix the problem.
 Unfortunately even macOS Ventura 13.3 still has an older version of bsdtar
 so this flag is not available. I don't know if this functionality can be
 accessed from the `tar` command line program in prior versions (perhaps
 with some environment variable). The functionality is present in earlier
 libarchive versions so if MacPorts base were to create archives by calling
 libarchive functions instead of by running the `tar` executable then we
 could disable this feature and thereby avoid the problem.


 Replying to [comment:30 catap]:
 > Seems that the only way to solve it is purge inside base.
 >
 > But it won't help if someone runs `port` without `sudo` :(

 Yes, I've mentioned the lack of a workaround for non-root use cases in my
 Apple feedback report. So far they have not responded to it.

-- 
Ticket URL: <https://trac.macports.org/ticket/67336#comment:31>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list