From 06bf3c6fdc42695eadcdf19c19fd4796a104852b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 17 Sep 2013 18:53:35 -0700 Subject: [PATCH] core: Remove DYLD_LIBRARY_PATH if command not in installer [GH-2219] --- CHANGELOG.md | 2 ++ lib/vagrant/util/subprocess.rb | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b83a3fa4d..5f27112dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## 1.3.3 (unreleased) +BUG FIXES: + - core: Fix issues with dynamic linker not finding symbols on OS X. [GH-2219] ## 1.3.2 (September 17, 2013) diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index bf34556dd..0a7f08580 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -80,6 +80,19 @@ module Vagrant end end + # If we're in the installer and the command is NOT included + # in the installer (external), then remove the DYLD_IMPORT_PATH + # environmental variable to run into linker issues. [GH-2219] + if Vagrant.in_installer? + installer_dir = ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"].to_s.downcase + if !@command[0].downcase.include?(installer_dir) + @logger.info("Command not in the installer. Removing DYLD_LIBRARY_PATH") + process.environment["DYLD_LIBRARY_PATH"] = "" + else + @logger.debug("Command in installer, not touching env vars.") + end + end + # Start the process begin SafeChdir.safe_chdir(workdir) do