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

 
 

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

Submitter:  greg keranen <gkeranen>
Submitted:  Wed 01 Mar 2006 02:12:18 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.0 Operating System:  MS Windows
Fixed Release:  3.81 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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 -email is 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 -email is 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 -email is 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 Files:
   
   
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

 

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 8 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 3.81
2006-03-10 psmith StatusNone Fixed
    Assigned toNone psmith
    Open/ClosedOpen Closed
    Fixed ReleaseNone 4.0
2006-03-03 gkeranen Attached File- Added escape, #3468
2006-03-01 gkeranen Attached File- Added escape, #3463
2006-03-01 gkeranen Attached File- Added escape, #3460

Back to the top

Powered by Savane 3.13-3230.
Corresponding source code