This article is more than 1 year old

Microsoft loves Linux so much its R Open install script rm'd /bin/sh

Machine-learning suite ends its sloppy packaging ways after Debian dev roasts Redmond

Microsoft had to emit a hasty update for its R Open analysis tool after developers found the open-source package was not playing nice with some Linux systems.

The issue was brought to light earlier this week by developer Norbert Preining, who found that the Debian GNU/Linux version of Open R – Microsoft's open-source implementation of the R statistics and data science tool – was causing headaches when it was installed on some systems.

In particular, Preining noted that the shell instructions Microsoft used to install the software would fail on a computer where another version of R is already installed. Worse, the script would delete whatever is at /bin/sh and override it with Bash, changing the system's command interpreter. He pointed out the following bits of code:

#!/bin/bash

#TODO: Avoid hard code VERSION number in all scripts
VERSION=`echo $DPKG_MAINTSCRIPT_PACKAGE | sed 's/[[:alpha:]|(|[:space:]]//g' | sed 's/\-*//' | awk  -F. '{print $1 "." $2 "." $3}'`
INSTALL_PREFIX="/opt/microsoft/ropen/${VERSION}"

echo $VERSION

ln -s "${INSTALL_PREFIX}/lib64/R/bin/R" /usr/bin/R
ln -s "${INSTALL_PREFIX}/lib64/R/bin/Rscript" /usr/bin/Rscript

rm /bin/sh
ln -s /bin/bash /bin/sh

Additionally, Preining found, the script Microsoft used to uninstall R Open would cause further problems, one being that it would delete files without checking where they actually pointed:

#!/bin/bash

VERSION=`echo $DPKG_MAINTSCRIPT_PACKAGE | sed 's/[[:alpha:]|(|[:space:]]//g' | sed 's/\-*//' | awk  -F. '{print $1 "." $2 "." $3}'`
INSTALL_PREFIX="/opt/microsoft/ropen/${VERSION}/"

rm /usr/bin/R
rm /usr/bin/Rscript
rm -rf "${INSTALL_PREFIX}/lib64/R/backup"

"I guess Microsoft should read a bit up, in particular about dpkg-divert and proper packaging," said the mathematician. "What came in here was such an exhibition of incompetence that I can only assume they are doing it on purpose."

This is not a good look for a company that recently unveiled its own Arm Linux kernel, and claimed it loves Linux and open source.

Fortunately, it looks as though Redmond was listening, and Microsoft's dev team was quick to act. Within two days of Preining's blog post going up, he reported that R Open had been patched by the Windows giant to resolve the issues and properly install and remove itself on Debian systems.

"Thanks Microsoft for the quick fix, it is good news that those playing with Open R will not be left with a hosed system," Preining noted.

This comes as Microsoft is going to find itself under the full glare of the spotlight from open source developers thanks to its $7.5bn acquisition of software warehouse Github. Surely, Redmond's team is going to be on high-alert to avoid any more embarrassing slip-ups with its open-source efforts.

"While we work hard to be a good steward in all the open source communities we participate in, this one did not stand up to the community's or our high expectations," admitted Nagesh Pabbisetty, partner director of program management at Microsoft, regarding the wobbly R Open installer. ®

More about

TIP US OFF

Send us news


Other stories you might like