Ticket #742 (closed bug: fixed)

Opened 13 years ago

Last modified 13 years ago

Parrot::Test::Util::create_tempfile() cannot handle DIR option on Cygwin

Reported by: jkeenan Owned by: jkeenan
Priority: normal Milestone:
Component: none Version: 1.2.0
Severity: medium Keywords: test tempfile
Cc: particle Language:
Patch status: applied Platform: cygwin


Thanks to smoke tester ksethura++, we are getting steady Smolder reports on how Parrot builds on Cygwin. ( Example.) One test file is consistently croaking: t/compilers/imcc/syn/file.t. It fails with a message like this:

Error in tempfile() using /cygdrive/parrot/XXXXXXXXXX.pasm:
Parent directory (/cygdrive/parrot/) is not writable
 at lib/Parrot/Test/Util.pm line 52
# Looks like your test died before it could output anything.

In this file File::Temp::tempfile() is not called directly. Rather, it is wrapped by Parrot::Test::Util::create_tempfile(). This function is called in 9 different test files and is called multiple times within file.t. I therefore hypothesized that there was something different about the way create_tempfile() was called in file.t that was causing the file to die.

Hypothesis confirmed: In the first instance of create_tempfile() in this file, it is called with a DIR key-value pair -- the only such instance anywhere in our test suite.

 my ($FOO, $temp_pasm) = create_tempfile(
     SUFFIX => '.pasm',
     DIR => cwd(),   # line 36 (rebroken for readability)
     UNLINK => 1 );

Something about DIR => cwd() is not appreciated on Cygwin.

I removed that key-value pair and re-ran file.t. The file ran without incident on Linux/i386 and Darwin/PPC -- the two platforms I have available. I'm going to go out on a limb and commit this to trunk because getting it available for ksethura's Smolder testing will probably be the quickest way of confirming whether my fix is correct.

Patch applied in r39416.

Thank you very much.

Change History

Changed 13 years ago by jkeenan

  • status changed from new to assigned

Changed 13 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

file.t now producing  same results on Cygwin as on other OSes. Problem appears to be fixed. Closing ticket. I'll leave the analysis of why DIR => cwd() didn't work on Cygwin to those who have access to that system.

Thank you very much.

Note: See TracTickets for help on using tickets.