use gtar and not tar under solaris

Hi, I've just been informed that unpacking the binary (i386) solaris distribution using bunzip2 and tar: bunzip2 -c ghc-6.10.4-i386-unknown-solaris2.tar.bz2 | tar xvf - does not work properly! Use instead: gtar jxvf ghc-6.10.4-i386-unknown-solaris2.tar.bz2 File names longer than a hundred characters are cut off, i.e. ghc-6.10.4/libraries/dph/dph-prim-seq/dist/build/Data/Array/Parallel/Unlifted/Sequential/Flat/UArr.hi is wrongly extracted as: ghc-6.10.4/libraries/dph/dph-prim-seq/dist/build/Data/Array/Parallel/Unlifted/Sequential/Flat/UArr.h leading to an installation failure: installPackage: Error: Could not find module: Data.Array.Parallel.Unlifted.Sequential.Flat.UArr with any suffix: ["hi"] gmake[1]: *** [install.library.dph/dph-prim-seq] Error 1 Ian, could you place a note about using gtar for unpacking solaris binary-dists? Cheers Christian

On Tue, 2009-08-04 at 10:15 +0200, Christian Maeder wrote:
Hi,
I've just been informed that unpacking the binary (i386) solaris distribution using bunzip2 and tar:
It may work better in future if you use a non-GNU tar to pack it up in the first place. GNU tar uses a non-standard tar format by default. Solaris tar would likely have more luck unpacking a POSIX/USTAR tar format file. It's also possible to use gnu tar to make standard tar format files, using --format ustar rather than gnu tar's default of --format gnu. Duncan (who now knows an unhealthy amount about tar file formats after writing a Haskell package to read them)

On Thu, 2009-08-06 at 12:30 +0100, Duncan Coutts wrote:
On Tue, 2009-08-04 at 10:15 +0200, Christian Maeder wrote:
Hi,
I've just been informed that unpacking the binary (i386) solaris distribution using bunzip2 and tar:
It may work better in future if you use a non-GNU tar to pack it up in the first place. GNU tar uses a non-standard tar format by default. Solaris tar would likely have more luck unpacking a POSIX/USTAR tar format file. It's also possible to use gnu tar to make standard tar format files, using --format ustar rather than gnu tar's default of --format gnu.
In fact I think I'd always advocate using the USTAR tar format over the GNU tar format when distributing software, since portability is of prime concern. This is what cabal-install does. I'd recommend ghc do it too. I also filed a ticket for darcs dist about this some time ago. Duncan

ghc's configure script set: TAR = /opt/csw/bin/gtar ZIP = zip in mk/config.mk although I've got /usr/bin/tar, too (and earlier in my path). Cheers Christian Duncan Coutts wrote:
On Tue, 2009-08-04 at 10:15 +0200, Christian Maeder wrote:
Hi,
I've just been informed that unpacking the binary (i386) solaris distribution using bunzip2 and tar:
It may work better in future if you use a non-GNU tar to pack it up in the first place. GNU tar uses a non-standard tar format by default. Solaris tar would likely have more luck unpacking a POSIX/USTAR tar format file. It's also possible to use gnu tar to make standard tar format files, using --format ustar rather than gnu tar's default of --format gnu.
Duncan (who now knows an unhealthy amount about tar file formats after writing a Haskell package to read them)

On Thu, Aug 06, 2009 at 12:30:51PM +0100, Duncan Coutts wrote:
I've just been informed that unpacking the binary (i386) solaris distribution using bunzip2 and tar:
It may work better in future if you use a non-GNU tar to pack it up in the first place. GNU tar uses a non-standard tar format by default. Solaris tar would likely have more luck unpacking a POSIX/USTAR tar format file. It's also possible to use gnu tar to make standard tar format files, using --format ustar rather than gnu tar's default of --format gnu.
Is there something like pax(1) available on solaris? If so, it should be be preferred, because it's a POSIX tool, so there's some hope that it behaves the same on different systems. pax(1) should be available on all BSD systems, and to my knowledge, there's a pax package available at least for Debian Linux. Ciao, Kili

