Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

nokogiri should compile with system libs

As of nokogiri 1.6.0, they default to using the vendored libxml2 libs.
This is problematic for two reasons. First, with the way the heroku
build environment works,
sparklemotion/nokogiri#923. This means it
won't link nokogiri.so properly since it's dependent on hardcoded paths
that don't exist during runtime. Second, compiling libxml2 and friends
is unnecessary since we have them already setup. We should skip this to
speed up deploys.
  • Loading branch information...
commit 05a85820a4399a5d46f87cd630bab2a87589b553 1 parent b0ae4a2
@hone hone authored
Showing with 12 additions and 2 deletions.
  1. +2 −1  hatchet.json
  2. +3 −1 lib/language_pack/ruby.rb
  3. +7 −0 spec/bugs_spec.rb
View
3  hatchet.json
@@ -2,7 +2,8 @@
"bundler": [
"sharpstone/git_gemspec",
"sharpstone/no_lockfile",
- "sharpstone/sqlite3_gemfile"
+ "sharpstone/sqlite3_gemfile",
+ "sharpstone/nokogiri_160"
],
"ruby": [
"sharpstone/mri_187"
View
4 lib/language_pack/ruby.rb
@@ -519,7 +519,7 @@ def build_bundler
bundler_path = "#{pwd}/#{slug_vendor_base}/gems/#{BUNDLER_GEM_PATH}/lib"
# we need to set BUNDLE_CONFIG and BUNDLE_GEMFILE for
# codon since it uses bundler.
- env_vars = "env BUNDLE_GEMFILE=#{pwd}/Gemfile BUNDLE_CONFIG=#{pwd}/.bundle/config CPATH=#{yaml_include}:$CPATH CPPATH=#{yaml_include}:$CPPATH LIBRARY_PATH=#{yaml_lib}:$LIBRARY_PATH RUBYOPT=\"#{syck_hack}\""
+ env_vars = "env BUNDLE_GEMFILE=#{pwd}/Gemfile BUNDLE_CONFIG=#{pwd}/.bundle/config CPATH=#{yaml_include}:$CPATH CPPATH=#{yaml_include}:$CPPATH LIBRARY_PATH=#{yaml_lib}:$LIBRARY_PATH RUBYOPT=\"#{syck_hack}\" NOKOGIRI_USE_SYSTEM_LIBRARIES=true"
env_vars += " BUNDLER_LIB_PATH=#{bundler_path}" if ruby_version && ruby_version.match(/^ruby-1\.8\.7/)
puts "Running: #{bundle_command}"
instrument "ruby.bundle_install" do
@@ -748,6 +748,8 @@ def load_bundler_cache
purge_bundler_cache
end
+ purge_bundler_cache if @metadata.exists?(buildpack_version_cache) && @metadata.read(buildpack_version_cache).sub('v', '').to_i <= 76
+
FileUtils.mkdir_p(heroku_metadata)
@metadata.write(ruby_version_cache, full_ruby_version, false)
@metadata.write(buildpack_version_cache, BUILDPACK_VERSION, false)
View
7 spec/bugs_spec.rb
@@ -9,4 +9,11 @@
end
end
end
+
+ it "nokogiri should use the system libxml2" do
+ Hatchet::Runner.new("nokogiri_160").deploy do |app|
+ expect(app.output).to match("Installing nokogiri")
+ expect(app.run("bundle exec nokogiri -v")).not_to include("ARNING: Nokogiri was built against LibXML version")
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.