Opened 14 years ago

Closed 14 years ago

#26426 closed defect (fixed)

begin installing recommended package MASS -> Error in file(con, "r") : cannot open the connection

Reported by: faisal.moledina@… Owned by: kjell.konis@…
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: drkp (Dan Ports)
Port: R

Description

It seems like R itself builds, but when installing the recommended package MASS, there's an error opening a connection somewhere. I've attached the build log. Here are the last few lines from the terminal:

begin installing recommended package lattice
begin installing recommended package MASS
Error in file(con, "r") : cannot open the connection
Calls: <Anonymous> -> sub -> grep -> readLines -> file
In addition: Warning message:
In file(con, "r") :
 cannot open file
'/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_math_R/work/R-2.11.1/etc/x86_64/Makeconf':
No such file or directory
Error: could not find function "do_exit_on_error"
Execution halted
make[2]: *** [lattice.ts] Error 1
make[2]: *** Waiting for unfinished jobs....
Error in file(con, "r") : cannot open the connection
Calls: <Anonymous> -> sub -> grep -> readLines -> file
In addition: Warning message:
In file(con, "r") :
 cannot open file
'/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_math_R/work/R-2.11.1/etc/x86_64/Makeconf':
No such file or directory
Error: could not find function "do_exit_on_error"
Execution halted
make[2]: *** [MASS.ts] Error 1
make[1]: *** [recommended-packages] Error 2
make: *** [stamp-recommended] Error 2
shell command " cd
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_math_R/work/R-2.11.1"
&& /usr/bin/make -j2 all " returned error 2
Error: Target org.macports.build returned: shell command failed
DEBUG: Backtrace: shell command failed
   while executing
"command_exec build"
   (procedure "portbuild::build_main" line 8)
   invoked from within
"$procedure $targetname"
Warning: the following items did not execute (for R):
org.macports.activate org.macports.build org.macports.destroot
org.macports.install
Log for R is at:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_math_R/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Attachments (3)

main.log.gz (21.0 KB) - added by faisal.moledina@… 14 years ago.
Build log output from MacPorts
Portfile-R.diff (3.9 KB) - added by kjell.konis@… 14 years ago.
Try number two, sets r_arch explicitly.
Portfile (5.0 KB) - added by kjell.konis@… 14 years ago.
For testing: Portfile@2.11.1_1 = Portfile@2.11.1_0 plus also attached Portfile-R.diff

Download all attachments as: .zip

Change History (13)

Changed 14 years ago by faisal.moledina@…

Attachment: main.log.gz added

Build log output from MacPorts

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to kjell.konis@…

Please remember to cc the maintainer.

comment:2 Changed 14 years ago by kjell.konis@…

Maintainer here. Hmmm. This is the second time someone has reported a failure while R is building its recommended packages. Since I have never been able to reproduce this, the best I can do is add a variant for the recommended packages. The attached Portfile-R.diff adds a recommended variant to control whether the R port builds the recommended packages during installation (these packages can always be added later using the install.packages function in R). The default is to build the recommended packages during installation. If this borks then install the port using the command

port install R -recommended

and add the packages manually.

comment:3 Changed 14 years ago by faisal.moledina@…

This method works and results in a successful R build through MacPorts. However, if I now try to install packages within R, it always results in a fatal error

/opt/local/lib/R/bin/R: line 150: /opt/local/lib/R/etc/x86_64/ldpaths: No such file or directory

Somewhere in the script /opt/local/bin/R it sets the R_ARCH environment variable which then looks for ldpaths under an x86_64 folder in /opt/local/lib/R/etc, a directory that doesn't exist. What exists is what I presume would be the contents of the x86_64 directory straight in that etc directory one level up. I'm only posting that here because I'm wondering if it's relevant to the error that came up during the original build. Thoughts?

Changed 14 years ago by kjell.konis@…

Attachment: Portfile-R.diff added

Try number two, sets r_arch explicitly.

comment:4 Changed 14 years ago by kjell.konis@…

I modified the Portfile so that R's multi-platform hierarchy is used even though the port only builds/installs the native platform. Hopefully this will work around the problem. Please test and let me know.

comment:5 in reply to:  4 ; Changed 14 years ago by faisal.moledina@…

Replying to kjell.konis@…:

I modified the Portfile so that R's multi-platform hierarchy is used even though the port only builds/installs the native platform. Hopefully this will work around the problem. Please test and let me know.

I'm having a problem applying the patch. Does it depend on a new svn checkout of the Portfile or the previous patch? Would you be able to upload the changed Portfile directly?

Changed 14 years ago by kjell.konis@…

Attachment: Portfile added

For testing: Portfile@2.11.1_1 = Portfile@2.11.1_0 plus also attached Portfile-R.diff

comment:6 in reply to:  5 Changed 14 years ago by kjell.konis@…

Replying to faisal.moledina@…:

Replying to kjell.konis@…:

I modified the Portfile so that R's multi-platform hierarchy is used even though the port only builds/installs the native platform. Hopefully this will work around the problem. Please test and let me know.

I'm having a problem applying the patch. Does it depend on a new svn checkout of the Portfile or the previous patch? Would you be able to upload the changed Portfile directly?

It's a diff against the Portfile for R@2.11.1_0 (a new svn checkout). I attached the patched Portfile too.

comment:7 Changed 14 years ago by faisal.moledina@…

This works well now. It even works to install recommended packages during installation through MacPorts. The +recommended variant should probably be removed now (?). I did a quick test by running install.packages("ggplot2") and it installed along with all dependencies without any issues.

comment:8 Changed 14 years ago by kjell.konis@…

Thanks for testing. I'm going to keep the +-recommended, I was planning on adding it as a variant anyway. Now is as good of time as any.

PS I think this is the first time I've ever fixed an issue that I was not able to locally reproduce :)

comment:9 Changed 14 years ago by drkp (Dan Ports)

Cc: dports@… added

Cc Me!

comment:10 Changed 14 years ago by drkp (Dan Ports)

Resolution: fixed
Status: newclosed

Committed patch in r71488. Thanks!

Note: See TracTickets for help on using tickets.