You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
$ 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
The text was updated successfully, but these errors were encountered:
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:
WORKSPACE:
gcc.BUILD (doesn't matter much):
Checking:
The text was updated successfully, but these errors were encountered: