-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re #13 Add partial support for pax header blocks #34
Conversation
a7ed2fc
to
75a4f78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with Pax myself, but this looks reasonable. My only suggestion would be adding a test case that includes a Pax-enabled tar file so we can confirm this is working as expected. But if you'd prefer that I merge as-is, I'm OK with that too, just let me know.
@snoyberg, I'll aim to add a test. Separately, looking at the CI, would you be interested in another pull request that (a) moves CI onto GitHub Actions; and/or (b) tests against more recent versions of GHC (given what you explained at: https://www.snoyman.com/blog/babies-oss-maintenance/)? |
yes and yes, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just holding off merge because of the version number question.
@@ -1,3 +1,10 @@ | |||
## 0.4.0 - YYYY-MM-DD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this is now marked as a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was this: the Haskell PVP decision tree says a major bump is necessary if the 'behaviour' of any exported function changes. Here, untarChunks
used to produce all ustar
chunks (including those chunks used to specify pax header blocks and extended headers) and now it produces the chunks that remain after the application of any pax header blocks and extended headers. That seemed to me to be a 'change in behaviour' rather than just a 'bug fix', and is why I export untarChunksRaw
(in order to preserve the previous behaviour for people who may actually have needed it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hear that. I'd interpret it differently. If there was a function that would previously fail on some input but now can successfully parse it, that's an improvement, not a breaking change. Maybe that isn't the case here. Either way, I'll defer to your judgement on whether a major version bump is warranted. Want me to merge and release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@snoyberg, if you could merge and release, that would be good.
Also adds tests to test suite.
I have rebased on the |
Uploaded tar-conduit 0.4.0 to Hackage. |
Relies on the extended description of the pax interchange format at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html.
The basic idea is that
untarChunks
already produces a stream ofTarChunk
that include the pax header block and pax extended header information, soapplyPaxChunkHeaders
consumes thoseTarChunk
to produceTarChunk
in which that information has been applied.The pax keywords that are supported ('comment', 'gid', 'gname', 'linkpath', 'path', 'size', 'uid' and 'uname') are those that do not need any change to the
Header
data constructor. (In practice, the motivation for this was thepath
keyword and long directory names and filenames. See commercialhaskell/stack#6186 (comment))Tested (in a limited way) for the 'path' keyword (see https://github.com/mpilgrem/tar-pax-conduit, where the code was first formulated). The other keywords are based on my reasoning only.
EDIT: I re-thought the API.
untarChunks
anduntar
now produce 'processed'TarChunks
anduntarChunksRaw
anduntarRaw
behave like the previous version ofuntarChunks
anduntar
. I assume that the Haskell PVP requires a major version bump because of the changed behaviour.