Opened 8 years ago

Closed 7 years ago

#6670 closed defect (fixed)

Fix Mac OSX travis-ci builds - unable to write to root

Reported by: Kurt Schwehr Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

Even mentioned that the builds now fail for macosx because travis changed their mac image from XCode 6.1 to XCode 7.3. However, I think this is the mac equivalent to SELinux. I've seen this with ntpd. I can't remember if this is related to https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AboutAppSandbox/AboutAppSandbox.html

xcodebuild -version -sdk
# SNIP
Xcode 7.3.1
Build version 7D1014

https://travis-ci.org/rouault/gdal_coverage/builds/164981514

Making install in src
test -z "/usr/lib" || /usr/local/bin/gmkdir -p "/usr/lib"
 /bin/sh ../libtool   --mode=install /usr/local/bin/ginstall -c   libproj.la '/usr/lib'
libtool: install: /usr/local/bin/ginstall -c .libs/libproj.0.dylib /usr/lib/libproj.0.dylib
/usr/local/bin/ginstall: cannot create regular file '/usr/lib/libproj.0.dylib': Operation not permitted

We will probably have to

Change History (6)

comment:1 by Even Rouault, 8 years ago

This branch https://github.com/rouault/gdal_coverage/tree/trunk_travis_macosx-xcode8_attempt has fixes in .travis.yml to avoid installing proj and GDAL into root prefixes + fixes in swig/python/setup.py needed to build the python bindings. However running the test suite crashes on ogr_gpkg_17 test. Probably due to a particularity of the sqlite version used, or the way it is built, since that test uses advanced sqlite mechanisms like virtual table and custom SQL functions.

comment:2 by Kurt Schwehr, 8 years ago

This looks to be what is causing the change in behavior:

System Integrity Protection - "rootless" http://arstechnica.com/apple/2015/06/preview-os-x-el-capitans-first-beta-is-a-promising-heap-of-refinements/4/

On my 10.11 laptop:

csrutil status
System Integrity Protection status: enabled.
Last edited 8 years ago by Kurt Schwehr (previous) (diff)

comment:3 by Kurt Schwehr, 8 years ago

Most recent failure on xcode8... https://travis-ci.org/rouault/gdal_coverage/builds/160642377

trunk_travis_macosx-xcode8_attempt: https://travis-ci.org/rouault/gdal_coverage/builds/160684497

 TEST: ogr_gpkg_17 ... /Users/travis/build.sh: line 45: 48637 Segmentation fault: 11  python run_all.py
git clone git@github.com:rouault/gdal_coverage.git
git checkout --track origin/trunk_travis_macosx-xcode8_attempt

comment:4 by Kurt Schwehr, 7 years ago

Now builds, but have some issues to work through.

Add this to configure. There is where homebrew puts sqlite3:

Error: Failed to load processor bash
No macro or processor named 'bash' found

Some notes from poking about with homebrew so that I have them handy for adding to the .travis.yaml in the future should I need to debug more.

brew list --versions
readline 7.0
sqlite 3.15.0
brew ls --verbose sqlite3
/usr/local/Cellar/sqlite/3.15.0/.brew/sqlite.rb
/usr/local/Cellar/sqlite/3.15.0/bin/sqlite3
/usr/local/Cellar/sqlite/3.15.0/include/sqlite3.h
/usr/local/Cellar/sqlite/3.15.0/include/sqlite3ext.h
/usr/local/Cellar/sqlite/3.15.0/INSTALL_RECEIPT.json
/usr/local/Cellar/sqlite/3.15.0/lib/libsqlite3.0.dylib
/usr/local/Cellar/sqlite/3.15.0/lib/libsqlite3.a
/usr/local/Cellar/sqlite/3.15.0/lib/libsqlite3.dylib
/usr/local/Cellar/sqlite/3.15.0/lib/pkgconfig/sqlite3.pc
/usr/local/Cellar/sqlite/3.15.0/README.txt
/usr/local/Cellar/sqlite/3.15.0/share/man/man1/sqlite3.1
brew info sqlite3
sqlite: stable 3.15.0 (bottled) [keg-only]
Command-line interface for SQLite
https://sqlite.org/
/usr/local/Cellar/sqlite/3.15.0 (11 files, 2.9M)
  Poured from bottle on 2016-10-27 at 15:07:40
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/sqlite.rb
==> Dependencies
Recommended: readline ✔
Optional: icu4c ✘
==> Options
[snip]
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

macOS provides an older sqlite3.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include
    PKG_CONFIG_PATH: /usr/local/opt/sqlite/lib/pkgconfig

I think mdfind doesn't work in appveyor because either they disable the metadata generation or it hasn't had time to get generated. On a local machine with homebrew and fink (/sw):

mdfind libsqlite3 | egrep '[.](dylib|so|la|a)$'
/usr/local/Cellar/sqlite/3.15.0/lib/libsqlite3.0.dylib
/usr/local/Cellar/sqlite/3.15.0/lib/libsqlite3.a
/sw/lib/libsqlite3.la
/sw/lib/sqlite3.13.0/libsqlite3.13.0.dylib
/sw/lib/libsqlite3.0.dylib
/usr/lib/libsqlite3.dylib

otool -L is similar to ldd on linux:

tool -L /usr/lib/libsqlite3.dylib 
/usr/lib/libsqlite3.dylib:
	/usr/lib/libsqlite3.dylib (compatibility version 9.0.0, current version 216.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
otool -L /usr/local/opt/sqlite/lib/libsqlite3.dylib 
/usr/local/opt/sqlite/lib/libsqlite3.dylib:
	/usr/local/opt/sqlite/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

comment:6 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.