Skip to content

Commit

Permalink
investigate failure to build XSBar
Browse files Browse the repository at this point in the history
  • Loading branch information
rschupp committed Mar 11, 2024
1 parent 69ca065 commit 6e84b15
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 43 deletions.
8 changes: 8 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
1.062_002 2024-03-11

Devel release, more debug output.

1.062_001 2024-03-10

Devel release, investigate problems with t/b7-xs-cross.t

1.062 2024-03-05

- Fix #84: PAR::Packer packaged scripts lose the ability to parse UTF-8 arguments from the command line
Expand Down
2 changes: 1 addition & 1 deletion lib/PAR/Packer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use 5.008001;
use strict;
use warnings;

our $VERSION = '1.063';
our $VERSION = '1.062_002';

=head1 NAME
Expand Down
103 changes: 61 additions & 42 deletions t/87-xs-cross.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,42 @@ plan skip_all => "Tests only relevant on Windows" unless $^O eq 'MSWin32';
# and e.g. Gtk2.xs.dll calls functions in Pango.xs.dll and Cairo.xs.dll.


### debug helpers (Windows only)
#use File::Find;
#use IPC::Run3;
#use Module::ScanDeps;
#
#sub show_tree
#{
# my ($top) = @_;
# my @files;
# find(sub { push @files, $File::Find::name if -f $_ }, $top);
# diag(join("\n", "--- $top ---", (sort @files), "---"));
#}
#
#sub show_dlls
#{
# my ($install_base, $mod_name) = @_;
# my @mod_parts = split("::", $mod_name);
# my $mod_dll = catfile($install_base, qw(lib perl5), $Config{archname},
# qw(auto), @mod_parts, "$mod_parts[-1].$Config{dlext}");
# diag("XS module $mod_name => $mod_dll");
#
# my ($out, $err);
# run3([qw(objdump -ax), $mod_dll], \undef, \$out, \$err);
# if ($? != 0)
# {
# diag(qq["objdump -ax $mod_dll" failed:\n$err]);
# return;
# }
# run3([$^X, "-nE", "print if /DLL Name.*/"], \$out, \$err, \$err);
# if ($? != 0)
# {
# diag(qq[Extracting DLL names from $mod_dll failed:\n$err]);
# return;
# }
# diag("$mod_dll links to:\n$err");
#}
## debug helpers (Windows only)
use File::Find;
use IPC::Run3;
use Module::ScanDeps;

sub show_tree
{
my ($top) = @_;
my @files;
find(sub { push @files, $File::Find::name if -f $_ }, $top);
diag(join("\n", "--- $top ---", (sort @files), "---"));
}

sub show_dlls
{
my ($install_base, $mod_name) = @_;
my @mod_parts = split("::", $mod_name);
my $mod_dll = catfile($install_base, qw(lib perl5), $Config{archname},
qw(auto), @mod_parts, "$mod_parts[-1].$Config{dlext}");
diag("XS module $mod_name => $mod_dll");

my ($out, $err);
run3([qw(objdump -ax), $mod_dll], \undef, \$out, \$err);
if ($? != 0)
{
diag(qq["objdump -ax $mod_dll" failed:\n$err]);
return;
}
run3([$^X, "-nE", "print if /DLL Name.*/"], \$out, \$err, \$err);
if ($? != 0)
{
diag(qq[Extracting DLL names from $mod_dll failed:\n$err]);
return;
}
diag("$mod_dll links to:\n$err");
}


my @checks = (
Expand Down Expand Up @@ -106,13 +106,32 @@ foreach my $mod (qw(XSQuux XSBar))
{
diag("build and install $mod");
chdir(catdir($cwd, qw(t data), $mod)) or die "can't chdir to $mod source: $!";
run_ok($^X, "Makefile.PL", "INSTALL_BASE=$base");
run_ok($make);
run_ok($make, "install");
run_ok($make, "clean");
# DEBUG show_tree($base);
# DEBUG show_dlls($base, $mod);
my ($out, $err);

diag(qq[run "$^X Makefile.PL INSTALL_BASE=$base"]);
($out, $err) = run_ok($^X, "Makefile.PL", "INSTALL_BASE=$base");
diag("OUT:\n$out\nERR:\n$err\n");
foreach my $file (qw(Files.pm Makefile))
{
local $/ = undef; open my $fh, "<", $file or die "can't open $file";
diag(join("\n", "--- $file ---", <$fh>, "---"));
close $fh;
}

diag(qq[run "$make"]);
($out, $err) = run_ok($make);
diag("OUT:\n$out\nERR:\n$err\n");

diag(qq[run "$make install"]);
($out, $err) = run_ok($make, "install");
diag("OUT:\n$out\nERR:\n$err\n");

diag(qq[run "$make clean"]);
($out, $err) = run_ok($make, "clean");
diag("OUT:\n$out\nERR:\n$err\n");

show_tree($base);
show_dlls($base, $mod);
}

chdir($cwd) or die "can't chdir back to build dir: $!";
Expand Down
7 changes: 7 additions & 0 deletions t/data/XSQuux/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ use 5.008009; # should match MIN_PERL_VERSION in toplevel Makefile.PL
use ExtUtils::MakeMaker;
use ExtUtils::Depends;

print STDERR "ExtUtils::MakeMaker::VERSION => $ExtUtils::MakeMaker::VERSION\n";
print STDERR "ExtUtils::Depends::VERSION => $ExtUtils::Depends::VERSION\n";

my $pkg = ExtUtils::Depends->new(qw(XSQuux));
$pkg->add_xs(qw(XSQuux.xs));
$pkg->add_pm('XSQuux.pm' => '$(INST_LIB)/XSQuux.pm');
Expand All @@ -18,3 +21,7 @@ WriteMakefile(
$pkg->get_makefile_vars(),
clean => { FILES => "Files.pm" }, # must come after get_makefile_vars
);

use Data::Dumper;
my %vars = $pkg->get_makefile_vars();
print STDERR "get_makefile_vars => ", Dumper(\%vars);

0 comments on commit 6e84b15

Please sign in to comment.