Oefenweb / ansible-r

Ansible role to set up (the latest version of) R in Ubuntu systems
MIT License
42 stars 27 forks source link

r_packages doesn't bail when a package can't be installed #5

Closed reactormonk closed 8 years ago

reactormonk commented 8 years ago

When adding

r_packages:
  -name: devtools

to the playbook, it says ok, even though the installation failed, the package was not available afterwards. It bailed when executing R-install-package devtools, because no libxml2-dev.

tersmitten commented 8 years ago

What is the exit status of R-install-package devtools, after the failed installation?

reactormonk commented 8 years ago

echo $? => 1

tersmitten commented 8 years ago

That's strange since Ansible should be failing if rc != 0.

Can you add some configuration and output so I can help you figure it out?

reactormonk commented 8 years ago
- hosts: all
  roles:
    - role: "Oefenweb.r"
      become: yes
      r_install_dev: yes
      r_packages:
        - name: devtools

Via R-install-package devtools

------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
 * deb: libxml2-dev (Debian, Ubuntu, etc)
 * rpm: libxml2-devel (Fedora, CentOS, RHEL)
 * csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
tersmitten commented 8 years ago

I'll see if I can find the time to look at it this week

mvdriel commented 8 years ago

I cannot reproduce this problem. With given configuration the provision fails as expected:

TASK: [../../ | packages | install] ******************************************* 
<127.0.0.1> REMOTE_MODULE command R-install-package devtools
failed: [ubuntu-1404] => (item={'name': 'devtools'}) => {"changed": false, "cmd": ["R-install-package", "devtools"], "delta": "0:00:04.489644", "end": "2015-11-10 12:21:21.677247", "item": {"name": "devtools"}, "rc": 1, "start": "2015-11-10 12:21:17.187603", "stdout_lines": ["During startup - Warning messages:", "1: Setting LC_TIME failed, using \"C\" ", "2: Setting LC_MONETARY failed, using \"C\" ", "3: Setting LC_PAPER failed, using \"C\" ", "4: Setting LC_MEASUREMENT failed, using \"C\" ", "Using PKG_CFLAGS=", "Using PKG_LIBS=-lxml2", "------------------------- ANTICONF ERROR ---------------------------", "Configuration failed because libxml-2.0 was not found. Try installing:", " * deb: libxml2-dev (Debian, Ubuntu, etc)", " * rpm: libxml2-devel (Fedora, CentOS, RHEL)", " * csw: libxml2_dev (Solaris)", "If libxml-2.0 is already installed, check that 'pkg-config' is in your", "PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config", "is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:", "R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'", "--------------------------------------------------------------------"]}
tersmitten commented 8 years ago

@reactormonk I close this issue as we can't reproduce it. Feel feel to reopen