Closed salimane closed 9 years ago
/opt/boxen/homebrew/bin/git-credential-osxkeychain
is not present. Any idea how it would have been removed?
here is the content of my our-boxen/facts.d/common.yaml
. I'm using /usr/local
as my homebrew path
---
# Any yaml or json files in this directory may be used to set
# facts. This is useful, primarily, for things like homebrew_root,
# which must be a fact rather than configured with hiera because
# of how Puppet's custom resource providers work.
homebrew_root: /usr/local
brewcask_root: /opt/homebrew-cask
Does this happen on master? There has been some work recently to support custom homebrew root paths.
Does this happen on master? There has been some work recently to support custom homebrew root paths.
Yes, I see this too and my fork is based on 689633f.
Ok, looks like /opt/boxen/bin/boxen-git-credential
needs some updating (and perhaps other things) to respect the custom Homebrew path.
Can somebody confirm that /opt/boxen/bin/boxen-git-credential
does not take up the environment variable BOXEN_GIT_CREDENTIAL_FALLBACK
?
I tried to set it in two different ways:
BOXEN_GIT_CREDENTIAL_FALLBACK=/usr/local/bin/git-credential-osxkeychain git push
export BOXEN_GIT_CREDENTIAL_FALLBACK=/usr/local/bin/git-credential-osxkeychain
git push
They both give me the same unchanged error message:
$ git push sebroeder
/opt/boxen/repo/.bundle/ruby/2.0.0/gems/open4-1.3.4/lib/open4.rb:37:in `exec': No such file or directory - /opt/boxen/homebrew/bin/git-credential-osxkeychain (Errno::ENOENT)
from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/open4-1.3.4/lib/open4.rb:37:in `block in popen4'
from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/open4-1.3.4/lib/open4.rb:85:in `call'
from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/open4-1.3.4/lib/open4.rb:85:in `block in do_popen'
from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/open4-1.3.4/lib/open4.rb:62:in `fork'
from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/open4-1.3.4/lib/open4.rb:62:in `do_popen'
from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/open4-1.3.4/lib/open4.rb:34:in `popen4'
from /opt/boxen/bin/boxen-git-credential:45:in `<main>'
If the handling of environmental variables would work in /opt/boxen/bin/boxen-git-credential
we could set the path to the git-credential-osxkeychain
using ENV['HOMEBREW_ROOT']/bin/git-credential-osxkeychain
but it seems to be broken at the moment.
@sebroeder can you paste the contents of your /opt/boxen/config/boxen/defaults.json
?
Sure.
$ cat /opt/boxen/config/boxen/defaults.json
{"fde":true,
"homedir":"/opt/boxen",
"login":"sebroeder",
"name":"Sebastian Röder",
"puppetdir":"/tmp/boxen/puppet",
"repodir":"/opt/boxen/repo",
"reponame":"boxen/our boxen",
"ghurl":"https://github.com",
"srcdir":"/Users/sebroeder/src",
"user":"sebroeder",
"repotemplate":"https://github.com/%s",
"s3host":"s3.amazonaws.com",
"s3bucket":"boxen-downloads"}
@sebroeder do you have any custom hiera.yaml/facts.d
config? Please post any non-standard Boxen config items.
@seanknox
$ cat hiera/common.yaml
---
boxen::config::srcdir: "/Users/%{::boxen_user}/Developer"
$ cat facts.d/homebrew_root.yaml
---
homebrew_root: /usr/local
@sebroeder @seanknox I can confirm that simply setting homebrew's root to /usr/local
is enough to cause this problem, and I can also confirm that explicitly setting BOXEN_GIT_CREDENTIAL_FALLBACK
does not fix it. Somehow the helper is clearing that variable, I'm guessing somewhere inside boxen/config
. Is there a place we should be setting it inside boxen, instead?
@indirect thanks for confirming the issue. I am not sure how to proceed from here. I want to find out where exactly the env vars are erased as this causes problems for me in other places, too. I also don't know whether the custom boxen-git-credential
helper is needed at all, as discussed in boxen/boxen#169.
The README.md
in boxen/boxen
provides the following info, which might be related to our problem:
We can't pass a FACTER_ env var because sudo has env_reset and we can't just modify the sudoers file due to a chicken-egg problem.
@mikemcquaid do you not experience this issue? My current solution is to hard-code /usr/local
, and that sucks. Is there a variable I can use to access the fact that contains the homebrew root instead?