Skip to content

Commit

Permalink
Revert "Support multiple versions native extension gems"
Browse files Browse the repository at this point in the history
This reverts commit eab8aec.

It's difficult to compile Nokogiri 1.5 on OS X.
  • Loading branch information
FooBarWidget committed Dec 21, 2014
1 parent cdad4dd commit 393a928
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 196 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
## Next version

* We now support multiple versions of native extension gems. For example, we now supply Nokogiri 1.5 and 1.6.
* Fixed the mysql2 native extension not working on Linux. This is done by dynamically linking against libstdc++. Closes GH-21.

## Version 20141219
Expand Down
19 changes: 4 additions & 15 deletions linux/build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUNTIME_DIR=
OUTPUT_DIR=
ARCHITECTURE=
CONCURRENCY=$CPUCOUNT
GEMFILE="$SELFDIR/../shared/gemfiles"
GEMFILE="$SELFDIR/../shared/Gemfile"
SETUP_SOURCE=true
COMPILE=true
SANITY_CHECK_OUTPUT=true
Expand Down Expand Up @@ -101,20 +101,9 @@ if [[ ! -e "$RUNTIME_DIR/mock" ]]; then
fi
if [[ "$GEMFILE" != "" ]]; then
GEMFILE="`absolute_path \"$GEMFILE\"`"
if [[ -d "$GEMFILE" ]]; then
for F in "$GEMFILE"/*/Gemfile; do
DIR="`dirname \"$F\"`"
DIR="`basename \"$DIR\"`"
GEMFILE_MOUNT+=(-v "$F:/gemfiles/$DIR/Gemfile:ro")
if [[ -e "$F.lock" ]]; then
GEMFILE_MOUNT+=(-v "$F.lock:/gemfiles/$DIR/Gemfile.lock:ro")
fi
done
else
GEMFILE_MOUNT=(-v "$GEMFILE:/gemfiles/Gemfile:ro")
if [[ -e "$GEMFILE.lock" ]]; then
GEMFILE_MOUNT+=(-v "$GEMFILE.lock:/gemfiles/Gemfile.lock:ro")
fi
GEMFILE_MOUNT=(-v "$GEMFILE:/Gemfile:ro")
if [[ -e "$GEMFILE.lock" ]]; then
GEMFILE_MOUNT+=(-v "$GEMFILE.lock:/Gemfile.lock:ro")
fi
fi

Expand Down
9 changes: 6 additions & 3 deletions linux/internal/build
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ ROOT=/var/lib/mock/$CHROOT_NAME/root
run rm -rf $ROOT/system $ROOT/output
run mkdir $ROOT/system $ROOT/output
run cp /system/* $ROOT/system/
run cp -R /system_shared/* $ROOT/system/
if [[ -e /gemfiles ]]; then
run cp -R /gemfiles $ROOT/system/
run cp /system_shared/* $ROOT/system/
if [[ -e /Gemfile ]]; then
run cp /Gemfile $ROOT/system/
fi
if [[ -e /Gemfile.lock ]]; then
run cp /Gemfile.lock $ROOT/system/
fi
echo "Dumping parameters"
echo $ARCHITECTURE > $ROOT/system/NAME
Expand Down
22 changes: 8 additions & 14 deletions linux/internal/build-inside-mock
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,15 @@ echo $GEM_EXTENSION_API_VERSION > /tmp/ruby/info/GEM_EXTENSION_API_VERSION
# removing explicitly gems.
run rm -rf /tmp/ruby/lib/ruby/gems/$RUBY_COMPAT_VERSION/gems/{test-unit,rdoc}-*

if [[ -e /system/gemfiles ]]; then
if [[ -e /system/Gemfile ]]; then
run /tmp/ruby/bin/gem install bundler -v $BUNDLER_VERSION --no-rdoc --no-ri

for GEMFILE in /system/gemfiles/*/Gemfile; do
run cp "$GEMFILE" /tmp/ruby/
if [[ -e "$GEMFILE.lock" ]]; then
run cp "$GEMFILE.lock" /tmp/ruby/
fi
echo "+ Entering /tmp/ruby"
pushd /tmp/ruby >/dev/null
run /tmp/ruby/bin/bundle install --system --retry 3
run rm Gemfile*
echo "+ Leaving /tmp/ruby"
popd >/dev/null
done
run cp /system/Gemfile* /tmp/ruby
echo "+ Entering /tmp/ruby"
pushd /tmp/ruby >/dev/null
run /tmp/ruby/bin/bundle install --system --retry 3
run rm Gemfile*
echo "+ Leaving /tmp/ruby"
popd >/dev/null
fi

