Discussion:
[rt.cpan.org #80026] LIB is being in correctly quoted when using more than one lib path
Jody Clements via RT
2012-10-05 15:23:15 UTC
Permalink
Fri Oct 05 11:23:15 2012: Request 80026 was acted upon.
Transaction: Ticket created by JCLEMENTS
Queue: Inline
Subject: LIB is being in correctly quoted when using more than one lib path
Broken in: 0.48, 0.48_01, 0.48_02, 0.49, 0.49_01, 0.49_02, 0.50, 0.50_01, 0.50_02
Severity: Important
Owner: Nobody
Requestors: JCLEMENTS-***@public.gmane.org
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80026 >


I have been having a problem getting Inline to compile my code after a
move from version 0.47 to version 0.50. I have the following set up in
my source:

use Inline
C => "$src_file",
VERSION => '0.01',
ENABLE => 'AUTOWRAP',
INC => "-I$src_dir/src -I$src_dir/easel",
LIBS => "-L$src_dir/easel -L$src_dir/src -lhmmer -leasel",
TYPEMAPS => [$typemaps],
NAME => 'Bio::HMM::Logo';

When I run make using version 0.47 everything compiles and the cc line
looks like this:

cc -c -I/opt/src/Bio-HMM-Logo-0.01 -I/opt/src/Bio-HMM-Logo-0.01/src/src
-I/opt/src/Bio-HMM-Logo-0.01/src/easel -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64
-O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC
"-I/opt/lib/perl5/5.12.2/x86_64-linux/CORE" Logo.c

When I run it using version 0.50 it fails and I get a slightly different
cc line:

cc -c -I"/opt/src/Bio-HMM-Logo-0.01"
"-I/opt/src/Bio-HMM-Logo-0.01/src/src
-I/opt/src/Bio-HMM-Logo-0.01/src/easel" -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS
=64 -O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC
"-I/opt/lib/perl5/5.12.3/x86_64-linux/CORE" Logo.c

I looked into the source and it looks like the quote_space subroutine
(C.pm line 84) is quoting the entire INC
line("-I/opt/src/Bio-HMM-Logo-0.01/src/src
-I/opt/src/Bio-HMM-Logo-0.01/src/easel") if I have more than one path.

Any help fixing this in future versions would be greatly appreciated.

Thanks,

Jody
Jody Clements via RT
2012-10-06 11:15:38 UTC
Permalink
Sat Oct 06 07:15:20 2012: Request 80026 was acted upon.
Transaction: Correspondence added by me-***@public.gmane.org
Queue: Inline
Subject: Re: [rt.cpan.org #80026] LIB is being in correctly quoted when using more than one lib path
Broken in: 0.48, 0.48_01, 0.48_02, 0.49, 0.49_01, 0.49_02, 0.50, 0.50_01, 0.50_02
Severity: Important
Owner: Nobody
Requestors: JCLEMENTS-***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80026 >
Post by Jody Clements via RT
<URL: https://rt.cpan.org/Ticket/Display.html?id=80026 >
Post by Jody Clements via RT
I looked into the source and it looks like the quote_space subroutine
(C.pm line 84) is quoting the entire INC
line("-I/opt/src/Bio-HMM-Logo-0.01/src/src
-I/opt/src/Bio-HMM-Logo-0.01/src/easel") if I have more than one path.
Thanks for the report, Jody.
I take it that if, in line 84, you replace "quote_space($value)" with
"$value", then everything is ok with 0.50 ?
That is correct.
Post by Jody Clements via RT
The point of quote_space() was to (help) accommodate those who want to
put things in directories whose names contain white space (eg C:/Program
Files/).
It's a very poor situation, indeed, that in trying to accommodate insane
(and irritating) behaviour, a completely sane practice has been broken -
and I'll release a new version of Inline once I decide how to fix this.
I guess quote_space() needs to be able to distinguish between (insane)
spaces that are part of a directory name, and (sane) spaces that act as
a path separator ... but I haven't yet looked closely at this.
I totally understand your pain. If I can think of a way to fix it I will get back to you. Thanks for the response.

Regards,

Jody
Sisyphus via RT
2012-10-06 01:56:11 UTC
Permalink
Fri Oct 05 21:56:10 2012: Request 80026 was acted upon.
Transaction: Correspondence added by SISYPHUS
Queue: Inline
Subject: LIB is being in correctly quoted when using more than one lib path
Broken in: 0.48, 0.48_01, 0.48_02, 0.49, 0.49_01, 0.49_02, 0.50, 0.50_01, 0.50_02
Severity: Important
Owner: Nobody
Requestors: JCLEMENTS-***@public.gmane.org
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80026 >
Post by Jody Clements via RT
I looked into the source and it looks like the quote_space subroutine
(C.pm line 84) is quoting the entire INC
line("-I/opt/src/Bio-HMM-Logo-0.01/src/src
-I/opt/src/Bio-HMM-Logo-0.01/src/easel") if I have more than one path.
Thanks for the report, Jody.
I take it that if, in line 84, you replace "quote_space($value)" with
"$value", then everything is ok with 0.50 ?

The point of quote_space() was to (help) accommodate those who want to
put things in directories whose names contain white space (eg C:/Program
Files/).
It's a very poor situation, indeed, that in trying to accommodate insane
(and irritating) behaviour, a completely sane practice has been broken -
and I'll release a new version of Inline once I decide how to fix this.

I guess quote_space() needs to be able to distinguish between (insane)
spaces that are part of a directory name, and (sane) spaces that act as
a path separator ... but I haven't yet looked closely at this.

Cheers,
Rob
Sisyphus via RT
2012-10-07 02:47:55 UTC
Permalink
Sat Oct 06 22:47:54 2012: Request 80026 was acted upon.
Transaction: Correspondence added by SISYPHUS
Queue: Inline
Subject: LIB is being in correctly quoted when using more than one lib path
Broken in: 0.48, 0.48_01, 0.48_02, 0.49, 0.49_01, 0.49_02, 0.50, 0.50_01, 0.50_02
Severity: Important
Owner: Nobody
Requestors: JCLEMENTS-***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80026 >
Post by Jody Clements via RT
Post by Jody Clements via RT
I guess quote_space() needs to be able to distinguish between
(insane)
Post by Jody Clements via RT
spaces that are part of a directory name, and (sane) spaces that act
as
Post by Jody Clements via RT
a path separator ... but I haven't yet looked closely at this.
I totally understand your pain. If I can think of a way to fix it I
will get back to you. Thanks for the response.
I think I've worked out what ought to be done.
It's really quite idiotic to expect Inline (on a File System that
supports white space in directory names) to know just what is intended
by '-I/foo -I/bar'.
On the face of it, there's nothing to tell us whether that second '-I'
is intended as a switch, or whether it's part of the directory name !!

All we could really do is test:
-d '/foo -I/bar';

If that returns "false" then we assume that '-I/foo -I/bar' was what was
meant.
But if the test returned "true" then it probably meant '"-I/foo -I/bar"'
... but I think I'll just have Inline die with an appropriate error
message (and serves the dickhead right for creating a directory named
'/foo -I/').

Of course, this needs to be extended to cater for any number of '-I'
occurrences.
For something like '-I/foo -I/bar -I/baz -I/fu -I/ba' I'd have Inline
die if any of '/foo -I/', '/bar -I/', '/baz -I/' or '/fu -I/'
directories exist. Otherwise, assume that all of the spaces are
delimiters (which would always *normally* be the case, anyway).

It's just a matter of modifying quote_space() appropriately, and
including some tests to check that I've got it right (and to detect any
future breakage that might occur).

Hopefully I can get this completed (culminating in the release of 0.51)
over the coming week.

Cheers,
Rob
Jody Clements via RT
2012-10-07 15:39:08 UTC
Permalink
Sun Oct 07 11:39:06 2012: Request 80026 was acted upon.
Transaction: Correspondence added by JCLEMENTS
Queue: Inline
Subject: LIB is being in correctly quoted when using more than one lib path
Broken in: 0.48, 0.48_01, 0.48_02, 0.49, 0.49_01, 0.49_02, 0.50, 0.50_01, 0.50_02
Severity: Important
Owner: Nobody
Requestors: JCLEMENTS-***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80026 >
Post by Sisyphus via RT
I think I've worked out what ought to be done.
It's really quite idiotic to expect Inline (on a File System that
supports white space in directory names) to know just what is intended
by '-I/foo -I/bar'.
On the face of it, there's nothing to tell us whether that second '-I'
is intended as a switch, or whether it's part of the directory name !!
-d '/foo -I/bar';
If that returns "false" then we assume that '-I/foo -I/bar' was what was
meant.
But if the test returned "true" then it probably meant '"-I/foo -I/bar"'
... but I think I'll just have Inline die with an appropriate error
message (and serves the dickhead right for creating a directory named
'/foo -I/').
Of course, this needs to be extended to cater for any number of '-I'
occurrences.
For something like '-I/foo -I/bar -I/baz -I/fu -I/ba' I'd have Inline
die if any of '/foo -I/', '/bar -I/', '/baz -I/' or '/fu -I/'
directories exist. Otherwise, assume that all of the spaces are
delimiters (which would always *normally* be the case, anyway).
It's just a matter of modifying quote_space() appropriately, and
including some tests to check that I've got it right (and to detect any
future breakage that might occur).
Hopefully I can get this completed (culminating in the release of 0.51)
over the coming week.
Cheers,
Rob
That sounds like a more elegant solution than anything I could come up
with. Thanks for getting this fixed so quickly.

Regards,

J.
Sisyphus via RT
2012-10-09 04:37:16 UTC
Permalink
Tue Oct 09 00:37:15 2012: Request 80026 was acted upon.
Transaction: Correspondence added by SISYPHUS
Queue: Inline
Subject: LIB is being in correctly quoted when using more than one lib path
Broken in: 0.48, 0.48_01, 0.48_02, 0.49, 0.49_01, 0.49_02, 0.50, 0.50_01, 0.50_02
Severity: Important
Owner: Nobody
Requestors: JCLEMENTS-***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80026 >
Post by Jody Clements via RT
Thanks for getting this fixed so quickly.
Well, the main thing is that it doesn't break things for those who don't
have whitespace in their directory names .... just how well it works for
those who *do* have whitespace in their directory names is not of great
importance to me, personally. (I don't really see why they can't do the
quoting themselves.)

Anyway, as of Inline-0.50_03, which has just been uploaded to cpan, the
quote_space() subroutine should now be doing the right thing pretty much
across the board, afaik.
If the INC config arg contains any tabs or doublequotes, then
quote_space() won't alter it in any way - which will cause problems if
that arg contains some whitespace that needs to be quoted. (This is the
only shortcoming I'm aware of at the moment ... someone who cares about
it can fix that aspect.)

If no problems with Inline-0.50_03 become evident in the next few days,
then it will be released as Inline-0.51 on the evening of Sat 13 Oct
(Australian time).

Cheers,
Rob
Sisyphus via RT
2012-10-17 09:37:32 UTC
Permalink
Wed Oct 17 05:37:31 2012: Request 80026 was acted upon.
Transaction: Correspondence added by SISYPHUS
Queue: Inline
Subject: LIB is being in correctly quoted when using more than one lib path
Broken in: 0.48, 0.48_01, 0.48_02, 0.49, 0.49_01, 0.49_02, 0.50, 0.50_01, 0.50_02
Severity: Important
Owner: Nobody
Requestors: JCLEMENTS-***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80026 >


Should now be fixed in 0.51 (released to CPAN a few days ago).

Thanks for reporting.

Cheers,
Rob

Loading...