Giter Site home page Giter Site logo

arcat's People

Watchers

 avatar  avatar  avatar

arcat's Issues

arcat produces ar archives that can't be read by llvm-ar

GNU ar uses a trailing slash to denote the end of a long file name (see byte offset 5a):

$ echo "test a file with a long filename" > test_long_filename.txt
$ ar r test-gnu.ar test_long_filename.txt
$ xxd test-gnu.ar
00000000: 213c 6172 6368 3e0a 2f2f 2020 2020 2020  !<arch>.//
00000010: 2020 2020 2020 2020 2020 2020 2020 2020
00000020: 2020 2020 2020 2020 2020 2020 2020 2020
00000030: 2020 2020 2020 2020 3234 2020 2020 2020          24
00000040: 2020 600a 7465 7374 5f6c 6f6e 675f 6669    `.test_long_fi
00000050: 6c65 6e61 6d65 2e74 7874 2f0a 2f30 2020  lename.txt/./0
00000060: 2020 2020 2020 2020 2020 2020 3020 2020              0
00000070: 2020 2020 2020 2020 3020 2020 2020 3020          0     0
00000080: 2020 2020 3634 3420 2020 2020 3333 2020      644     33
00000090: 2020 2020 2020 600a 7465 7374 2061 2066        `.test a f
000000a0: 696c 6520 7769 7468 2061 206c 6f6e 6720  ile with a long
000000b0: 6669 6c65 6e61 6d65 0a0a                 filename..

arcat omits this trailing slash (again, see byte offset 5a):

$ plz-out/bin/_please/arcat ar --srcs=test_long_filename.txt --out=test-arcat.ar
$ xxd test-arcat.ar
00000000: 213c 6172 6368 3e0a 2f2f 2020 2020 2020  !<arch>.//
00000010: 2020 2020 2020 2020 2d36 3231 3335 3539          -6213559
00000020: 3638 3030 3020 2020 2020 3020 2020 2020  68000     0
00000030: 3130 3034 3230 2020 3233 2020 2020 2020  100420  23
00000040: 2020 600a 7465 7374 5f6c 6f6e 675f 6669    `.test_long_fi
00000050: 6c65 6e61 6d65 2e74 7874 0a0a 2f30 2020  lename.txt../0
00000060: 2020 2020 2020 2020 2020 2020 3934 3636              9466
00000070: 3834 3830 3020 2020 3020 2020 2020 3020  84800   0     0
00000080: 2020 2020 3130 3036 3634 2020 3333 2020      100664  33
00000090: 2020 2020 2020 600a 7465 7374 2061 2066        `.test a f
000000a0: 696c 6520 7769 7468 2061 206c 6f6e 6720  ile with a long
000000b0: 6669 6c65 6e61 6d65 0a0a                 filename..

GNU ar seems to be forgiving about it being missing:

$ ar tv test-arcat.ar
rw-rw-r-- 0/0     33 Jan  1 00:00 2000 test_long_filename.txt

but llvm-ar isn't:

$ llvm-ar tv test-arcat.ar
llvm-ar: truncated or malformed archive (string table at long name offset 0 not terminated).

OVERVIEW: LLVM Archiver
[...]

The LLVM source confirms that the missing trailing slash in the file name is the cause of the error.

--strip_py doesn't strip when concatenating dependencies

When we pass --strip_py to a python binary, one might expect all .py files to be stripped, not just the main file passed to the binary. This isn't true as these dependencies are concatenated directly onto the resulting zip. We would need to unpack them, and re-pack the pex file to do this though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.