This is an archive of the discontinued LLVM Phabricator instance.

Add a class to create a tar archive file.
ClosedPublic

Authored by ruiu on Dec 23 2016, 11:39 PM.

Details

Summary

In LLD, we create cpio archive files for --reproduce command.
cpio was not a bad choice because it is very easy to create, but
it was sometimes hard to use because people are not familiar with
cpio command.

I noticed that creating a tar archive isn't as hard as I thought.
So I implemented it in this patch.

Create a tar archive instead of a cpio for --reproduce.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu updated this revision to Diff 82436.Dec 23 2016, 11:39 PM
ruiu retitled this revision from to Add a class to create a tar archive file..
ruiu updated this object.
ruiu added reviewers: pcc, rafael.
ruiu added a subscriber: llvm-commits.
silvas added a subscriber: silvas.Dec 24 2016, 6:43 PM

This is a good idea. Tar is a much more common format that users will be more familiar with. I'm not an expert on Tar files, so I can't review that part of the patch, but hopefully the bots will show if any tar implementations don't like the files we produce.

Sorry, I know this is a bit unrelated to this patch per se, but one thing that has always bothered me is that --reproduce foo doesn't produce a file called foo; this is very non-unixy. I think it sort of made sense for cpio since that is a less known format, but I think that .tar is common enough that we can expect people to write --reproduce foo.tar. That makes any examples self-documenting (users will read --reproduce repro.tar and understand that it creates a tar file; rather than --reproduce repro and not know what file format it is). What do you think?

ruiu updated this revision to Diff 82459.Dec 25 2016, 12:44 AM
  • Split into two patches for LLVM and LLD.
ruiu added a comment.Dec 25 2016, 12:46 AM

I think not adding an extension is a good idea. I made that change in D28103.

This revision was automatically updated to reflect the committed changes.