# Strip binaries and remove unnecessary files.
Expand Down
2 changes: 1 addition & 1 deletion linux/internal/setup-runtime
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ header "Installing additional software inside chroot"
run rm -rf /var/lib/mock/$CHROOT_NAME/root/system
run mkdir /var/lib/mock/$CHROOT_NAME/root/system
run cp /system/* /var/lib/mock/$CHROOT_NAME/root/system/
run cp -R /system_shared/* /var/lib/mock/$CHROOT_NAME/root/system/
run cp /system_shared/* /var/lib/mock/$CHROOT_NAME/root/system/
echo $ARCHITECTURE > /var/lib/mock/$CHROOT_NAME/root/system/ARCHITECTURE
run /system/setuser app /usr/bin/mock -r $CHROOT_NAME --shell /system/setup-runtime-inside-mock
run rm -rf /var/lib/mock/$CHROOT_NAME/root/system
Expand Down
44 changes: 0 additions & 44 deletions linux/internal/setup-runtime-inside-mock
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export PATH=/usr/local/override/bin:$PATH
CMAKE_VERSION=3.0.2
OPENSSL_VERSION=1.0.1j
FFI_VERSION=3.2.1
LIBXML2_VERSION=2.9.2
LIBXSLT_VERSION=1.1.28
SQLITE3_VERSION=3080702
MYSQL_LIB_VERSION=6.1.5
POSTGRESQL_VERSION=9.3.5
Expand Down Expand Up @@ -104,48 +102,6 @@ if [[ ! -e /usr/local/override/lib/libffi.so.6 ]]; then
fi
echo

header "Installing libxml2"
if [[ ! -e /usr/local/override/lib/libxml2.a ]]; then
download_and_extract libxml2-$LIBXML2_VERSION.tar.gz \
ftp://xmlsoft.org/libxml2/libxml2-$LIBXML2_VERSION.tar.gz
echo "Entering libxml2-$LIBXML2_VERSION"
pushd libxml2-$LIBXML2_VERSION >/dev/null

run ./configure --prefix=/usr/local/override --disable-shared \
--without-debug --without-docbook --without-fexceptions \
--without-ftp --without-http --without-history --without-mem-debug \
--without-python --without-readline --with-c14n \
--with-threads CFLAGS='-fPIC -fvisibility=hidden'
run make -j$CONCURRENCY
run make install-strip

echo "Leaving source directory"
popd >/dev/null
run rm -rf libxml2-$LIBXML2_VERSION
fi
echo

header "Installing libxslt"
if [[ ! -e /usr/local/override/lib/libxslt.a ]]; then
download_and_extract libxslt-$LIBXSLT_VERSION.tar.gz \
ftp://xmlsoft.org/libxml2/libxslt-$LIBXSLT_VERSION.tar.gz
echo "Entering libxslt-$LIBXSLT_VERSION"
pushd libxslt-$LIBXSLT_VERSION >/dev/null

run ./configure --prefix=/usr/local/override --disable-shared \
--without-python --without-crypto --without-debug \
--without-mem-debug --without-debugger \
CFLAGS='-fPIC -fvisibility=hidden'
run make -j$CONCURRENCY
run make install-strip

echo "Leaving source directory"
popd >/dev/null
run rm -rf libxslt-$LIBXSLT_VERSION
fi
echo

header "Installing SQLite3"
if [[ ! -e /usr/local/override/lib/libsqlite3.a ]]; then
download_and_extract sqlite-autoconf-$SQLITE3_VERSION.tar.gz \
http://www.sqlite.org/2014/sqlite-autoconf-$SQLITE3_VERSION.tar.gz
Expand Down
44 changes: 17 additions & 27 deletions osx/build
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ BUNDLER_VERSION=`cat "$SELFDIR/../BUNDLER_VERSION.txt"`

WORKDIR=
OWNS_WORKDIR=true
GEMFILES=()

RUNTIME_DIR=
OUTPUT_DIR=
CONCURRENCY=4
GEMFILE="$SELFDIR/../shared/gemfiles"
GEMFILE="$SELFDIR/../shared/Gemfile"
SETUP_SOURCE=true
COMPILE=true

Expand Down Expand Up @@ -177,11 +176,6 @@ else
fi
if [[ "$GEMFILE" != "" ]]; then
GEMFILE="`absolute_path \"$GEMFILE\"`"
if [[ -d "$GEMFILE" ]]; then
GEMFILES=("$GEMFILE"/*/Gemfile)
else
GEMFILES=("$GEMFILE")
fi
fi


