159 Commits

Author SHA1 Message Date
Andrew Janke
257e245944 Fix bogus comparison operation that was breaking error handling 2018-12-25 17:19:23 -05:00
William Woodruff
b7d84f2d9e
build: Propagate entire ErrorDuringExecution
Fixes https://github.com/Homebrew/brew/issues/5427.
2018-12-23 11:26:12 -05:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
William Woodruff
367629d289
utils: Use JSON to marshal child errors
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.
2018-09-04 11:03:32 -04:00
Mike McQuaid
80d75bc0d8
Homebrew/.rubocop: tweak rules.
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.
2018-09-02 20:15:09 +01:00
Mike McQuaid
7df5b7057e
Revert "Use JSON to marshal errors from children" 2018-08-18 08:20:13 +01:00
William Woodruff
5c90833f0a
Use JSON to marshal errors from children 2018-08-17 15:23:08 -04:00
Shaun Jackman
76bfd0cecb Add superenv for Linux 2018-05-18 16:58:21 -07:00
Mike McQuaid
592bafe24e Refactor dependencies usage
Reuse more code to avoid errors due to duplication.
2018-03-24 16:55:16 +00:00
ilovezfs
e0a5284d7b
Revert "build: do not skip runtime deps of buildtime deps" 2018-03-21 05:30:51 -07:00
Viktor Oreshkin
2e33541278 build: do not skip runtime deps of buildtime deps
Fix #3883
Revert 2fb5ead38a7632ff6f941909474767883a9e0252
2018-03-12 22:36:47 +03:00
Mike McQuaid
b70b5429d0 Deprecate default_formula Requirement DSL
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.
2018-01-14 13:27:43 +00:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
ilovezfs
732bf2212d build: fix HOMEBREW_FORMULA_PREFIX for head
so that it includes the commit.
2017-09-10 02:51:16 -07:00
Misty De Meo
8e645dfbec
build: use with_env helper 2017-07-15 17:40:55 -07:00
Mike McQuaid
0158cc2e23 build: don't assume requirement dependency is default formula. 2017-01-11 12:01:08 -08:00
Mike McQuaid
3396d479d2 build: write options to file.
These can be useful for later inspection or upload by `gist-logs` if
there's a failed install and it's unclear from logs alone what options
were used.
2016-10-30 16:14:51 -04:00
Markus Reiter
a5b11a6a5c Fix Style/GuardClause. 2016-09-23 15:30:07 +02:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Zhiming Wang
e82347b233
Restrict TMPDIR etc. changes to install, post_install and test
See discussion in Homebrew/brew#800.
2016-08-26 12:39:27 +08:00
Mike McQuaid
602fb0e575 Make -no_weak_imports opt-in.
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.
2016-08-22 10:39:38 +01:00
Mike McQuaid
3c65298519 build: permit weak imports in Go reverse deps.
Go makes extensive use of weak imports so we need to allow them when
building Go-using software.

Closes https://github.com/Homebrew/homebrew-core/issues/4047.
2016-08-20 16:45:02 +01:00
Martin Afanasjew
bf40dd64df tab: eliminate redundant 'Tab.create' arguments (#468)
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.
2016-07-08 01:14:34 +02:00
Andrew Janke
acc9a7ca85 brew test, install, update-test: add --keep-tmp option
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>
2016-04-18 12:23:08 -04:00
Alex Dunn
37e61aed62 build#install: install metafiles in buildpath
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.
2016-01-20 11:42:36 -08:00
Xu Cheng
6c8c56a689 build: store source modified time in tabfile 2016-01-15 16:26:04 +08:00
Syed Humza Shah
5607858d90 build: removed instance of redundant mapping 2015-11-24 10:48:26 +00:00
Xu Cheng
ddb630b01c move sudo -k to formula_installer
sudo -k cannot be used inside sandbox

Closes Homebrew/homebrew#43345.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-28 17:15:29 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
e40b735217 Decouple detect_stdlibs from ENV
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.
2015-06-25 23:42:54 -04:00
Jack Nagel
7edf3c88f6 Pass formula objects, not strings, into the build environment 2015-06-18 23:13:48 -04:00
Mike McQuaid
1e86730289 Rename requirements named *Dependency.
Dependency is another similar, related class and it's super confusing
to have some Requirements that are named *Dependency.

Closes Homebrew/homebrew#38891.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-16 08:12:01 +01:00
Xu Cheng
d2cd7ffdf2 build: use Formula#full_name 2015-05-29 17:01:53 +08:00
Jack Nagel
c2dcd91bd1 Eliminate a place where ARGV is mutated 2015-04-16 22:20:59 -04:00
Xu Cheng
c952fda202 build: fix typo 2015-04-15 19:51:54 +08:00
Xu Cheng
f5c8e3fdbd Use UNIXSocket to pass file descriptor
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.

Closes Homebrew/homebrew#38434.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-09 15:31:47 +08:00
Xu Cheng
d632294f0f ensure metafiles being installed to prefix rather than libexec
This is a follow-up of Homebrew/homebrew#37734. I think we should treat `install_metafiles` as
a general issue rather than a formula-specific one.

Closes Homebrew/homebrew#37968.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-03-27 16:00:37 +08:00
Jack Nagel
0b8cf49386 Remove unnecessary code from debugger 2014-12-26 22:58:36 -05:00
Jack Nagel
2ff86eb417 Decouple applying patches from staging the source 2014-12-26 17:44:44 -05:00
Jack Nagel
3c9cc18c17 Add ARGV.git? 2014-11-03 21:39:11 -06:00
Jack Nagel
3bbc9998a5 Rewrite debugger to remove monkeypatches and use of call/cc 2014-09-18 14:16:07 -05:00
Jack Nagel
f3b7c3236b Consistently call name on formula instead of relying on to_s 2014-09-14 11:19:30 -05:00
Jack Nagel
b14851903c Add a method for retrieving only flags from ARGV 2014-08-29 19:38:32 -05:00
Jack Nagel
26467fa9d7 Make sure all exceptions are sent back to the parent process 2014-08-27 17:25:13 -05:00
Jack Nagel
9386902cf8 Explicitly pass options into the build object 2014-08-27 17:25:13 -05:00
Jack Nagel
889996daf1 Spell out formula in parameter and attribute names 2014-08-27 17:25:13 -05:00
Jack Nagel
f5d18cceb6 Structure the build process so that we don't need an at_exit hook 2014-08-26 22:06:43 -05:00
Jack Nagel
8aabba670f Consider on-disk state when computing dependencies
Fixes Homebrew/homebrew#28754.
Fixes Homebrew/homebrew#29846.
Fixes Homebrew/homebrew#30920.
2014-08-24 14:46:34 -05:00
Jack Nagel
05bb612ce7 Use opt_prefix instead of constructing it manually 2014-08-23 17:42:13 -05:00