aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/singlejar
Commit message (Collapse)AuthorAge
* Internal changeGravatar Googler2017-08-07
| | | | PiperOrigin-RevId: 164436730
* Include <cinttypes> instead of <stdint.h>Gravatar Damien Martin-Guillerez2017-07-27
| | | | | | | | | | | cinttypes is the C++ header that should replace stdint.h. Not using the correct header was leading to compilation error on CentOS 6.7 Fixes #3455. To be cherry-picked for #3375. Change-Id: I6df22134a4a4902ec9fa7ecdfaeb5408eacf3564 PiperOrigin-RevId: 163334651
* fix singlejar signedness problemsGravatar Benjamin Peterson2017-07-05
| | | | | | | | | | | | while (total_written < count) { ~~~~~~~~~~~~~~^~~~~~~ Most of these can be fixed by simply by storing the return value of various functions in the right variable type. E.g., cen_offset32 can naturally be stored in uin32_t rather than uint64_t. Change-Id: I9f188ca541e4fe2587c636670807f56887e1655e PiperOrigin-RevId: 160897953
* Make source code of singlejar and ijar available from @bazel_tools. ,Gravatar Xin Gao2017-06-22
| | | | | | | | | | Please refer to patch set 9 and its CI run for usage and test results. In practice, users should create their own java_toolchain rule in their project's BUILD file, and set the two attributes like above instead of modifying //tools/jdk/BUILD. Change-Id: Ic880f243086b00a58d453a8139ba4c957fe54bc7 PiperOrigin-RevId: 159694649
* Make singlejar aware of FreeBSDGravatar Klaus Aehlig2017-06-09
| | | | | | | | | | | | | The C implementation of singlejar verifies that it is built for a supported system; currently those are 64-bit linux and apple systems. However, the code is portable enough that it can easily be adapted to run on 64-bit FreeBSD systems as well. In fact, only the path of a single header file is different, and we need to link with -lm. Fixes #3096. Change-Id: Id69542ad940f1161aceb55eb8f5dabda2f486747 PiperOrigin-RevId: 158533955
* Define __STDC_FORMAT_MACROS to 1 in singlejarGravatar Damien Martin-Guillerez2017-05-08
| | | | | | | Build on CentOS was failing because of missing macros, see http://ci.bazel.io/job/bazel-docker-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=docker/557/console. Change-Id: I1b7b2ef2b1f26d4dac5439f4fcd01e2ef6553dcf PiperOrigin-RevId: 155365288
* Make singlejar's flag.xml merging idempotentGravatar cushon2017-04-25
| | | | | | | | Previously running singlejar over the same flags.xml multiple times would add start/end tags each time, resulting in repeated top-level tags. PiperOrigin-RevId: 154126431
* Support directories in --resourcesGravatar cushon2017-04-24
| | | | PiperOrigin-RevId: 153787279
* Create parent directories for resourcesGravatar cushon2017-04-04
| | | | | | | | | This makes singlejar's handling of resources consistent with JavaBuilder, and allows the JavaBuilder resource handling to be replaced by a singlejar action that adds resources to library jars separately from compilation (see unknown commit). PiperOrigin-RevId: 152082884
* Singlejar: Windows-aware jar tool pathGravatar Laszlo Csomor2017-03-09
| | | | | | | | See https://github.com/bazelbuild/bazel/issues/2107 -- PiperOrigin-RevId: 149626394 MOS_MIGRATED_REVID=149626394
* Bazel client: simplify {Read,Write}File semanticsGravatar Laszlo Csomor2017-03-01
| | | | | | | | | | | | | | | | Introduce a platform-specific file handle type (HANDLE on Windows, int on Linux/Darwin/FreeBSD) so we can get rid of the read_func and write_func functions, since they are always the same everywhere. Also include file_platform.h in file.h, since they are logically the same file (file_platform.h is just the platform-specific part of file.h). -- PiperOrigin-RevId: 148892736 MOS_MIGRATED_REVID=148892736
* Avoid using //external labels; use @local_jdk// insteadGravatar Ulf Adams2017-02-14
| | | | | | -- PiperOrigin-RevId: 147449557 MOS_MIGRATED_REVID=147449557
* Handle huge (>4GB) output jars.Gravatar Sasha Smundak2017-01-04
| | | | | | | | RELNOTES: singlejar can now create jar files larger than 4GB. -- PiperOrigin-RevId: 143588105 MOS_MIGRATED_REVID=143588105
* Power supportGravatar Nishidha Panpaliya2016-12-21
| | | | | | | | | Closes #2139. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2139 PiperOrigin-RevId: 142570236 MOS_MIGRATED_REVID=142570236
* move MakeDirectories() into file_platform.hGravatar Thiago Farina2016-12-07
| | | | | | | | | | | | | | This way we can remove the dependency on blaze_util (which is Bazel's client specific) from singlejar. This work was made possible by commit 49970e0136d0: ("Bazel client: platform-specific {Read,Write}File"). -- Change-Id: I6e95fb9119a271e4d48cbe2eefc1d5354ee188aa Reviewed-on: https://cr.bazel.build/7650 PiperOrigin-RevId: 141294165 MOS_MIGRATED_REVID=141294165
* Make token_stream a cc_libraryGravatar Liam Miller-Cushon2016-12-06
| | | | | | -- PiperOrigin-RevId: 141145286 MOS_MIGRATED_REVID=141145286
* Fix typos in usage exampleGravatar Liam Miller-Cushon2016-12-06
| | | | | | -- PiperOrigin-RevId: 141116980 MOS_MIGRATED_REVID=141116980
* Added tests for exportGravatar Kristina Chodorow2016-11-29
| | | | | -- MOS_MIGRATED_REVID=140380336
* Bazel client: platform-specific {Read,Write}FileGravatar Laszlo Csomor2016-11-28
| | | | | | | | | | | | | | | | Move blaze::ReadFile and blaze::WriteFile to file.h and file_platform.h (thus into the blaze_util namespace), and update references. This allows us to implement these methods in a platform-specific way. Also move UnlinkPath. See https://github.com/bazelbuild/bazel/issues/2107 -- MOS_MIGRATED_REVID=140328273
* Bazel client: reduce dependency on POSIX APIGravatar Laszlo Csomor2016-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can now compile blaze_util_windows.cc with MSVC, yay! (when building //src:bazel --cpu=x64_windows_msvc -k). There are a lot of #ifdef's and TODOs so this is a modest victory for now. In this change: - change blaze::MakeDirectories to return bool instead of int, since that's how it was used anyway, and to expect the permission mask as unsigned int instead of mode_t, since the former is good enough and compatible with mode_t on POSIX while mode_t is not defined on Windows - move blaze::MakeDirectories into blaze_util_<platform> - implement envvar-handling in blaze_util_<platform> and use it everywhere See https://github.com/bazelbuild/bazel/issues/2107 -- MOS_MIGRATED_REVID=139887503
* Cut the dependency of singlejar on Bazel (the test still depend on it, but ↵Gravatar Lukacs Berki2016-11-21
| | | | | | | that's OK) -- MOS_MIGRATED_REVID=139774407
* Implement --nocompress_suffixes option.Gravatar Sasha Smundak2016-09-26
| | | | | | | The planned replacement of the ApkBuilder with singlejar uses it. -- MOS_MIGRATED_REVID=134290339
* Add '0xCAFE' extra field to the first entry of the output jar (which is ↵Gravatar Sasha Smundak2016-09-26
| | | | | | | META-INF/). Unix 'file' utility uses it to distinguish jar file from zip file. -- MOS_MIGRATED_REVID=134102453
* Use WriteBytes instead of AppendFile to write entries.Gravatar Sasha Smundak2016-09-22
| | | | | | | | | This improves wallclock times for building deploy jars by ~5%. Also, calculate the length of the Data Descriptor Record more accurately. -- MOS_MIGRATED_REVID=133849413
* Rollback of commit 82d43279f93d95e4c41b4bc598a3cc05ddd1ae1a.Gravatar Laszlo Csomor2016-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks TensorFlow and other Bazel jobs on ci.bazel.io *** Original change description *** Change execution root for external repositories to be ../repo Some of the important aspect of this change: * Remote repos in the execution root are under output_base/execroot/repo_name, so the prefix is ../repo_name (to escape the local workspace name). * Package roots for external repos were previously "output_base/", they are now output_base/external/repo_name (which means source artifacts always have a relative path from their repository). * Outputs are under bazel-bin/external/repo_name/ (or similarly under genfiles). Note that this is a bit of a change from how this was implemented in the previous cl. Fixes #1262. RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Roll forward of bdfd58a. -- MOS_MIGRATED_REVID=133709658
* Change execution root for external repositories to be ../repoGravatar Kristina Chodorow2016-09-20
| | | | | | | | | | | | | | | | | | | | | | | Some of the important aspect of this change: * Remote repos in the execution root are under output_base/execroot/repo_name, so the prefix is ../repo_name (to escape the local workspace name). * Package roots for external repos were previously "output_base/", they are now output_base/external/repo_name (which means source artifacts always have a relative path from their repository). * Outputs are under bazel-bin/external/repo_name/ (or similarly under genfiles). Note that this is a bit of a change from how this was implemented in the previous cl. Fixes #1262. RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Roll forward of bdfd58a. -- MOS_MIGRATED_REVID=133606309
* Fix test for whether the timestamp in the local header needs replacement.Gravatar Googler2016-09-16
| | | | | -- MOS_MIGRATED_REVID=133330857
* Attempt to free wrong buffer.Gravatar Sasha Smundak2016-09-15
| | | | | -- MOS_MIGRATED_REVID=133249476
* Add asmundak to the OWNERS.Gravatar Sasha Smundak2016-09-15
| | | | | -- MOS_MIGRATED_REVID=133247282
* Change C++ singlejar to use stdio for all output, instead of a mix ofGravatar Googler2016-09-14
| | | | | | | | | | | | | | | | | | | | | sendfile() and write() without buffering. sendfile() is not a speedup for typical jar contents; the average compressed class file is less than 2KB, so memcpy()ing the data into a large buffer is cheaper than the extra system calls. The existing non-sendfile code was making four calls to lseek() per archive member. I removed all of those by using pread() or caching the output position. Configure stdio to use a 128KB buffer to make fewer write() calls to the output file. This is a noticeable speedup over the default when writing to a fuse filesystem. (I think this wouldn't be necessary if our fuse filesystems would set st_blksize appropriately in stat() results.) Remove needless thread-hostile calls to umask(). -- MOS_MIGRATED_REVID=133057985
* Allow OutputJar subclass to customize entry handling behavior.Gravatar Sasha Smundak2016-08-31
| | | | | | | RELNOTES: -- MOS_MIGRATED_REVID=131805817
* Add an option to the Concatenator to insert a newline before the contents of ↵Gravatar Sasha Smundak2016-08-31
| | | | | | | | | the merged entry. RELNOTES: -- MOS_MIGRATED_REVID=131731752
* When creating new files, set creator version to 2.0 instead of Unix spec ↵Gravatar Sasha Smundak2016-08-31
| | | | | | | | | 3.0. Otherwise unzip thinks that external_attributes field contains access mode bits and fails to extract. RELNOTES: -- MOS_MIGRATED_REVID=131724308
* Save CEN (Central Directory) offset and size values in the End of Central ↵Gravatar Sasha Smundak2016-08-30
| | | | | | | | | Directory record if possible, even when we create Zip64 End of Central Directory record. It is a workaround for the bug in the Java compiler and 'javah' tool. RELNOTES: -- MOS_MIGRATED_REVID=131681005
* Remove entries' Unix timestamp extra fields when --normalize is present.Gravatar Sasha Smundak2016-08-30
| | | | | | | RELNOTES: -- MOS_MIGRATED_REVID=131607358
* If there are zero bytes to compress, TransientBytes::CompressOut should ↵Gravatar Sasha Smundak2016-08-29
| | | | | | | | | return Z_NO_COMPRESSION immediately. RELNOTES: -- MOS_MIGRATED_REVID=131566325
* When --exclude_build_data option is present, build-data.properties file ↵Gravatar Sasha Smundak2016-08-26
| | | | | | | | | should be copied from the first source archive containing it. RELNOTES: -- MOS_MIGRATED_REVID=131383175
* Add a class to handle Unix timestamp extra field. Gravatar Sasha Smundak2016-08-26
| | | | | | | RELNOTES: -- MOS_MIGRATED_REVID=131379300
* BUILD files changes for commit 0943498edc05ada655cc2862a644071e503dd034.Gravatar Sasha Smundak2016-08-24
| | | | | | | RELNOTES: -- MOS_MIGRATED_REVID=131164513
* Generate Zip64 End Of Central Directory record if the output archive is >4G ↵Gravatar Sasha Smundak2016-08-23
| | | | | | | | | or has >64K entries. RELNOTES: -- MOS_MIGRATED_REVID=131069270
* Fix empty archive handling.Gravatar Sasha Smundak2016-08-23
| | | | | | | RELNOTES: -- MOS_MIGRATED_REVID=131046379
* Fixes ci breakage in sandbox for //src/tools/singlejar:stored_jarGravatar Yue Gan2016-08-22
| | | | | -- MOS_MIGRATED_REVID=130936320
* The value of the --resources flag is <PATH>:<NAME>, not <NAME>:<PATH>Gravatar Sasha Smundak2016-08-19
| | | | | -- MOS_MIGRATED_REVID=130725849
* Implement --compression and --dont_change_compression.Gravatar Sasha Smundak2016-08-18
| | | | | -- MOS_MIGRATED_REVID=130541462
* Preparation for enabling --compression/--dont_change_compression options:Gravatar Sasha Smundak2016-08-17
| | | | | | | Allow combiners to copy the payload out instead of compressing it. -- MOS_MIGRATED_REVID=130419840
* Test for META-INF/services/* and META-INF/spring.handlers and ↵Gravatar Sasha Smundak2016-08-17
| | | | | | | META-INF/spring.schemas. -- MOS_MIGRATED_REVID=130414929
* Implement --normalize option. Refactor file writing code in OutputJar. ↵Gravatar Sasha Smundak2016-08-16
| | | | | | | Refactor test file preparation code in OutputJarSimpleTest. -- MOS_MIGRATED_REVID=130148073
* Add CreateTextFile to test_util.Gravatar Sasha Smundak2016-08-16
| | | | | -- MOS_MIGRATED_REVID=130084544
* Implement --include_prefixes.Gravatar Sasha Smundak2016-08-16
| | | | | -- MOS_MIGRATED_REVID=130083166
* Provide ExtraCombiner method.Gravatar Sasha Smundak2016-08-11
| | | | | -- MOS_MIGRATED_REVID=129870872