Skip to content

Instantly share code, notes, and snippets.

@flavorjones
Last active February 2, 2020 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flavorjones/724995b110dcb6123689b5e18ea7bf38 to your computer and use it in GitHub Desktop.
Save flavorjones/724995b110dcb6123689b5e18ea7bf38 to your computer and use it in GitHub Desktop.
nokogiri-1959
#! /usr/bin/env bash
so=$1
if [[ $so == "" ]] ; then
echo "searching for shared library ..."
path=$(gem info nokogiri | fgrep Installed | cut -d: -f2)
echo "... gem installed in $path"
so=$(find $path -name nokogiri.so | xargs ls -t | head -n1)
echo "... FOUND: $so"
fi
nm $so | fgrep Init_nokogiri
entry=$(nm $so | fgrep Init_nokogiri | head -n1 | cut -d' ' -f2)
if [[ $entry == "t" ]] ; then
echo "ruby entry symbol is private"
elif [[ $entry == "T" ]] ; then
echo "ruby entry symbol is exported (public)"
else
echo "ERROR: symbol table entry tagged '$entry'"
fi
nm $so | fgrep xmlXPtrEvalRangePredicate
entry=$(nm $so | fgrep xmlXPtrEvalRangePredicate | head -n1 | cut -d' ' -f2)
if [[ $entry == "t" ]] ; then
echo "libxml2 symbols are private"
elif [[ $entry == "T" ]] ; then
echo "libxml2 symbols are exported (public)"
else
echo "ERROR: symbol table entry tagged '$entry'"
fi
version: '3'
services:
ruby:
environment: { MAKEFLAGS: "-j8" }
build: .
command: sh -c "gem install rmagick mini_portile2 && gem install nokogiri && ruby repro.rb && ./check-symbol-table.sh"
volumes:
- ./:/app
ruby-proposed-fix:
environment: { MAKEFLAGS: "-j8" }
build: .
command: sh -c "gem install rmagick mini_portile2 && gem install --local nokogiri-1.10.1000.gem && ruby repro.rb && ./check-symbol-table.sh"
volumes:
- ./:/app
ruby-workaround:
environment: { MAKEFLAGS: "-j8" }
build: .
command: sh -c "bundle && bundle exec ruby workaround.rb"
volumes:
- ./:/app
FROM ruby:2-alpine3.10
RUN apk add build-base imagemagick6-dev bash
WORKDIR /app
source 'https://rubygems.org'
gem 'nokogiri'
gem 'rmagick'
GEM
remote: https://rubygems.org/
specs:
mini_portile2 (2.4.0)
nokogiri (1.10.7)
mini_portile2 (~> 2.4.0)
rmagick (4.0.0)
PLATFORMS
ruby
DEPENDENCIES
nokogiri
rmagick
BUNDLED WITH
2.1.2
require "rmagick"
require "nokogiri"
require "yaml"
puts Nokogiri::VERSION_INFO.to_yaml
require "nokogiri"
require "rmagick"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment