Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bazel fails to properly extract some tarballs #574

Closed
bsilver8192 opened this issue Nov 8, 2015 · 0 comments
Closed

Bazel fails to properly extract some tarballs #574

bsilver8192 opened this issue Nov 8, 2015 · 0 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug
Milestone

Comments

@bsilver8192
Copy link
Contributor

Bazel extracts some files from some tarballs as empty which should not be. The problematic files appear to often (always?) be large files which are duplicated in the tarball.

I think I've solved this problem in the past by unpacking and repacking the archive, but that didn't work last time I tried it (I think I was using an older tar when it worked).

An easy workaround is to unpack the tarball and replace the files Bazel doesn't like with symlinks to the duplicates.

For example, using the latest Linaro GCC (translated from .xz to .gz without touching the .tar itself) results in gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc being extracted as empty while using tar on the command line (standard Debian Jessie) shows that as being a large binary.

Command to create the file for testing:

$ wget https://releases.linaro.org/components/toolchain/binaries/latest-5.1/arm-linux-gnueabihf/gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf.tar.xz  -O - | xzcat | gzip > gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf.tar.gz

Extracting it on the command line:

$ wget https://releases.linaro.org/components/toolchain/binaries/latest-5.1/arm-linux-gnueabihf/gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf.tar.xz -O - | tar xJ gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
[...]
$ ls -l gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
-rwxr-xr-x 2 brian brian 2918784 Oct 14 18:23 gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc

WORKSPACE:

new_http_archive(
  name = 'gcc_repo',
  # I made the file generated above accessible here on my machine.
  url = 'http://localhost:8000/gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf.tar.gz',
  sha256 = 'cf2393e49680c8b28c8feae55c6d2fac513e5f2d24e4b2640284e122bed57594',
  build_file = 'gcc.BUILD',
)

gcc.BUILD (doesn't matter much):

exports_files(['bin'])

Checking:

$ bazel build @gcc_repo//...
[...]
$ ls -l bazel-out/../../external/gcc_repo/gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
-rwxr-xr-x 1 brian brian 0 Nov  8 03:43 bazel-out/../../external/gcc_repo/gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
@damienmg damienmg added type: bug P2 We'll consider working on this in future. (Assignee optional) labels Nov 12, 2015
@kchodorow kchodorow added this to the 0.6 milestone Jun 15, 2016
bazel-io pushed a commit that referenced this issue Sep 8, 2016
…ompresses tarballs.

Issue link: #574

--
MOS_MIGRATED_REVID=132434278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants