Skip to content
Snippets Groups Projects
Commit 798711ca authored by Ryan Hendrickson's avatar Ryan Hendrickson Committed by Jack Nagel
Browse files

Use canonical representation of the superenv bin directory


The xcrun script should be skipping the ENV directory when it scans
$PATH looking for tools to run. Unfortunately, the script compares the
paths found to the real path of the ENV directory (following symlinks),
but superenv was adding the nominal path to $PATH, not following
symlinks. As a consequence, platforms with Xcode < 4.3 would get into
infinite loops when trying to call non-system versions of gcc, as xcrun
calls the ENV version of gcc-X.X which calls xcrun and so on forever.

This commit changes superenv to follow symlinks when determining the bin
path to use.

Fixes Homebrew/homebrew#33731.
Closes Homebrew/homebrew#40062.

Signed-off-by: default avatarJack Nagel <jacknagel@gmail.com>
parent 664c8dea
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,8 @@ module Superenv
end
def self.bin
(HOMEBREW_REPOSITORY/"Library/ENV").subdirs.reject { |d| d.basename.to_s > MacOS::Xcode.version }.max
bin = (HOMEBREW_REPOSITORY/"Library/ENV").subdirs.reject { |d| d.basename.to_s > MacOS::Xcode.version }.max
bin.realpath unless bin.nil?
end
def reset
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment