190 Commits

Author SHA1 Message Date
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
Jack Nagel
3d26b75847 Pull common stdlib checking code into a method 2014-08-22 22:18:03 -05:00
Jack Nagel
2a5218dacc Remove unnecessary lasgn 2014-08-09 17:50:55 -05:00
Jack Nagel
47a82b036e Move tab creation outside of the debug loop 2014-08-09 17:50:53 -05:00
Jack Nagel
105db77fc0 Extract build-time stdlib check to a method 2014-08-09 17:50:52 -05:00
Jack Nagel
142beddd7a Use polymorphism to simplify stdlib compatibility check 2014-08-02 19:29:59 -05:00
Jack Nagel
393e10849b Pass the build object into the Tab
Since the Tab is written in the build process, the formula's build
object will have the correct args attached to it already, so we don't
need to reconstruct it.
2014-07-30 20:27:46 -05:00
Jack Nagel
c1ba34734d Remove unused require 2014-07-29 17:09:04 -05:00
Jack Nagel
3f12ddbccd Decouple DATA patches from the executing script 2014-07-29 16:22:06 -05:00
Jack Nagel
8ca8ec3993 Fix up dep directories before activating ENV extensions 2014-07-28 23:20:23 -05:00
Jack Nagel
8a971f7268 Move the fixopt method into the Build class 2014-07-28 21:25:49 -05:00
Jack Nagel
001b2ee471 Reuse existing keg object 2014-06-26 17:21:10 -05:00
Jack Nagel
10fda9e9b9 Decouple spec selection from ARGV 2014-06-20 21:32:36 -05:00
Jack Nagel
f0e13ee97b Use multiple argument form of system 2014-06-20 18:37:24 -05:00
Jack Nagel
e3f082c294 Stop joining symbols to pathnames
Ruby 2.2's native Pathname#/ accepts only string-like objects.
2014-06-09 14:57:21 -05:00
Jack Nagel
974b7e71ef Use opt shortcut methods 2014-06-09 14:57:21 -05:00
Jack Nagel
59515ea126 Remove executable bit from build.rb
- the executed script is the formula file, build.rb is a library
 - ruby is invoked directly, so it wouldn't need to be executable anyway
2014-05-03 10:01:30 -05:00
Jack Nagel
ce1f598e98 Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in.
2014-04-05 12:17:19 -05:00
Jack Nagel
c7a54f8da1 Use ARGV.env 2014-03-13 16:37:11 -05:00
Jack Nagel
d965bbba47 Allow the debugger to work from inside staged resources
References Homebrew/homebrew#23263.
Closes Homebrew/homebrew#27445.
2014-03-13 10:05:57 -05:00