-
-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keg_relocate: Check HOMEBREW_TEMP's realpath when excluding name changes #1801
Conversation
…ges. Since /tmp (the default HOMEBREW_TEMP) is a symlink to /private/tmp, some build systems (like Parrot's) will attempt to use the realpath instead of the literal /tmp we supply it with. This breaks the relocation code, which only tested the literal HOMEBREW_TEMP and not its realpath.
This also fixed open-zwave. https://bot.brew.sh/job/Homebrew%20Sierra%20Testing/1185/ Thanks! |
next if bad_name.start_with?("/") && !bad_name.start_with?(HOMEBREW_TEMP.to_s) | ||
next if bad_name.start_with?("/") && | ||
!bad_name.start_with?(HOMEBREW_TEMP.to_s) && | ||
!bad_name.start_with?(HOMEBREW_TEMP.realpath.to_s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this not 💥 if HOMEBREW_TEMP
isn't a symlink?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can call realpath on anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, forgot it'll only 💥 on bad symlinks in which case you'll have other problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good to know. So readlink
requires a symlink but can read a bad link, and realpath
will accept non-symlinks, but dies on a bad link. Sometimes I wonder if these functions are out to get us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I was maybe thinking of readlink
...). Yes, they definitely are.
brew tests
with your changes locally?Since
/tmp
(the defaultHOMEBREW_TEMP
) is a symlink to/private/tmp
,some build systems (like Parrot's) will attempt to use the realpath
instead of the literal
/tmp
we supply it with. This breaks the relocationcode, which only tested the literal
HOMEBREW_TEMP
and not its realpath.Fixes parrot bottling in Homebrew/homebrew-core#6408.
Ping @ilovezfs