Matthias Kilian wrote:
On Thu, Aug 06, 2009 at 12:30:51PM +0100, Duncan Coutts wrote:
I've just been informed that unpacking the binary (i386) solaris distribution using bunzip2 and tar: It may work better in future if you use a non-GNU tar to pack it up in the first place. GNU tar uses a non-standard tar format by default. Solaris tar would likely have more luck unpacking a POSIX/USTAR tar format file. It's also possible to use gnu tar to make standard tar format files, using --format ustar rather than gnu tar's default of --format gnu.
Is there something like pax(1) available on solaris? If so, it should be be preferred, because it's a POSIX tool, so there's some hope that it behaves the same on different systems.
Yes, pax is available under solaris. I thought GNU tar is the standard packer under unix. (The usage message of pax is less clear.) Below is a part of "gtar --help" Cheers Christian Archive format selection: -H, --format=FORMAT create archive of the given format. FORMAT is one of the following: gnu GNU tar 1.13.x format oldgnu GNU format as per tar <= 1.12 pax POSIX 1003.1-2001 (pax) format posix Same as pax ustar POSIX 1003.1-1988 (ustar) format v7 old V7 tar format

On Thu, Aug 06, 2009 at 08:54:49PM +0200, Christian Maeder wrote:
Is there something like pax(1) available on solaris? If so, it should be be preferred, because it's a POSIX tool, so there's some hope that it behaves the same on different systems.
Yes, pax is available under solaris. I thought GNU tar is the standard packer under unix.
Depends on what `standard' means ;-) - tar has been there forever on unices, with several slightly incompatible format extensions - GNU tar is just another implementation, typically used on Linux, and it has its own incompatible format extensions. - pax is (or should be) available everywhere, its behaviour is defined by POSIX, it should (by default) create archives readable by most tar implemenations, but almost nobody knows about it ;-) http://www.opengroup.org/onlinepubs/9699919799/utilities/pax.html I wonder wether Duncan did read and understood that bit of documentation, I didn't even read all of it ;-)
(The usage message of pax is less clear.)
The manpage (and of course the POSIX definition) are hard stuff, too. However, to create an archive, you can use something like $ pax -wf foo.tar directory Ciao, Kili

Matthias Kilian wrote:
However, to create an archive, you can use something like
$ pax -wf foo.tar directory
Do you think "gtar --format=posix" would be different from pax? The only question is, if we should create archives using the ustar, posix/pax, or gnu format. ustar seems to be the least common denominator. Does ustar have any disadvantages? Cheers Christian

Christian Maeder wrote:
Matthias Kilian wrote:
However, to create an archive, you can use something like
$ pax -wf foo.tar directory
Do you think "gtar --format=posix" would be different from pax?
The only question is, if we should create archives using the ustar, posix/pax, or gnu format. ustar seems to be the least common denominator. Does ustar have any disadvantages?
My plain tar command under solaris cannot handle the pax files, too. So ustar archives should be created (at least under solaris). But I don't know why the ustar format can handle long file names, whereas the gnu format creates a "@LongLink" file and pax a "PaxHeader" file (when unpacked with tar). Cheers Christian

On Fri, 2009-08-07 at 13:14 +0200, Christian Maeder wrote:
Christian Maeder wrote:
Matthias Kilian wrote:
However, to create an archive, you can use something like
$ pax -wf foo.tar directory
Do you think "gtar --format=posix" would be different from pax?
I would expect they are the same. The USTAR format is standardised by a POSIX standard from 1988 while the pax extensions are standardised by POSIX from 2001 I think. The pax program has an -x format flag and can use pax, ustar or cpio formats. The pax format is an extension of the ustar format.
The only question is, if we should create archives using the ustar, posix/pax, or gnu format. ustar seems to be the least common denominator. Does ustar have any disadvantages?
For source code distribution I think the ustar format is ideal. This is what cabal-install's sdist mode uses. As you say it's the lowest common denominator. The limitations of the format (file sizes, lack of extended file meta-data) are not a practical problem for source code or binaries.
My plain tar command under solaris cannot handle the pax files, too. So ustar archives should be created (at least under solaris).
That's odd since pax is supposed to be a compatible extension of ustar that just adds extra meta-data entries. Older programs should either ignore those entries or extract them as if they were ordinary files.
But I don't know why the ustar format can handle long file names,
The ustar format can handle file names up to 100+155 characters (bytes) long. The reason for 100+155 is that it's not simply 255. The split into a 100 and 155 field must happen on a directory separator.
whereas the gnu format creates a "@LongLink" file and pax a "PaxHeader" file (when unpacked with tar).
Right, those "files" are the extended entries. Duncan
participants (4)
-
Christian Maeder
-
Duncan Coutts
-
Ian Lynagh
-
Matthias Kilian