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

Cask install not including HOMEBREW_PREFIX/(s)bin in PATH #3630

Closed
4 tasks done
thieman opened this issue Jan 5, 2018 · 8 comments
Closed
4 tasks done

Cask install not including HOMEBREW_PREFIX/(s)bin in PATH #3630

thieman opened this issue Jan 5, 2018 · 8 comments
Assignees
Labels
cask Homebrew Cask

Comments

@thieman
Copy link

thieman commented Jan 5, 2018

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

Please always follow these steps:

  • Confirmed this is a problem with running a brew command and not brew installing or the post-install behaviour of one or more formulae? If it's a formulae-specific problem please file this issue at the relevant tap e.g. for Homebrew/homebrew-core https://github.com/Homebrew/homebrew-core/issues/new
  • Submitter's note: I believe this is a brew problem that manifests itself during post_install, so I thought I met this bullet. If not please let me know if there's a better place for me to submit.
  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed all issues and retried your prior step?
  • Ran brew config and brew doctor and included their output with your issue?

To help us debug your issue please explain:

  • What you were trying to do (and why)
  • What happened (include command output)
  • What you expected to happen
  • Step-by-step reproduction instructions (by running brew commands)

Features

A cask I'm trying to install is failing because the Homebrew bin directory is not included in the PATH during its post_install step. This worked until recently but is giving us the following with Homebrew 1.4.2.

The cask we were using is dusty, so you should be able to repro with brew cask install dusty, though it's pretty heavyweight and installs Docker Toolbox as a dependency. The post_install of this cask will print out the PATH.

It looks like from #3576 and #3581 that it's still expected that the Homebrew bin dir be included in this PATH, but for whatever reason we're not getting it.

/usr/local is our HOMEBREW_PREFIX. The PATH of the user we're running brew as is:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

But the PATH during post_install is:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Homebrew/Library/Homebrew/shims/scm

The full env of the user, in case it's useful:

SSH_AGENT_PID=2689
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/jz/g13f41n95c106mxy3p1v4fv00000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.v5EwzGaIHP/Render
TERM_PROGRAM_VERSION=400
TERM_SESSION_ID=D9A77ED6-40E6-451F-8AEE-7952A19A3407
USER=redacted_username
SSH_AUTH_SOCK=/var/folders/jz/g13f41n95c106mxy3p1v4fv00000gn/T//ssh-IQ1vzwLvRTmr/agent.2688
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/redacted_username/Desktop
LANG=en_US.UTF-8
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/redacted_username
LOGNAME=redacted_username
_=/usr/bin/env
OLDPWD=/Users/redacted_username

brew config

HOMEBREW_VERSION: 1.4.2
ORIGIN: https://github.com/Homebrew/brew
HEAD: 4e08da95c34c27ba6d5ca5f80718fe2788337cdf
Last commit: 5 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 260006b775674e736785a27bef2410cbc45ea47d
Core tap last commit: 8 hours ago
HOMEBREW_PREFIX: /usr/local
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.3.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 9.0 build 900
Git: 2.14.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Java: N/A
macOS: 10.13.2-x86_64
Xcode: N/A
CLT: 9.2.0.0.1.1510905681
X11: N/A

brew doctor

Your system is ready to brew.
@ilovezfs
Copy link
Contributor

ilovezfs commented Jan 5, 2018

@reitermarkus Casks don't have "post_install" do they?

@ilovezfs ilovezfs added the cask Homebrew Cask label Jan 5, 2018
@thieman
Copy link
Author

thieman commented Jan 5, 2018

My mistake, looks like what I'm talking about is actually the installer key. Cask in question: https://github.com/caskroom/homebrew-cask/blob/master/Casks/dusty.rb

Quite possible those linked issues don't apply, in that case. Is removing the Homebrew bin directory from PATH for these installs intentional, then?

@ilovezfs
Copy link
Contributor

ilovezfs commented Jan 5, 2018

Try

HOMEBREW_NO_ENV_FILTERING=1 brew cask ...

@thieman
Copy link
Author

thieman commented Jan 5, 2018

Ah ok now I think this is probably a dupe of #3191. I'll give that flag a try next time I'm at that machine, or maybe try adding the PATH to our formula as Mike seems to be suggesting in that issue. Sort of a bummer that this broke our Cask but I'm guessing that was anticipated with the env filtering changes.

@MikeMcQuaid
Copy link
Member

Quite possible those linked issues don't apply, in that case. Is removing the Homebrew bin directory from PATH for these installs intentional, then?

Yep but it may not be for brew cask.

@reitermarkus
Copy link
Member

Yeah, I think installer should always add Homebrew‘s bin to the PATH.

@stale
Copy link

stale bot commented Jan 29, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Jan 29, 2018
@thieman
Copy link
Author

thieman commented Jan 29, 2018

@reitermarkus If this is something you think is worth fixing, do we need to do anything to protect it from being closed by the stalebot?

@stale stale bot removed the stale No recent activity label Jan 29, 2018
@ghost ghost assigned reitermarkus Feb 13, 2018
@ghost ghost added the in progress Maintainers are working on this label Feb 13, 2018
@ghost ghost removed the in progress Maintainers are working on this label Feb 13, 2018
@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cask Homebrew Cask
Projects
None yet
Development

No branches or pull requests

4 participants