bugmake - Bugs: bug #15947, tests/features/escape -...

 
 

bug #15947: tests/features/escape - 'path=p\\:' test fails on Cygwin - cannot stat illegal filename

Submitted by:  greg keranen <gkeranen>
Submitted on:  Wed 01 Mar 2006 02:12:18 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 4.0Operating System: MS Windows
Fixed Release: 3.81Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 10 Mar 2006 01:17:47 AM UTC, comment #4:

I resolved this bug by simply changing the value of the "path" variable from "p:", which might be a drive letter on DOS, to "pre:" which never will be.

The purpose of this test is to make sure that escaping ":" in a target name works properly; it has nothing to do with DOS drive letter paths.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 03 Mar 2006 01:18:31 AM UTC, comment #3:

Thanks Agent,
You spurred me to think again and to better understand the problem.

This bug is wrongly titled and I cannot edit the title now.

I originally thought that make was trying to stat a local file named 'p:foo' and having a problem with ':' being an illegal character but now I realize this is not the case.

The reason I am having the problem and you are not has nothing to do with Cygwin, or with illegal filenames - it is because I have a P: drive mapping on my system (a VirtualCD, in fact, with no disc inserted) and you don't.

Now I understand the message makes perfect sense:

> make: stat: p:foo: No medium found


I now realize that there is any reason to bother with special-case $port_type clauses - what is needed, however, is a .PHONY rule.

This this should apply for ALL systems :

.PHONY : $(path)foo foo\ bar sharp foo\#bar.ext

Complete file is attached.

Unfortunately, make is still trying to stat $(path)foo and I have found no way to fix or workaround this problem so it is still failing on Cygwin - but there is no easy way to reproduce the failure unless your particular system has a P: drive mapped as a removable drive.

I don't understand why make tries to stat a .PHONY : p:foo so I am creating a separate bug.

greg keranen <gkeranen>
Thu 02 Mar 2006 07:46:41 AM UTC, comment #2:

On Cygwin 1.5.17-1, I can't reproduce your `escape' failure against GNU make 3.81rc1.

> make: stat: p:foo: No medium found


I was really amazed when I saw this. I don't think make should even try to read the status info of `p:foo' according to the contents of tests/scripts/features/escape.

I wonder if it's a bug in your build of Cygwin. Well, I could be wrong. :=)

> Here is the relevant section of my revised
> tests/features/escape, complete file also attached


