Merge pull request #76765 from andersk/vagrant-nameerror

vagrant: Resolve crash by replacing gem symlinks with directories
This commit is contained in:
Jörg Thalheim 2020-01-06 16:30:32 +00:00 committed by GitHub
commit 7178637a89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,17 @@ let
inherit version;
};
} // lib.optionalAttrs withLibvirt (import ./gemset_libvirt.nix));
# This replaces the gem symlinks with directories, resolving this
# error when running vagrant (I have no idea why):
# /nix/store/p4hrycs0zaa9x0gsqylbk577ppnryixr-vagrant-2.2.6/lib/ruby/gems/2.6.0/gems/i18n-1.1.1/lib/i18n/config.rb:6:in `<module:I18n>': uninitialized constant I18n::Config (NameError)
postBuild = ''
for gem in "$out"/lib/ruby/gems/*/gems/*; do
cp -a "$gem/" "$gem.new"
rm "$gem"
mv "$gem.new" "$gem"
done
'';
};
in buildRubyGem rec {
@ -79,12 +90,7 @@ in buildRubyGem rec {
'';
installCheckPhase = ''
if [[ "$("$out/bin/vagrant" --version)" == "Vagrant ${version}" ]]; then
echo 'Vagrant smoke check passed'
else
echo 'Vagrant smoke check failed'
return 1
fi
HOME="$(mktemp -d)" $out/bin/vagrant init --output - > /dev/null
'';
# `patchShebangsAuto` patches this one script which is intended to run