Skip to content

Commit 57d46d7

Browse files
committed
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 truffleruby/truffleruby#62
1 parent 7edf159 commit 57d46d7

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

bundler.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ function readBundledWithFromGemfileLock(lockFile) {
4040
return null
4141
}
4242

43-
async function afterLockFile(lockFile, platform, engine) {
44-
if (engine.startsWith('truffleruby') && platform.startsWith('ubuntu-')) {
43+
async function afterLockFile(lockFile, platform, engine, rubyVersion) {
44+
if (engine.startsWith('truffleruby') && common.floatVersion(rubyVersion) < 21.1 && platform.startsWith('ubuntu-')) {
4545
const contents = fs.readFileSync(lockFile, 'utf8')
4646
if (contents.includes('nokogiri')) {
47-
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby', async () =>
48-
exec.exec('sudo', ['apt-get', '-yqq', 'install', 'libxml2-dev', 'libxslt-dev'], { silent: true }))
47+
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby < 21.1', async () =>
48+
exec.exec('sudo', ['apt-get', '-yqq', 'install', 'libxml2-dev', 'libxslt-dev'], { silent: true }))
4949
}
5050
}
5151
}
@@ -126,7 +126,7 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
126126
await exec.exec('bundle', ['lock'], envOptions)
127127
}
128128

129-
await afterLockFile(lockFile, platform, engine)
129+
await afterLockFile(lockFile, platform, engine, rubyVersion)
130130

131131
// cache key
132132
const paths = [cachePath]

dist/index.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ export async function setupRuby(options = {}) {
6464
const [gemfile, lockFile] = bundler.detectGemfiles()
6565

6666
const bundlerVersion = await common.measure('Installing Bundler', async () =>
67-
bundler.installBundler(inputs['bundler'], lockFile, platform, rubyPrefix, engine, version))
67+
bundler.installBundler(inputs['bundler'], lockFile, platform, rubyPrefix, engine, version))
6868

6969
if (inputs['bundler-cache'] === 'true') {
7070
await common.measure('bundle install', async () =>
71-
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
71+
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
7272
}
7373
}
7474

0 commit comments

Comments
 (0)