Merge pull request #10647 from chrisroberts/f-appimage-ld

Use ld path with appimage libs on suffix
This commit is contained in:
Brian Cain 2019-02-12 09:58:53 -08:00 committed by GitHub
commit 26d05130c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -129,10 +129,10 @@ module Vagrant
if ENV["VAGRANT_APPIMAGE"] if ENV["VAGRANT_APPIMAGE"]
embed_path = Pathname.new(Vagrant.installer_embedded_dir).expand_path.to_s embed_path = Pathname.new(Vagrant.installer_embedded_dir).expand_path.to_s
exec_path = Pathname.new(@command[0]).expand_path.to_s exec_path = Pathname.new(@command[0]).expand_path.to_s
if !exec_path.start_with?(embed_path) && ENV["VAGRANT_APPIMAGE_LD_LIBRARY_PATH"] if !exec_path.start_with?(embed_path) && ENV["VAGRANT_APPIMAGE_HOST_LD_LIBRARY_PATH"]
@logger.info("Detected AppImage environment and request to external binary. Updating library path.") @logger.info("Detected AppImage environment and request to external binary. Updating library path.")
@logger.debug("Setting LD_LIBRARY_PATH to #{ENV["VAGRANT_APPIMAGE_LD_LIBRARY_PATH"]}") @logger.debug("Setting LD_LIBRARY_PATH to #{ENV["VAGRANT_APPIMAGE_HOST_LD_LIBRARY_PATH"]}")
process.environment["LD_LIBRARY_PATH"] = ENV["VAGRANT_APPIMAGE_LD_LIBRARY_PATH"].to_s process.environment["LD_LIBRARY_PATH"] = ENV["VAGRANT_APPIMAGE_HOST_LD_LIBRARY_PATH"].to_s
end end
end end
else else

View File

@ -69,7 +69,7 @@ describe Vagrant::Util::Subprocess do
allow(process_env).to receive(:[]=) allow(process_env).to receive(:[]=)
allow(ENV).to receive(:[]).with("VAGRANT_INSTALLER_ENV").and_return("1") allow(ENV).to receive(:[]).with("VAGRANT_INSTALLER_ENV").and_return("1")
allow(ENV).to receive(:[]).with("VAGRANT_APPIMAGE").and_return("1") allow(ENV).to receive(:[]).with("VAGRANT_APPIMAGE").and_return("1")
allow(ENV).to receive(:[]).with("VAGRANT_APPIMAGE_LD_LIBRARY_PATH").and_return(appimage_ld_path) allow(ENV).to receive(:[]).with("VAGRANT_APPIMAGE_HOST_LD_LIBRARY_PATH").and_return(appimage_ld_path)
allow(File).to receive(:file?).with(exec_path).and_return(true) allow(File).to receive(:file?).with(exec_path).and_return(true)
allow(ChildProcess).to receive(:build).and_return(process) allow(ChildProcess).to receive(:build).and_return(process)
allow(Vagrant).to receive(:installer_embedded_dir).and_return(appimage_path) allow(Vagrant).to receive(:installer_embedded_dir).and_return(appimage_path)