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

Pathname too long #10

Closed
hythm7 opened this issue Jun 21, 2019 · 3 comments
Closed

Pathname too long #10

hythm7 opened this issue Jun 21, 2019 · 3 comments

Comments

@hythm7
Copy link

hythm7 commented Jun 21, 2019

Getting Pathname too long error in method write-header when archiving GCC or libstdc++

Sample file that causes the error:

"/tmp/ii1HMTTEd8/gcc-9.1.0-x86_64-1-tagid/tools/include/c++/9.1.0/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp".IO
Error 4294967271: Pathname too long

I'm not sure if this is really a long number of characters in pathname or may because of something to do with the characters them selves in the pathname, as I noticed that the files that causes this error is located inside directories that end with _

I will test again when get back home, since I just updated my work computer and that might have caused the issue.

@hythm7
Copy link
Author

hythm7 commented Jun 22, 2019

I tested on home computer and I got the same error, However, I'm not able to reproduce it when using examples/archive.p6 /tmp/fileo.tar.xz $(find compiled-gcc-dir -type f) . at this point I think it might be something wrong with my code. I will do more testing and will post here when I have update.

@hythm7
Copy link
Author

hythm7 commented Jun 22, 2019

it looks like the format v7tar is the culprit, changing the format to gnutar solved the issue.

I was able to reproduce by slighly modified `examples/archive.p6 to:

 #!/usr/bin/env perl6

use lib 'lib';
use Archive::Libarchive;

sub MAIN($fileo! where { ! .IO.f || die "file '$fileo' already present" },
         *@filei where { $_.all ~~ .IO.f || die "One of ( $_ ) not found" } )
{
  my Archive::Libarchive $a .= new: operation => LibarchiveWrite,
    format => 'v7tar', filters => ['xz'],
    file => $fileo;
  for @filei -> $file {
    try {
      $a.write-header($file, uname => 'user1', gname => 'group1');
      $a.write-data($file);
      CATCH {
        default { .Str.say }
      }
    }
  }
  $a.close;
}

and running:


hythm@galaxy$ perl6 ~/dev/perl6-Archive-Libarchive/examples/archive.p6 /tmp/fileo.tar.xz tools/x86_64-galaxy-linux-gnu/include/c++/9.1.0/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
Error -25: Pathname too long

@hythm7 hythm7 closed this as completed Jun 22, 2019
@frithnanth
Copy link
Owner

Yes, the v7tar format has some limitations.
See https://github.com/libarchive/libarchive/blob/master/libarchive/archive_write_set_format_v7tar.c:
#define V7TAR_name_size 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants