darcs

Issue 1456 darcs dist calls gnu tar which makes less portable archives by default

Title darcs dist calls gnu tar which makes less portable archives by default
Priority bug Status resolved
Milestone 2.5.0 Resolved in 2.5.0
Superseder Nosy List darcs-devel, dmitry.kurochkin, duncan, gh, gwern, jaredj, kowey, thorkilnaur
Assigned To
Topics ProbablyEasy

Created on 2009-04-30.19:28:17 by duncan.coutts, last changed 2010-06-15.22:14:17 by admin.

Messages
msg7780 (view) Author: duncan Date: 2009-04-30.19:28:14
darcs dist calls the system tar command. On linux systems this is
usually gnu tar. By default gnu tar uses the gnu tar format. This is not
standard, though most archive programs can read it.

This aspect isn't a major problem. The problem is that by default gnu
tar will also use a bunch of other format extensions if it encounters
long file names etc. In these cases other archive programs cannot
necessarily read the resulting archive.

darcs dist is often used for software distribution. In this case the
most important thing is that everyone can read the thing. For the use
case of darcs dist to do a backup or something, then portability is less
important and preserving things like permissions and long file names is
important.

For the distribution use case darcs could instruct gnu tar to use a
standard tar format eg --format=ustar or --format=posix.

We have had at least one problem due to this issue with hackage. A user
uploaded a tarball that could be read by gnu tar but not by
cabal-install (even though cabal-install can read most gnu tar
archives). The problem has been fixed in a later release which uses
updated tar reading code, but it does not deal with the potential
problem of long file names.

Furthermore, in future the hackage server will reject tarballs that are
not fully portable (probably including gnu format archives). It'll
require proper posix compliant archives as these guarantee the highest
level of portability. At that time, packages created by darcs dist will
not be suitable (cabal sdist generates posix compliant tar archives).

The only problem I can see is that darcs does not necessarily know that
it is talking to gnu tar. Other system's tar programs to not accept the
--format flag. One option is to use the Haskell tar package (as
cabal-install does), or to just assume that linux implies gnu tar.

Duncan
msg7781 (view) Author: gwern Date: 2009-05-01.02:06:19
Sounds very easy. Basically change

Darcs/Commands/Dist.lhs:                exec "tar" ["-tf", "-"]

to

Darcs/Commands/Dist.lhs:                exec "tar" ["-tf", "--format=posix", "-"]

?
msg7782 (view) Author: duncan Date: 2009-05-01.08:46:59
On Fri, 2009-05-01 at 02:06 +0000, gwern wrote:
> gwern <gwern0@gmail.com> added the comment:
> 
> Sounds very easy. Basically change
> 
> Darcs/Commands/Dist.lhs:                exec "tar" ["-tf", "-"]
> 
> to
> 
> Darcs/Commands/Dist.lhs:                exec "tar" ["-tf", "--format=posix", "-"]
> 

Yes, except for the platforms where tar is not gnu tar.

Duncan
msg10378 (view) Author: gh Date: 2010-03-21.14:17:57
The following patch updated the status of issue1456 to be resolved:

* resolve issue1456 by using Tar and GZip haskell modules for dist 
Ignore-this: 88ac3e7b6b545dc284a829ca1c2f6082
msg11390 (view) Author: gh Date: 2010-06-13.17:15:51
The following patch updated the status of issue1456 to be resolved-in-stable:

* resolve issue1456 by using Tar and GZip haskell modules for dist 
Ignore-this: 88ac3e7b6b545dc284a829ca1c2f6082
History
Date User Action Args
2009-04-30 19:28:17duncan.couttscreate
2009-05-01 02:06:22gwernsetstatus: unread -> unknown
nosy: + gwern
messages: + msg7781
2009-05-01 08:47:02duncan.couttssetnosy: kowey, duncan.coutts, simon, thorkilnaur, gwern, dmitry.kurochkin
messages: + msg7782
2009-08-06 14:26:43koweysetpriority: bug
nosy: + jaredj
topic: + ProbablyEasy, Target-2.4
2009-08-17 06:56:25koweysetstatus: unknown -> needs-implementation
nosy: kowey, duncan.coutts, simon, thorkilnaur, gwern, jaredj, dmitry.kurochkin
2009-08-25 17:44:52adminsetnosy: + darcs-devel, - simon
2009-08-27 14:25:14adminsetnosy: kowey, darcs-devel, duncan.coutts, thorkilnaur, gwern, jaredj, dmitry.kurochkin
2009-09-14 10:45:57koweysettopic: + Target-2.5, - Target-2.4
nosy: kowey, darcs-devel, duncan.coutts, thorkilnaur, gwern, jaredj, dmitry.kurochkin
2009-10-24 00:31:43adminsetnosy: + duncan, - duncan.coutts
2010-03-21 14:18:01ghsetstatus: needs-implementation -> resolved
nosy: + gh
messages: + msg10378
2010-06-13 17:15:52ghsetstatus: resolved -> resolved-in-stable
messages: + msg11390
2010-06-15 20:51:49adminsetmilestone: 2.5.0
2010-06-15 20:59:05adminsettopic: - Target-2.5
2010-06-15 22:14:17adminsetstatus: resolved-in-stable -> resolved
2010-06-15 22:14:17adminsetresolvedin: 2.5.0