[Rd] regression tests for unlink and wildcards fail - Solaris 10 SPARC / Sun Studio 12 (PR#10501)

brownjtb at gmail.com brownjtb at gmail.com
Fri Dec 7 18:45:09 CET 2007


Full_Name: Jim Brown
Version: 2.6.0 / 2.6.1
OS: Solaris 10 (SPARC)
Submission from: (NULL) (35.8.15.102)


I have been able to successfully compile version 2.5.1 using the Sun Studio 12
compilers on Sun Solaris 10 (SPARC).  All tests using "make check" pass with a
status of OK.   However, the following section of "reg-tests-1.R" fails when I
attempt to test after a build of either 2.6.0 or 2.6.1:

  ## regression tests for unlink and wildcards
  owd <- setwd(tempdir())
  f <- c("ftest1", "ftest2", "ftestmore", "ftest&more")
  file.create(f)
  stopifnot(file.exists(f))
  unlink("ftest?")
  stopifnot(file.exists(f) == c(FALSE, FALSE, TRUE, TRUE))
  unlink("ftest*", recursive = TRUE)
  stopifnot(!file.exists(f))

  stopifnot(unlink("no_such_file") == 0) # not an error

  dd <- c("dir1", "dir2", "dirs", "moredirs")
  for(d in dd) dir.create(d)
  dir(".")
  file.create(file.path(dd, "somefile"))
  dir(".", recursive=TRUE)
  stopifnot(unlink("dir?") == 1) # not an error
  unlink("dir?", recursive = TRUE)
  stopifnot(file.exists(dd) == c(FALSE, FALSE, FALSE, TRUE))
  unlink("*dir*", recursive = TRUE)
  stopifnot(!file.exists(dd))

  # Windows needs short path names for leading spaces
  dir.create(" test")
  dir(".", recursive=TRUE)
  unlink(" test", recursive = TRUE)
  stopifnot(!file.exists(" test"))
  setwd(owd)


If I comment out the above section of the tests, the rest of the test pass. 
However, running as it is intended, the "reg-tests-1.R" test does fail.  Here is
the output that is generated from "make check":

running code in 'reg-tests-1.R' ...*** Error code 1
The following command caused the error:
LC_ALL=C SRCDIR=. R_DEFAULT_PACKAGES= ../bin/R --vanilla < reg-tests-1.R >
reg-tests-1.Rout 2>&1 || (mv reg-tests-1.Rout reg-tests-1.Rout.fail && exit 1)
make: Fatal error: Command failed for target `reg-tests-1.Rout'
Current working directory /apps/local/src/R-2.6.0/tests
*** Error code 1
The following command caused the error:
make reg-tests-1.Rout reg-tests-2.Rout reg-IO.Rout reg-IO2.Rout  reg-plot.Rout
reg-S4.Rout  RVAL_IF_DIFF=1
make: Fatal error: Command failed for target `test-Reg'
Current working directory /apps/local/src/R-2.6.0/tests
*** Error code 1
The following command caused the error:
for name in Examples Specific Reg Internet; do \
  make test-${name} || exit 1; \
done
make: Fatal error: Command failed for target `test-all-basics'
Current working directory /apps/local/src/R-2.6.0/tests
*** Error code 1
The following command caused the error:
(cd tests && make check)
make: Fatal error: Command failed for target `check'



And here are the final entries in the "reg-tests-1.Rout.fail" file:

> ## regression tests for unlink and wildcards
> owd <- setwd(tempdir())
> f <- c("ftest1", "ftest2", "ftestmore", "ftest&more")
> file.create(f)
[1] TRUE TRUE TRUE TRUE
> stopifnot(file.exists(f))
> unlink("ftest?")
> stopifnot(file.exists(f) == c(FALSE, FALSE, TRUE, TRUE))
> unlink("ftest*", recursive = TRUE)
> stopifnot(!file.exists(f))
> 
> stopifnot(unlink("no_such_file") == 0) # not an error
> 
> dd <- c("dir1", "dir2", "dirs", "moredirs")
> for(d in dd) dir.create(d)
> dir(".")
[1] "41c6167e"     "dir1"         "dir2"         "dirs"         "file21ed4192"
[6] "file281327c9" "moredirs"    
> file.create(file.path(dd, "somefile"))
[1] TRUE TRUE TRUE TRUE
> dir(".", recursive=TRUE)
[1] "41c6167e"          "dir1/somefile"     "dir2/somefile"    
[4] "dirs/somefile"     "file21ed4192"      "file281327c9"     
[7] "moredirs/somefile"
> stopifnot(unlink("dir?") == 1) # not an error
Error: unlink("dir?") == 1 is not TRUE
Execution halted
rm: Cannot remove any directory in the path of the current working directory
/tmp/RtmpBLKy4b



Is this safe to ignore?   The empty directory that it is complaining about
(/tmp/RtmpBLKy4b) can not be removed using "rm -r", but can be removed using the
UNIX "unlink" command.


Again, version 2.5.1 builds and checks just fine, but the above tests fail when
I attempt to build/check either 2.6.0 or 2.6.1.


In case it is any help, here are the configure options that I set for all three
builds:

  ./configure --prefix=/usr/local/R
  --with-blas=sunperf
  --with-lapack
  --with-tcl-config=/usr/local/lib/tclConfig.sh
  --with-tk-config=/usr/local/lib/tkConfig.sh
  R_PAPERSIZE=letter
  CC=/opt/SUNWspro/bin/cc
  CFLAGS="-mt -ftrap=%none -xarch=sparcvis"
  LDFLAGS="-L/usr/local/lib -R/usr/local/lib"
  CXX=/opt/SUNWspro/bin/CC
  CXXFLAGS="-mt -ftrap=%none -xarch=sparcvis"
  F77=/opt/SUNWspro/bin/f95
  F95=/opt/SUNWspro/bin/f95
  FFLAGS="-mt -ftrap=%none -xarch=sparcvis" 
  FC=/opt/SUNWspro/bin/f95
  FCFLAGS="-mt -ftrap=%none -xarch=sparcvis"
  CPICFLAGS=-xcode=pic32
  CPPFLAGS="-I/usr/local/include"
  SHLIB_CXXLDFLAGS="-G -lCstd"



For now, I think I will continue to use version 2.5.1 as I am able build/test
that version and I know it works.  However, I would like to upgrade at some
point and just thought I would make you aware of the failed test on the Sun
Solaris 10 (SPARC) platform using the latest Sun Studio 12 set of compilers.


Thanks.



Jim



More information about the R-devel mailing list