Skip to content

Commit 44330fe

Browse files
dolmenLeont
authored andcommitted
make_tarball: workaround for broken tar on Darwin
On OS X /usr/bin/tar bundles extended attributes that trigger warnings when the tarball is unpacked with GNU tar. See http://cpants.cpanauthors.org/kwalitee/no_pax_headers So when the tarball is made using a tar executable on Darwin we take care of setting the appropriate environment variables to avoid the broken behaviour. The fix is the same as in ExtUtils::MM_Darwin.
1 parent e1429a5 commit 44330fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Module/Build/Base.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4946,6 +4946,14 @@ sub make_tarball {
49464946

49474947
if ($self->{args}{tar}) {
49484948
my $tar_flags = $self->verbose ? 'cvf' : 'cf';
4949+
4950+
# See ExtUtils::MM_Darwin
4951+
# 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE.
4952+
# 10.5 wants COPYFILE_DISABLE.
4953+
# So just set both.
4954+
local $ENV{COPY_EXTENDED_ATTRIBUTES_DISABLE} = 1 if $^O eq 'darwin';
4955+
local $ENV{COPYFILE_DISABLE} = 1 if $^O eq 'darwin';
4956+
49494957
$self->do_system($self->split_like_shell($self->{args}{tar}), $tar_flags, "$file.tar", $dir);
49504958
$self->do_system($self->split_like_shell($self->{args}{gzip}), "$file.tar") if $self->{args}{gzip};
49514959
} else {

0 commit comments

Comments
 (0)