Skip to content

[R-pkg-devel] Proper way to cleanup after build third party components?

7 messages · Brian G. Peterson, Konstantin Sorokin, Dirk Eddelbuettel +1 more

#
Hello!

I've recently submitted my first package on CRAN and now need to make
some improvements
on feedback received from CRAN maintainers.

https://github.com/thekvs/zstdr
https://cran.r-project.org/web/packages/zstdr/index.html

My question are:

   1. In the process of building package I also need to build some
   third party components, now I use mktemp utility to create temporary
   subdirectory in /tmp/ directory where I build this third party part. I was
   told that according to CRAN packaging policy I should not leave any
   artifacts in /tmp/ after package build. My question is: Is it enough to
   delete this temporary directory in the "cleanup" script?
   2. Is it possible to install cmake on OSX and Solaris build hosts?
#
On Sun, 2017-06-04 at 22:56 +0300, Konstantin Sorokin wrote:
Why not just use .Rbuildignore so that the generated tarball doesn't
have any of the extra files?  Or do I misunderstand your question?
#
This third party component is a compression library for which my package
provides bindings and I need to build this library first. Look at the lines
starting from
https://github.com/thekvs/zstdr/blob/8ea428b33d986667494d940c66732dbbc66871b3/configure.ac#L34

On Mon, Jun 5, 2017 at 12:19 AM, Brian G. Peterson <brian at braverock.com>
wrote:

  
    
#
On 5 June 2017 at 00:51, Konstantin Sorokin wrote:
| This third party component is a compression library for which my package
| provides bindings and I need to build this library first. Look at the lines
| starting from
| https://github.com/thekvs/zstdr/blob/8ea428b33d986667494d940c66732dbbc66871b3/configure.ac#L34

The common paradigm is to first build below src/, and to then link via
src/Makevars to the static library you just built.

I don't have a real go-to example of a package that does this but you could
look into the BioConductor package RGBL (which builds Boost Graph first)
and/or the nloptr package (which, if need be, downloads nlopt and builds it;
my contribution there was the other part of finding / using a libnlopt if on
the system).

I wondered about this when CRANberries told me about your package. I guess
you can't assume the Zstandard library to be present?  Maybe one day the
hybrid approach of nloptr may work for you.

Dirk
#
On Mon, Jun 5, 2017 at 1:13 AM, Dirk Eddelbuettel <edd at debian.org> wrote:

            
Thanks, Dirk, I'll look at nloptr package more closely.
zstandard is a young project and I think it is a bit to early to assume
that zstandard library be present in the system. For example on my Ubuntu
16.04 (LTS) I have libzstd0/xenial 0.5.1-1 but the latest stable release
has version 1.2.

Btw, what about installing cmake on OSX and Solaris in CRAN build farm? Now
 it is such a ubiquitous and widely used program!
#
Hi Konstantin,

Concerning CMake, I asked a similar question here:

https://stat.ethz.ch/pipermail/r-package-devel/2017q2/001600.html

Essentially, I wondered if there was a way to have CMake within an R
package, but obviously having a system install of CMake would work in my
case too.

Hopefully answers to your question will be more useful than answers to mine
;)
On Mon, Jun 5, 2017 at 5:29 AM, Konstantin Sorokin <kvs at sigterm.ru> wrote:

            

  
  
#
On 5 June 2017 at 12:29, Konstantin Sorokin wrote:
| zstandard is a young?project and I think it is a bit to early to assume that
| zstandard library be present in the system. For example on my Ubuntu 16.04
| (LTS) I have?libzstd0/xenial 0.5.1-1 but the latest stable release has version
| 1.2.

I use the PPA service on launchpad.net to great effect for that. Take most
recent (packaged !!) version from Debian, adjust debian/control and
debian/changelog ever so slightly, upload to launchpad and use the thusly
generated version on older Ubuntu and e.g. Travis.   I need to blog about that...
 
| Btw, what about installing cmake on OSX and Solaris in CRAN build farm? Now ?it
| is such a ubiquitous and widely used program!

As far as I know, some packages already use cmake. See e.g. this query among
the GitHub-mirrored CRAN packages:

    https://github.com/search?q=user%3Acran+CMakeLists.txt&type=Code

Dirk