[MacPorts] #67336: tar on Ventura is broken, what shall we do?

MacPorts noreply at macports.org
Sun Apr 30 17:32:17 UTC 2023


#67336: tar on Ventura is broken, what shall we do?
--------------------+--------------------
 Reporter:  catap   |      Owner:  (none)
     Type:  defect  |     Status:  new
 Priority:  High    |  Milestone:
Component:  base    |    Version:
 Keywords:          |       Port:
--------------------+--------------------
 While I'm working on updating pari to the latest version, I discovered a
 bug with broken tar on Ventura x86.

 Long story short: port build a `libpari-gmp.dylib` that starts as:
 {{{
   0000000 facf feed 0007 0100 0003 0000 0006 0000
   0000010 0010 0000 0650 0000 0085 0010 0000 0000
   0000020 0019 0000 01d8 0000 5f5f 4554 5458 0000
   0000030 0000 0000 0000 0000 0000 0000 0000 0000
   0000040 c000 006c 0000 0000 0000 0000 0000 0000
   0000050 c000 006c 0000 0000 0005 0000 0005 0000
   0000060 0005 0000 0000 0000 5f5f 6574 7478 0000
   0000070 0000 0000 0000 0000 5f5f 4554 5458 0000
   0000080 0000 0000 0000 0000 4498 0000 0000 0000
   0000090 a78c 0065 0000 0000 4498 0000 0002 0000
 }}}

 After it is installed into the system, the same files look like this:
 {{{
   0000000 0000 0000 0000 0000 0000 0000 0000 0000
   *
   0600000 49d2 34f7 48cc 0489 48cf c6ff 3948 75f3
   0600010 48d5 c1ff 3948 75d9 48c8 458b 49b0 0089
   0600020 ff49 49c7 df39 850f feae ffff 8348 02fb
   0600030 8b4c a075 8b4c 8865 1b72 bf41 0001 0000
   0600040 2949 4bdf 3c8b e8fc faf1 ffa4 894b fc04
   0600050 ff49 75c7 48ee 7d8b 4cc0 f689 8148 88c4
   0600060 0000 5b00 5c41 5d41 5e41 5f41 e95d fa61
   0600070 ffff 4855 e589 5741 5641 5441 4853 ec83
 }}}
 which means the file is corrupt and has tons of zeros at the beginning.

 After some digging, I've discovered that adding to the portfile:
 {{{
 depends_build port:gnutar

 post-destroot {
     system -W ${destroot} "/usr/bin/tar -cvf - . 2>/dev/null | wc"
     system -W ${destroot} "${prefix}/bin/gtar -cvf - . 2>/dev/null | wc"
 }
 }}}
 returns
 {{{
   DEBUG: system -W /opt/local/var/macports/build
 /_Users_runner_work_macports-ports_macports-
 ports_ports_math_pari/pari/work/destroot: /usr/bin/tar -cvf - .
 2>/dev/null | wc
     141230  797436 6000640
   DEBUG: system -W /opt/local/var/macports/build
 /_Users_runner_work_macports-ports_macports-
 ports_ports_math_pari/pari/work/destroot: /opt/local/bin/gtar -cvf - .
 2>/dev/null | wc
     156802  971295 13424640
 }}}

 => output are quite different, and system tar breaks an archive.

 This bug also exists in the current version of pari. This means that the
 binary archive is literally broken.

 The question is: how many other ports are affected?

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


More information about the macports-tickets mailing list