Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

nokogiri should compile with system libs #124

Merged
merged 1 commit into from

2 participants

@hone
Owner

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.

@hone hone 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.
05a8582
@hone
Owner

tests are passing for me locally. Not sure what's up with Travis.

@hone hone merged commit b6687d1 into master
@hone hone deleted the nokogiri branch
@dpiddy
Owner

Nice, does this make the slug smaller too?

@hone
Owner

it should b/c it doesn't compile the ext/ stuff, but i haven't done comparison tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 5, 2013
  1. @hone

    nokogiri should compile with system libs

    hone authored
    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.
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.