Expand Down Expand Up @@ -274,29 +268,25 @@ if [[ "$GEMFILE" != "" ]]; then
run /tmp/ruby/bin/gem install "$RUNTIME_DIR/vendor/cache/bundler-$BUNDLER_VERSION.gem" --no-rdoc --no-ri
else
run /tmp/ruby/bin/gem install bundler -v $BUNDLER_VERSION --no-rdoc --no-ri
run mkdir -p "$RUNTIME_DIR/vendor/cache"
run cp /tmp/ruby/lib/ruby/gems/$RUBY_COMPAT_VERSION/cache/bundler-$BUNDLER_VERSION.gem "$RUNTIME_DIR/vendor/cache/"
fi

# Run bundle install.
for GEMFILE in "${GEMFILES[@]}"; do
run cp "$GEMFILE" /tmp/ruby/
if [[ -e "$GEMFILE.lock" ]]; then
run cp "$GEMFILE.lock" /tmp/ruby/
fi
echo "+ Entering /tmp/ruby"
pushd /tmp/ruby >/dev/null
run /tmp/ruby/bin/bundle config --local build.nokogiri ""
run /tmp/ruby/bin/bundle config --local build.mysql2 "--with-mysql_config"
run /tmp/ruby/bin/bundle install --system --retry 3
run /tmp/ruby/bin/bundle package
run rm -rf "$RUNTIME_DIR/vendor"
run mv vendor "$RUNTIME_DIR/"

run rm -rf Gemfile* .bundle
echo "+ Leaving /tmp/ruby"
popd >/dev/null
done
run cp "$GEMFILE" /tmp/ruby/
if [[ -e "$GEMFILE.lock" ]]; then
run cp "$GEMFILE.lock" /tmp/ruby/
fi
echo "+ Entering /tmp/ruby"
pushd /tmp/ruby >/dev/null
run /tmp/ruby/bin/bundle config --local build.nokogiri ""
run /tmp/ruby/bin/bundle config --local build.mysql2 "--with-mysql_config"
run /tmp/ruby/bin/bundle install --system --retry 3
run /tmp/ruby/bin/bundle package
run rm -rf "$RUNTIME_DIR/vendor"
run mv vendor "$RUNTIME_DIR/"
run cp /tmp/ruby/lib/ruby/gems/$RUBY_COMPAT_VERSION/cache/bundler-$BUNDLER_VERSION.gem "$RUNTIME_DIR/vendor/cache/"
run rm -rf Gemfile* .bundle
echo "+ Leaving /tmp/ruby"
popd >/dev/null
fi

# Strip binaries and remove unnecessary files.
Expand Down
Loading

0 comments on commit 393a928

Please sign in to comment.