bugGNU Parallel - Bugs: bug #52737, support MSys2 [PATCH]

 
 

bug #52737: support MSys2 [PATCH]

Submitter:  Rafael Kitover <rkitover>
Submitted:  Sun 24 Dec 2017 07:39:29 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Need Info
Privacy:  Public Assigned to:  tange
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 08 Feb 2018 02:07:13 PM UTC, comment #4: 

Patch has been merged into the MSYS2 package repo:

https://github.com/Alexpux/MSYS2-packages/pull/1104

Rafael Kitover <rkitover>
Sun 31 Dec 2017 12:42:31 PM UTC, comment #3: 

I'm happy to make any changes or rewrite anything to get this merged. I was just explaining how `$^X` works, but I can use a different workaround for msys if you prefer.

Rafael Kitover <rkitover>
Wed 27 Dec 2017 01:09:04 AM UTC, comment #2: 

`$^X` is the path to the perl interpreter that the script was run with.

For example, if the script starts with:

#!/usr/bin/perl

then $^X eq '/usr/bin/perl'

If you run `perl script` and `which perl` is `/usr/local/bin/perl` from the PATH, then:
$^X eq '/usr/local/bin/perl'.

The reason for doing this is so that the perl used to run the script and the perl used for subsequent perl commands is the same. The reason I did this for MSys2 is because in a MINGW shell you may have the Windows native perl first in the PATH, which will break horribly for these perl commands.

With MSys2, AFAIK no one uses the original MSys anymore, and even with the original MSys, the MSys perl uses /bin/sh (bash) to execute shell commands, so the quoting rules are the same as in UNIX.

If on the other hand, you were to use native Windows perl, shell commands would be executed with `cmd.exe` and different quoting rules would apply. Porting these scripts to native Windows perl would be a huge (and unnecessary) amount of work.

Rafael Kitover <rkitover>
Wed 27 Dec 2017 12:53:55 AM UTC, comment #1: 

You are using $^X. That is no good: GNU Parallel is built to be able to run on mixed operating systems that can have perl installed in another dir.

By using 'perl' all that is assumed is that perl is in the path.

msys used to be crazy: ' is not accepted on the cmd line, but " are treated as '

Can you confirm that has changed?

Ole Tange <tange>
Group administrator
Sun 24 Dec 2017 07:39:29 PM UTC, original submission:  

`git format-patch` patch attached

Rafael Kitover <rkitover>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #42714:  0001-support-MSys2.patch added by rkitover (37KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tange (Posted a comment)
  • -email is unavailable- added by rkitover (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-27 tange StatusNone Need Info
        Assigned toNone tange
    2017-12-24 rkitover Attached File- Added 0001-support-MSys2.patch, #42714

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code