Henrik Bengtsson
2012-Dec-20 21:14 UTC
[Rd] How to make an <pkg>/configure file executable on Windows/NTFS?
Hi, in my package, I've got a 'configure' file in the root, e.g. aroma.affymetrix/configure. (I've also got a configure.win, which works just fine on Windows). This file must be executable (has a proper file mode) for 'R CMD INSTALL'/install.packages() to work, otherwise one gets: * installing *source* package 'aroma.affymetrix' ... ERROR: 'configure' exists but is not executable -- see the 'R Installation and Administration Manual' *** I build my packages/tar balls on Windows. Is there are way to build it such that aroma.affymetrix/configure is executable? *** Looking at the code (http://svn.r-project.org/R/trunk/src/library/tools/R/install.R), there is if (file_test("-x", "configure")) { cmd <- paste(paste(configure_vars, collapse = " "), "./configure", paste(configure_args, collapse = " ")) if (debug) message("configure command: ", sQuote(cmd), domain = NA) res <- system(cmd) if (res) pkgerrmsg("configuration failed", pkg_name) } else if (file.exists("configure")) errmsg("'configure' exists but is not executable -- see the 'R Installation and Administration Manual'") Would it be possible to automatically try to update the file permissions if not enough, e.g. if (file_test("-x", "configure")) Sys,chmod("configure", mode="777") if (file_test("-x", "configure")) { ... } else if (file.exists("configure")) errmsg("'configure' exists but is not executable -- see the 'R Installation and Administration Manual'") This would solve the practical problem of not being able to(?) build tar balls with an executable configure on Windows. I can also see how this avoids problems where the file mode on an SVN repository (think R-forge etc) is overridden by a user on, say, Windows. *** Related, what about adding support for a cross-platform <pkg>/configure.R script that is executed by R/Rscript during installation? Thank you, Henrik