R-macos / recipes

System for building static dependent libraries for CRAN packages
44 stars 17 forks source link

Recreating the build system in a VM #2

Closed coatless closed 6 years ago

coatless commented 6 years ago

@s-u

I'm trying to add a recipe for autoconf. The main question I have relates to the underlying system configuration.

Replicating the Build System

To use the recipe's make file, we must first:

  1. Install XCode Command Line Tools (Xcode CLI)
  2. Some level of permission override on /usr/local?

I bring this up because I'm running into permission issues:

sudo chown -Rh 0:0 'autoconf-2.69-dst'
tar fcz 'autoconf-2.69-darwin.18-x86_64.tar.gz' -C 'autoconf-2.69-dst' usr
sudo '/usr/bin/tar' fxz 'autoconf-2.69-darwin.18-x86_64.tar.gz' -C / && touch 'autoconf-2.69'
usr/: Can't set user=0/group=0 for usrCan't update time for usr
usr/local/: Can't set user=0/group=0 for usr/local
tar: Error exit delayed from previous errors.
make: *** [autoconf-2.69] Error 1

This indicates that the problem relates Makefile directive of:

autoconf-2.69: autoconf-2.69-darwin.18-x86_64.tar.gz
    sudo $(TAR) fxz '$^' -C / && touch '$@'

Recipe

I've implemented the recipe as: autoconf in recipes/

Package: autoconf
Version: 2.69
Source.URL: http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz

I'm building it on macOS 10.14 (Mojave) with:

Rscript scripts/mkmk.R && cd build && make autoconf

This is generating the following make entry in build's Makefile:

autoconf-2.69-dst: src/autoconf-2.69 
    rm -rf autoconf-2.69-obj && mkdir autoconf-2.69-obj && cd autoconf-2.69-obj && ../src/autoconf-2.69/configure --with-pic --disable-shared --enable-static && make -j12 && make install DESTDIR=/Users/parallel/Downloads/recipes-master/build/autoconf-2.69-dst

src/autoconf-2.69: src/autoconf-2.69.tar.gz
    mkdir -p src/autoconf-2.69 && (cd src/autoconf-2.69 && $(TAR) fxj ../autoconf-2.69.tar.gz && mv */* .)
src/autoconf-2.69.tar.gz:
    curl -L -o $@ 'http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz'
autoconf-2.69-darwin.18-x86_64.tar.gz: autoconf-2.69-dst
    sudo chown -Rh 0:0 '$^'
    tar fcz '$@' -C '$^' usr
autoconf-2.69: autoconf-2.69-darwin.18-x86_64.tar.gz
    sudo $(TAR) fxz '$^' -C / && touch '$@'
autoconf: autoconf-2.69
s-u commented 6 years ago

Well, but autoconf is not a library - it's in fact a standard build tool, the recipes are only for library dependencies of packages.

That said, the error you see is because you have macOS with SIP (system integrity protection) enabled, so it won't allow you to change permissions on some directories. You can check, but I think it is benign because tar will untar and set permissions on files it can touch.

coatless commented 6 years ago

@s-u agreed. I suppose a better question is: What kind of developer environment are the recipes being built on?

Can I assume that the environment is fully outfitted with the GNU suite of tools? e.g. autoconf, automake, and libtool?

RE: SIP. Thanks, I've disabled that on the VM.