http://qs321.pair.com?node_id=11105086


in reply to Re^9: Need help debugging Wx on Strawberry Perl 5.26.1
in thread Need help debugging Wx on Strawberry Perl 5.26.1

Splendid!

I've attached a patch to RT #49433, which should fix that build issue when it's applied. At least, that patch works for me on Windows 10 with a sh.exe in a directory listed in $ENV{PATH}. Where, by "works" I mean that the Build.PL bails out with an error message instructing me to edit $ENV{PATH}.

From d64302f8b45901d2b91b9f813f8c4de76cad1714 Mon Sep 17 00:00:00 2001 From: Max Maischein <corion@corion.net> Date: Tue, 27 Aug 2019 00:31:28 +0200 Subject: [PATCH] Bail out of building if sh.exe or cc1.exe are found o +n the path This addresses # RT #49433 , RT #62451 The workaround is to adjust $PATH / $ENV{PATH} to exclude directories in which sh.exe or cc1.exe is found. Another workaround is to set $ENV{WX_IGNOREPATH} to a true value to disable this check. --- Build.PL | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) mode change 100755 => 100644 Build.PL diff --git a/Build.PL b/Build.PL old mode 100755 new mode 100644 index b0728a2..38046e0 --- a/Build.PL +++ b/Build.PL @@ -226,6 +226,33 @@ $build->notes( 'userpatch' => $build->args('wxWid +gets-userpatch') || '' ); $build->notes( 'graphicscontext' => $build->args('wxWidgets-graphicsc +ontext') ); if( $build_wx ) { + # RT #49433 , RT #62451 + if( $^O eq 'MSWin32' ) { + my @problematic = (qw(sh.exe cc1.exe)); + my @problematic_path = map { My::Build::Base->awx_path_search +( $_ ) } @problematic; + My::Build::Base->awx_path_search( 'cc1 +.exe' ), + ; + if( @problematic_path and not $ENV{WX_IGNOREPATH} ) { + local $" = "\n"; + print <<EOT; +The following programs were found in \$ENV{PATH}, and will break the +build: +@problematic_path + +PATH is + +$ENV{PATH} + +Please edit \$ENV{PATH} so these programs are not in it anymore and r +estart the +installation. Alternatively, set \$ENV{WX_IGNOREPATH} to a true value + and +restart the installation: + + set WX_IGNOREPATH=1 + +EOT + exit 1; + } + }; + $wx_version = _askmulti( $build, 'wxWidgets-version', 'Which wxWidgets version?', [ sort keys %VERSIONS ], $DEFAULT_VERSIO +N ); -- 2.22.0.windows.1

Replies are listed 'Best First'.
Re^11: Need help debugging Wx on Strawberry Perl 5.26.1
by swl (Parson) on Aug 26, 2019 at 21:50 UTC

    That approach looks sound to me.

        Thanks for the link, this will certainly help. As this goes into Module::Build territory, and I'm not keen on learning on how to make Module::Build add arbitrary commands to the created Build (well, Build.bat) script, I won't change my patch. Somebody with knowledge of Module::Build is welcome to take my patch and make things work right out of the box.

        The appropriate commands would likely be (ignoring systems where we have command.com):

        set SHELL=cmd.exe

        ... and, after appropriate munging in Perl to remove all offending directories in $ENV{PATH}:

        set PATH=$cleaned_path

        $cleaned_path would likely be something like:

        my $cleaned_path = join ";", grep { ! -f "$_\\sh.exe" && ! -f "$_\\cc1.exe" } split /;/, $ENV{PATH} ;

      That approach looks sound to me.

      Its better than nothing, and better late than never,

      But we can do better than a copout from so many years ago

      I imagine this is relevant portion but I havent built a wxWidgets in years

      If you could check your logs please

      Alien-wxWidgets-0.64\inc\My\Build\Any_wx_config.pm sub build_wxwidgets { my $self = shift; my $extra_flags = $self->wxwidgets_configure_extra_flags; my $prefix_dir = $self->_key; my $prefix = awx_install_arch_dir( $self, $prefix_dir ); my $opengl = $self->notes( 'build_wx_opengl' ); my $args = sprintf '--with-%s %s--disable-compat24', $self->awx_build_toolkit, $opengl ? '--with-opengl ' : ''; my $unicode = $self->awx_is_unicode ? 'enable' : 'disable'; my $debug = ''; if( $self->awx_version_type == 2 ) { $debug = ( $self->awx_debug ) ? '--enable-debug' : '--disable- +debug'; } else { $debug = ( $self->awx_debug ) ? '--enable-debug=max' : ''; } my $monolithic = $self->awx_is_monolithic ? 'enable' : 'disable'; my $universal = $self->awx_is_universal ? 'enable' : 'disable'; my $dir = $self->notes( 'build_data' )->{data}{directory}; my $cmd = "echo exit | " . # for OS X 10.3... "sh ../configure --prefix=$prefix $args --$unicode-unico +de" . " $debug --$monolithic-monolithic" . " --$universal-universal_binary $extra_flags";

        It is unclear what it is that you're asking for here. What should I be checking for in the logs?