Skip to content
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

Support for pax global extended headers #119

Merged
merged 6 commits into from
Apr 27, 2023

Conversation

MisterDA
Copy link
Contributor

@MisterDA MisterDA commented Mar 20, 2023

Unfinished work.
PoC for supporting pax global extended headers. They introduce global state, which needs to be threaded to calls to HR.read, breaking the API.
The change is somewhat important, so I haven't completed the work.
Any thoughts? :-)

Copy link
Member

@reynir reynir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would fix #120. I will need to read up on this first

lib/tar.ml Outdated Show resolved Hide resolved
@MisterDA MisterDA force-pushed the pax-global-extended-headers branch 3 times, most recently from fab7533 to 810e173 Compare March 22, 2023 06:27
@MisterDA MisterDA marked this pull request as ready for review March 22, 2023 06:30
@MisterDA MisterDA changed the title [RFC] Support for pax global extended headers Support for pax global extended headers Mar 22, 2023
@MisterDA MisterDA force-pushed the pax-global-extended-headers branch from 810e173 to bb56a58 Compare April 3, 2023 09:49
@MisterDA
Copy link
Contributor Author

MisterDA commented Apr 3, 2023

Rebased on 2.4.0.

lib/tar.ml Show resolved Hide resolved
Copy link
Member

@reynir reynir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I made a few comments.

I think this is nice. I am not sure what the ~level argument should mean. Should we not handle pax extended headers when the level is V7 for example? This seems to not be the case in the existing code, but maybe it should be.

lib/tar.mli Outdated Show resolved Hide resolved
lib/tar.ml Outdated Show resolved Hide resolved
lib/tar.ml Outdated Show resolved Hide resolved
lib/tar.ml Outdated Show resolved Hide resolved
lib/tar.ml Outdated Show resolved Hide resolved
lib/tar.ml Show resolved Hide resolved
@reynir reynir merged commit cffe194 into mirage:main Apr 27, 2023
@reynir
Copy link
Member

reynir commented Apr 27, 2023

Thanks!

@MisterDA MisterDA deleted the pax-global-extended-headers branch April 27, 2023 15:38
>>= fun () ->
really_write fd (Header.zero_padding pax)

let write ?level ?global header fd =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reading this again I'm not sure I like the ?global argument. It's unclear if this is to keep track of the global extended header state (which it is not), and passing the same global value would lead to writing the same global extended header multiple times. This interface also doesn't allow writing an "empty" tar archive with just a comment, for example.

I think I would prefer another function write_global that takes a Tar.Header.Extended.t and does the required serializations and writes it to output.

@reynir reynir mentioned this pull request May 17, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants