Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: Defining an XS symbol in the Makefile.PL (largely solved)

by jcb (Chaplain)
on Aug 22, 2019 at 02:24 UTC ( #11104839=note: print w/replies, xml ) Need Help??


in reply to Re^3: Defining an XS symbol in the Makefile.PL (largely solved)
in thread Defining an XS symbol in the Makefile.PL

Are the % characters appearing in the generated Makefile where they should be?

When make prints the command it is issuing, is the % present as it should be?

If it is in the Makefile and missing when make reports the command, file a bug on GNU make, but if GNU make prints the %, my guess is that the Windows shell is eating the single %, a situation that dmake silently works around by doubling % characters (or something else; if the Windows shell is responsible for this, your solution of writing %% may only work due to Yet Another Microsoft Bug).

If you try installing bash and editing the generated Makefile to set SHELL = /path/to/bash.exe, do the strange problems go away? If so, it is almost a Windows-ism tripping you up here.

GNU usually has consistent escaping and quoting rules. I doubt that GNU make is that different between "native" and "Windows" ports. Have you tried a Cygwin build of GNU make?

Unless your module is intended to be Windows-only, I suggest that the most portable solution is to avoid passing format string constants on the command line.

Replies are listed 'Best First'.
Re^5: Defining an XS symbol in the Makefile.PL (SOLVED)
by syphilis (Bishop) on Aug 22, 2019 at 04:04 UTC
    Are the % characters appearing in the generated Makefile where they should be?

    Yes - if I've specified one "%", then only one appears in the generated Makefile - irrespective of the flavour of make.
    If I've specified "%%", then "%%" appears in the generated Makefile - irrespective of the flavour of make.

    When make prints the command it is issuing, is the % present as it should be?

    Yes - according to what's appearing on the screen as the build is proceeding, the actual command that's being run is as expected for the particular value I've given to CCFLAGSEX, irrespective of the flavour of make.

    There were problems (with which I did not persevere) in getting that Inline::C script to run in my (MSYS2) bash shell using my Windows perl. The process hangs (due to issues with backslashes in paths, I think):
    $ perl try.pl validate Stage Starting Build Preprocess Stage get_maps Stage Finished Build Preprocess Stage Starting Build Parse Stage Finished Build Parse Stage Starting Build Glue 1 Stage Finished Build Glue 1 Stage Starting Build Glue 2 Stage Finished Build Glue 2 Stage Starting Build Glue 3 Stage Finished Build Glue 3 Stage Starting Build Compile Stage Starting "perl Makefile.PL" Stage Generating a gmake-style Makefile Writing Makefile for try_pl_d3118 Writing MYMETA.yml and MYMETA.json Finished "perl Makefile.PL" Stage Starting "make" Stage Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\_32\C\_Inline\build\try_pl_d3118> [Process hangs here]
    However, I've just found another Windows GNU make (provided by Strawberry Perl):
    GNU Make 4.2.1 Built for x86_64-w64-mingw32 Copyright (C) 1988-2016 Free Software Foundation, Inc.
    and using that particular build of make makes the issue go away !!!
    That's a good enough indicator for me that my problems arose because I was using a buggy version of GNU make.

    Thanks for the continuing assistance, guys.
    Further conversation/thoughts/observations are certainly welcome, but I'm now marking this as solved.

    Cheers,
    Rob

      Considering that your Inline::C test is hanging just after producing a cmd.exe startup banner and prompt, I would file this whole mess under the category of "Windows": evidently make is starting a shell to run a command but the shell is waiting for input (probably from NUL:) instead of running the intended command.

        To me, it just illustrates that one shouldn't execute a native windows perl.exe inside an MSYS2 bash shell.
        That it failed to run to completion in that shell is not worthy of any concern.

        Cheers,
        Rob
Re^5: Defining an XS symbol in the Makefile.PL (largely solved)
by Anonymous Monk on Aug 22, 2019 at 02:54 UTC
    jcb: windows cmd.exe doesn't eat % randomly

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11104839]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2019-10-15 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?