This gist relates to sparklemotion/nokogiri#1959
Last active
February 2, 2020 03:41
-
-
Save flavorjones/724995b110dcb6123689b5e18ea7bf38 to your computer and use it in GitHub Desktop.
nokogiri-1959
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2-alpine3.10 | |
RUN apk add build-base imagemagick6-dev bash | |
WORKDIR /app | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'nokogiri' | |
gem 'rmagick' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rmagick" | |
require "nokogiri" | |
require "yaml" | |
puts Nokogiri::VERSION_INFO.to_yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "nokogiri" | |
require "rmagick" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment