Also:
- when `brew test` or `brew postinstall` is run allow `Resource#stage`
to fetch the resource.
- make `Formula#fetch` and `Resource#fetch` fetch external patches too.
Follow-up from #7549 and #7546.
Replaces our serialization of child process
errors via Marshal with JSON, preventing
unintentional or malicious code execution outside
of the build sandbox.
Additionally, adds tests for the new behavior.
Adjust the rules based on the current codebase. Remove various enable,
disables and default values that are unnecessary. Add more comments
explaining why. Make minor changes needed to enable a few more rules.
This has been a nightmare in terms of the complexity to our dependency
system and the whack-a-mole required on bugs. If a Requirement resolves
to a Formula it should just use `depends_on "formula"` instead. This
matches the effective behaviour all users of bottles (the vast majority
of users and installs) and what we're doing in Homebrew/homebrew-core.
The experiment to add `-no_weak_imports` unconditionally has been a bit
of a failure. It's broken more than it's fixed and I don't think we can
have this as a default for Xcode 8.
Add `ENV.no_weak_imports` to be used by formulae authors and make
`ENV.no_weak_imports a no-op (for now).
We may reconsider this behaviour in future.
The `build` and `source_modified_time` arguments are always coming from
the matching attributes of the `Formula` instance. Thus query `formula`
for them instead of passing them individually.
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.
Closes#66.
Signed-off-by: Andrew Janke <andrew@apjanke.net>
This came up in https://github.com/Homebrew/homebrew-emacs/pull/158#issuecomment-172031003; `install_metafiles` is passed the current directory, which can be changed during installation by `Dir.chdir`.
There may be cases where the metafiles are in a subdirectory, but my
guess is those are rare and this is brittle and undocumented behavior
anyway.
I want to decouple from the global ENV constant as much as possible so
that eventually we can change the build environment implementation.
detect_stdlibs only cares about the compiler, not the whole ENV.
Dependency is another similar, related class and it's super confusing
to have some Requirements that are named *Dependency.
ClosesHomebrew/homebrew#38891.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This is a more standard way to pass fd in UNIX world.
At the same time, it helps to remove a few hacks and
simplifies the code in the sandbox.
ClosesHomebrew/homebrew#38434.
Signed-off-by: Xu Cheng <xucheng@me.com>