[PATCH] D19872: Produce cpio files for --reproduce

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 08:27:18 PDT 2016


rafael created this revision.
rafael added a reviewer: ruiu.
rafael added a subscriber: llvm-commits.

We want --reproduce to
* not rewrite scripts and thin archives
* work with absolute paths

Given that, it pretty much has to create a full directory tree. On windows that is problematic because of the very short maximum path limit. On most cases users can still work around it with "--repro c:\r", but that is annoying and not viable for automated testing.

We then need to produce some form of archive with the files. The first option that comes to mind is .a files since we already have code for writing them. There are a few problems with them

* The format has a dedicated string table, so we cannot start writing it until all members are known.
* Regular implementations don't support creating directories. We could make llvm-ar support that, but that is probably not a good idea.

The next natural option would be tar. The problem is that to support long path names (which is how this started) it needs  a "pax extended header" making this an annoying format to write.

The next option I looked at seems a natural fit: cpio files.

They are available on pretty much every unix, support directories and long path names and are really easy to write. The only slightly annoying part is a terminator, but at least gnu cpio only prints a warning if it is missing, which is handy for crashes. This patch still makes an effort to always create it.




http://reviews.llvm.org/D19872

Files:
  ELF/Driver.cpp
  ELF/Driver.h
  ELF/DriverUtils.cpp
  ELF/Error.cpp
  ELF/Error.h
  ELF/InputFiles.cpp
  test/ELF/reproduce-error.s
  test/ELF/reproduce-linkerscript.s
  test/ELF/reproduce-thin-archive.s
  test/ELF/reproduce.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19872.56002.patch
Type: text/x-patch
Size: 9901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160503/766db51c/attachment.bin>


More information about the llvm-commits mailing list