Installing libxml2-dev libxslt-dev is only needed on TruffleRuby < 21.1

* TruffleRuby >= 21.1 installs nokogiri with the packaged libxml2/libxslt
  like on CRuby by default. See https://github.com/oracle/truffleruby/issues/62
This commit is contained in:
Benoit Daloze
2021-08-07 20:08:38 +02:00
parent 7edf159e98
commit 57d46d78b7
3 changed files with 14 additions and 14 deletions
+4 -4
View File
@@ -40,11 +40,11 @@ function readBundledWithFromGemfileLock(lockFile) {
return null
}
async function afterLockFile(lockFile, platform, engine) {
if (engine.startsWith('truffleruby') && platform.startsWith('ubuntu-')) {
async function afterLockFile(lockFile, platform, engine, rubyVersion) {
if (engine.startsWith('truffleruby') && common.floatVersion(rubyVersion) < 21.1 && platform.startsWith('ubuntu-')) {
const contents = fs.readFileSync(lockFile, 'utf8')
if (contents.includes('nokogiri')) {
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby', async () =>
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby < 21.1', async () =>
exec.exec('sudo', ['apt-get', '-yqq', 'install', 'libxml2-dev', 'libxslt-dev'], { silent: true }))
}
}
@@ -126,7 +126,7 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
await exec.exec('bundle', ['lock'], envOptions)
}
await afterLockFile(lockFile, platform, engine)
await afterLockFile(lockFile, platform, engine, rubyVersion)
// cache key
const paths = [cachePath]
Generated Vendored
+4 -4
View File
@@ -54,11 +54,11 @@ function readBundledWithFromGemfileLock(lockFile) {
return null
}
async function afterLockFile(lockFile, platform, engine) {
if (engine.startsWith('truffleruby') && platform.startsWith('ubuntu-')) {
async function afterLockFile(lockFile, platform, engine, rubyVersion) {
if (engine.startsWith('truffleruby') && common.floatVersion(rubyVersion) < 21.1 && platform.startsWith('ubuntu-')) {
const contents = fs.readFileSync(lockFile, 'utf8')
if (contents.includes('nokogiri')) {
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby', async () =>
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby < 21.1', async () =>
exec.exec('sudo', ['apt-get', '-yqq', 'install', 'libxml2-dev', 'libxslt-dev'], { silent: true }))
}
}
@@ -140,7 +140,7 @@ async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, b
await exec.exec('bundle', ['lock'], envOptions)
}
await afterLockFile(lockFile, platform, engine)
await afterLockFile(lockFile, platform, engine, rubyVersion)
// cache key
const paths = [cachePath]