Closed chdiza closed 7 years ago
HOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 53713593d677cb916402742940d14bfc7e60a5a4
Last commit: 4 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 22a2eeeff1294a9c3dddfc91f1768c653726e501
Core tap last commit: 18 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/hb
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit ivybridge
Homebrew Ruby: 2.0.0-p648
Clang: 7.3 build 703
Git: 2.10.0 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: N/A
OS X: 10.11.6-x86_64
Xcode: 7.3.1
CLT: 7.3.1.0.1.1461711523
X11: 2.7.9 => /opt/X11
as a pragmatic workaround --no-sandbox
The problem is allow_write_sandbox
in sandbox.rb
:
# Xcode projects expect access to certain cache/archive dirs.
def allow_write_xcode
allow_write_path "/Users/#{ENV["USER"]}/Library/Developer/Xcode/DerivedData/"
end
It grants writing access to that path, but apparently you can't create parent directories. A workaround is to create the directory and its parents outright to prevent problems like this.
CC @xu-cheng @DomT4.
How did this make it pass CI? Seems like it ought to have bombed out.
The CI isn't "clean". That path would have been created before the sandbox was implemented, and not scrubbed since, allowing it to create further things below that.
@DomT4 Thoughts about mkdir_p
the path in allow_write_xcode
, and similar changes for other whitelisted paths maybe?
I think this might be a flaw in the HB sandbox code rather than in
mas
, but...Trying to install
mas
from source fails if my~/Library/Developer
doesn't already exist (or if any subdirs thereof that are needed, such asXcode
, don't exist). I get the following:If after a failure I manually create the dir that's being complained about, the next brew attempt will succeed.
I've never seen anything like this before. I can build other apps, outside HB, that write to ~/Library/Developer with zero problems.