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

Support systems with very old tar implementations. #228

Closed
plicease opened this issue Sep 8, 2020 · 6 comments
Closed

Support systems with very old tar implementations. #228

plicease opened this issue Sep 8, 2020 · 6 comments
Labels
🚉Platform Specific Often Windows lol, but could be something else

Comments

@plicease
Copy link
Member

plicease commented Sep 8, 2020

Systems that use the "original" tar v7 format cannot grock the tarball produced by AB, because it has files with paths longer than 99 characters.

https://www.gnu.org/software/tar/manual/html_section/tar_67.html

HP-UX is apparently an affected system. I think just making the paths shorter should allow GNU tar to produce tarballs that the affected systems can read. If so then we should make the paths shorter, and add a test to ensure that paths are kept under 99 characters long. Can double check by trying to create a tarball with the --format v7 option with GNU tar. Supplying this option to a read of the tarball with GNU tar doesn't seem to reproduce the error seen on HP-UX.

✅ starscream% tar -cf Alien-Build-2.29.tar --format v7 Alien-Build-2.29
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/include/ffitarget.h: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/debug/bin/libffi.pdb: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/debug/bin/libffi.dll: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/debug/lib/libffi.lib: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/share/libffi/libffiTargets-debug.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/share/libffi/vcpkg_abi_info.txt: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/share/libffi/libffiTargets.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/share/libffi/libffiConfigVersion.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/share/libffi/libffiTargets-release.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/share/libffi/libffiConfig.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x86-windows/share/libffi/copyright: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/lz4_1.9.2_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/liblzma_5.2.4-4_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/libressl_2.9.1-2_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/xxhash_0.7.0_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/zlib_1.2.11-6_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/libffi_3.3_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/bzip2_1.0.6-5_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/libarchive_3.4.1_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/libxml2_2.9.9-5_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/lzo_2.10-4_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/libffi_3.3_x86-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/libiconv_1.16-1_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/openssl_1.1.1d_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/vcpkg/info/curl_7.68.0-1_x64-windows.list: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/include/ffitarget.h: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/debug/bin/libffi.pdb: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/debug/bin/libffi.dll: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/debug/lib/libffi.lib: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/share/libffi/libffiTargets-debug.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/share/libffi/vcpkg_abi_info.txt: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/share/libffi/libffiTargets.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/share/libffi/libffiConfigVersion.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/share/libffi/libffiTargets-release.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/share/libffi/libffiConfig.cmake: file name is too long (max 99); not dumped
tar: Alien-Build-2.29/corpus/alien_build_plugin_probe_vcpkg/root2/installed/x64-windows/share/libffi/copyright: file name is too long (max 99); not dumped
tar: Exiting with failure status due to previous errors
@plicease
Copy link
Member Author

plicease commented Sep 8, 2020

Ah. Looks like bsdtar can be coerced into emitting a diagnostic on filenames that are too long, but, but it looks like it creates a tarball with truncated filenames and worse, doesn't exit with an error:

✅ starscream% bsdtar -cf Alien-Build-2.29.tar --format v7 Alien-Build-2.29
: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long: Pathname too long%

@Tux
Copy link

Tux commented Sep 9, 2020

You will need something like

    macro        => { TARFLAGS   => "--format=ustar -c -v -f" },

in your Makefile.PL to address the issue for all non-GNU OS's/tar versions

@plicease
Copy link
Member Author

plicease commented Sep 9, 2020

@Tux Please try:

https://cpan.metacpan.org/authors/id/P/PL/PLICEASE/Alien-Build-2.31_01.tar.gz

This identifies as simply POSIX tar archive instead of POSIX tar archive (GNU).

✅ starscream% file ~/Downloads/Alien-Build-2.3*.tar
/home/ollisg/Downloads/Alien-Build-2.30_01.tar: POSIX tar archive (GNU)
/home/ollisg/Downloads/Alien-Build-2.31_01.tar: POSIX tar archive

If this works, then it looks like as a workaround I can use Dist-Zilla sans Archive::Tar::Wrapper. I suspect this may work because I think Dist-Zilla falls back on Archive::Tar if it doesn't have Archive::Tar::Wrapper. I don't use EUMM for authoring so amending Makefile.PL isn't an option.

If this doesn't work then it would be helpful to find a way to reproduce this error using Free or OpenSource tools, as like most people I do not have access to HP-UX machines.

A way to reproduce this using Free or OpenSource tools may also help when reporting this to Dist-Zilla and/or Archive-Tar-Wrapper.

@plicease
Copy link
Member Author

[3:00:22 am] <[Tux]> plicease, looks sane

@plicease
Copy link
Member Author

Waiting for a response
rjbs/Dist-Zilla#662
glasswalk3r/archive-tar-wrapper-perl#18

@plicease
Copy link
Member Author

This should be resolved in 2.32 as workarounds have enacted in the release process while we wait for Dist-Zilla or Archive-Tar-Wrapper to respond.

@Tux please open issues for the other test fails you were seeing on HP-UX. If you can provide the verbose output (prove -lvm testname) that would be helpful.

@plicease plicease added the 🚉Platform Specific Often Windows lol, but could be something else label Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚉Platform Specific Often Windows lol, but could be something else
Development

No branches or pull requests

2 participants