I'm worried when I see the test suit getting messier and messier. Can't we devise a more elegant and more portable testing framework for our GNU make? :(

Agent

Agent Zhang <agent>
Wed 01 Mar 2006 08:27:08 PM UTC, comment #1:

In rethinking my proposed solution, I don't like the idea of
simply skipping the test. Instead, I thought a better solution would be to try it with .PHONY : $(path)foo

But, unfortunately, this gives the same error as original:
make: stat: p:foo: No medium found

Should make really be trying to stat $(path)foo when it has been declared as .PHONY?

Here is the relevant section of my revised tests/features/escape, complete file also attached:
[...]
print MAKEFILE <<'EOF';
$(path)foo : ; @echo cp $^ $@

foo\ bar: ; @echo 'touch "$@"'

sharp: foo\#bar.ext
foo\#bar.ext: ; @echo foo\#bar.ext = '$@'
# for bug #15947:
ifdef port_type
.PHONY : $(path)foo
endif
#$(warning path=$(path))
#$(warning port_type=$(port_type))
EOF
[...]
# TEST 3: This one should work, since we escape the ":".

if (false){
# 2006.03.01 -unavailable- - avoid test entirely? - poor 'fix' for bug #15947:
# CAVEAT: this may also fail on other systems. May need to filter out other $port_type values
if ($port_type != 'W32' && $port_type != 'DOS')
{
# TEST 3: This one should work, since we escape the ":".
&run_make_with_options($makefile, "'path=p\\:'", &get_logfile, 0);
$answer = "cp p:foo\n";
&compare_output($answer,&get_logfile(1));
}
} else {
# 2006.03.01 -unavailable- - shouldn't this should work using .PHONY ?
# - fails to fix error of 'make: stat: p:foo: No medium found' in Cygwin
$escape_options = "'path=p\\:'";

if ($port_type == 'W32' || $port_type == 'DOS')
{
# for bug #15947:
$escape_options .= " 'port_type=$port_type'";
}
&run_make_with_options($makefile, $escape_options, &get_logfile, 0);
$answer = "cp p:foo\n";
&compare_output($answer,&get_logfile(1));

}

--- RESULT:
[greg@x2 tests]$ ./run_make_tests features/escape
[...]
features/escape ......................................... FAILED (5/6 passed)

1 Test in 1 Category Failed (See .diff files in work dir for details) :-(

--- FILE: escape.diff.2:

      • work/features/escape.base.2 Wed Mar 1 12:13:52 2006

--- work/features/escape.log.2 Wed Mar 1 12:13:52 2006
***************

      • 1 ****

--- 1,3 ----
+ make: stat: p:foo: No medium found
cp p:foo
+ make: stat: p:foo: No medium found

greg keranen <gkeranen>
Wed 01 Mar 2006 02:12:18 PM UTC, original submission:

--- TEST ENVIRONMENT:
GNU Make 3.81rc1 on CYGWIN_NT-5.1 x2 1.5.19(0.150/4/2) i686

--- STEPS TO REPRODUCE
[greg@x2 tests]$ ./run_make_tests features/escape
------------------------------------------------------------------------------
Running tests for GNU make on CYGWIN_NT-5.1 x2 1.5.19(0.150/4/2) i686
GNU Make 3.81rc1
------------------------------------------------------------------------------

Clearing work...
Making work dirs...

features/escape ......................................... FAILED (5/6 passed)

1 Test in 1 Category Failed (See .diff files in work dir for details) :-(

--- FILE: work/features/escape.diff.2

      • work/features/escape.base.2 Wed Mar 1 05:59:37 2006

--- work/features/escape.log.2 Wed Mar 1 05:59:37 2006
***************

      • 1 ****

--- 1,3 ----
+ make: stat: p:foo: No medium found
cp p:foo
+ make: stat: p:foo: No medium found

--- ANALYSIS:
':' is an illegal filename character on W32 filesystem
make tries to stat the target and fails on W32

--- PROPOSED FIX:
File attached: tests/features/escape - added $port_type != 'W32'

Wrap test in test for filesystem compatibility: $port_type != 'W32'

# 2006.03.01 -unavailable- - fix error of 'make: stat: p:foo: No medium found' in Cygwin
# CAVEAT: this may also fail on other systems. May need to filter out other $port_type values
if ($port_type != 'W32' && $port_type != 'DOS')
{
# TEST 3: This one should work, since we escape the ":".
&run_make_with_options($makefile, "'path=p\\:'", &get_logfile, 0);
$answer = "cp p:foo\n";
&compare_output($answer,&get_logfile(1));
}

--- REGRESSION TEST: SUCCESSFUL
[greg@x2 tests]$ ./run_make_tests features/escape
[...]
features/escape ......................................... ok (5 passed)

--- CAVEAT:
This may also fail on other systems where ':' is illegal filename char
May need to filter out other $port_type values

greg keranen <gkeranen>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #1655:  escape added by gkeranen (2KiB - application/octet-stream - modified escape script with .PHONY rule)
file #1740:  escape added by gkeranen (3KiB - application/octet-stream - attempt to run test using .PHONY : $(path)foo)
file #1737:  escape added by gkeranen (2KiB - application/octet-stream - tests/features/escape - added $port_type != 'W32' && $port_type != 'DOS')

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 8 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 01 Apr 2006 07:20:12 AM UTCpsmithFixed Release4.0=>3.81
Fri 10 Mar 2006 01:17:47 AM UTCpsmithStatusNone=>Fixed
  Assigned toNone=>psmith
  Open/ClosedOpen=>Closed
  Fixed ReleaseNone=>4.0
Fri 03 Mar 2006 01:18:31 AM UTCgkeranenAttached File-=>Added escape, #3468
Wed 01 Mar 2006 08:27:08 PM UTCgkeranenAttached File-=>Added escape, #3463
Wed 01 Mar 2006 02:12:18 PM UTCgkeranenAttached File-=>Added escape, #3460

Back to the top


Powered by Savane 3.1-cleanup1