Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Path parsing broken on Windows #41

Closed
zmughal opened this issue Aug 14, 2014 · 4 comments
Closed

Path parsing broken on Windows #41

zmughal opened this issue Aug 14, 2014 · 4 comments

Comments

@zmughal
Copy link
Member

zmughal commented Aug 14, 2014

On the line

my @libs = shellwords( $class->libs );
,
Alien::Base uses Text::ParseWords::shellwords to parse out the linker
flags. The problem is if you use shellwords, it currently does not work with
Windows paths.

use Text::ParseWords qw(shellwords)

## Unix path [ok]
shellwords( "-L/path/to/lib -lzlib" )
# [
#     [0] "-L/path/to/lib",
#     [1] "-lzlib"
# ]

## Windows path with forward slashes [ok]
shellwords( "-LC:/path/to/lib -lzlib" )
# [
#     [0] "-LC:/path/to/lib",
#     [1] "-lzlib"
# ]

## Windows path with backslashes [not ok]
shellwords( "-LC:\\path\\to\\lib -lzlib" )
# [
#     [0] "-LC:pathtolib",
#     [1] "-lzlib"
# ]

Here's an example of an Alien::Base config where that happens for me: https://gist.github.com/zmughal/cab88c49f453f4463f32. This leads to errors in resolving the DLLs.

@zmughal
Copy link
Member Author

zmughal commented Aug 15, 2014

I think something that uses shellwords() on Unix and Text::ParseWords::parse_line( '\s+', 1, "-LC:\\a\\b\\c -lzlib") on Windows might do the trick.

I'll add a function and add some test cases.

@mohawk2
Copy link
Contributor

mohawk2 commented Aug 15, 2014

PRs welcome? ;-)

zmughal added a commit to zmughal/p5-Alien-Base that referenced this issue Aug 16, 2014
@mohawk2
Copy link
Contributor

mohawk2 commented Aug 30, 2014

@zmughal, merge this! ;-)

@zmughal
Copy link
Member Author

zmughal commented Aug 31, 2014

closing with merge of #42.

@zmughal zmughal closed this as completed Aug 31, 2014
vikasnkumar pushed a commit to vikasnkumar/Alien-Base that referenced this issue Aug 31, 2014
plicease pushed a commit that referenced this issue Jul 17, 2017
plicease pushed a commit that referenced this issue Jul 17, 2017
plicease pushed a commit that referenced this issue Jul 17, 2017
plicease pushed a commit that referenced this issue Jul 17, 2017
plicease pushed a commit that referenced this issue Jul 17, 2017
plicease pushed a commit that referenced this issue Jul 17, 2017
plicease pushed a commit to PerlAlien/Alien-Build that referenced this issue Jul 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants