please-build / arcat Goto Github PK
View Code? Open in Web Editor NEWTool for concatenating / creating / extracting zip/tar/ar archives
License: Apache License 2.0
Tool for concatenating / creating / extracting zip/tar/ar archives
License: Apache License 2.0
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.