Skip to content
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

Merged
merged 1 commit into from
Jan 8, 2017

Conversation

woodruffw
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew tests with your changes locally?

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.

Fixes parrot bottling in Homebrew/homebrew-core#6408.

Ping @ilovezfs

…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.
@BrewTestBot BrewTestBot added the in progress Maintainers are working on this label Jan 7, 2017
@ilovezfs ilovezfs merged commit f7bccee into Homebrew:master Jan 8, 2017
@BrewTestBot BrewTestBot removed the in progress Maintainers are working on this label Jan 8, 2017
@ilovezfs
Copy link
Contributor

ilovezfs commented Jan 8, 2017

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)
Copy link
Member

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?

Copy link
Contributor

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

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member

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.

@woodruffw woodruffw deleted the check-temp-correctly branch January 8, 2017 16:18
@Homebrew Homebrew locked and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants