603 Commits

Author SHA1 Message Date
Mike McQuaid
51c31f4d51 Merge pull request #1642 from MikeMcQuaid/always-output-options
reinstall/upgrade/install: always output options.
2016-12-10 18:12:36 +00:00
Mike McQuaid
f7f15673a8 Fix dependency option handling.
- formula_installer: only recompute dependencies when necessary i.e.
when a bottle pour fails.
- formula_installer: re-add accidentally remove dependency options
- dependency: missing options are only those that actually exist on a
formula
2016-12-10 17:58:41 +00:00
Mike McQuaid
e347f7ade3 reinstall/upgrade/install: always output options.
This is both easier for debugging and to communicate with users what is
being done.
2016-12-10 13:07:03 +00:00
Mike McQuaid
8e2f0ccdc3 formulary: remap deprecated options from keg.
When reading a building a formula from a keg (rather than e.g. from
name) then the deprecation options were not remapped correctly as they
are only done in `Tab.for_formula` and not `Tab.for_keg`. Ensure that
after we’ve created the formula that the `used_options` are remapped
correctly.
2016-12-09 17:59:08 +00:00
Kaito Udagawa
bcc9002214 install: print nothing if @requirement_messages is a String or nil 2016-11-20 19:49:58 +09:00
Kaito Udagawa
61c8fff0ee install: suppress redundunt warnings with depends_on requirement
When a formula depends on any requirements, they evaluated at most three times:
before locking, before installing dependent, before building formula.
When a non-fatal requirement is specified and thus evaluated three times,
mostly the same warning message is also emitted three times.

This change restricts printing the warning messages only when a bottle is
successfully installed or before building.
Since this timing is after the final dependency computation for each cases,
the warnings will be most useful to check what is not yet satisfied.
2016-11-19 04:14:26 +09:00
Markus Reiter
59e2d67721 No if/unless-modifier on multiline blocks. 2016-11-13 23:37:40 +01:00
Mike McQuaid
2a53d14b51 Merge pull request #1217 from MatzFan/invalid_build_option_warnings
Invalid build option warnings - supersedes #1088
2016-11-13 10:50:51 +00:00
Mike McQuaid
56124f5963 Filter formula build options based on those that exist.
If `--with-foo` is provided to a formula through a tab or through
another formula depending on it and this option does not exist it
should be filtered. If it is not (the prior behaviour) then this can
prevent bottles being used unnecessarily.

Fixes #1399.
2016-11-12 12:11:55 +00:00
Bruce Steedman
098974b2a1 @MikeMcQuaid requested changes 2016-11-12 12:03:04 +00:00
Josh Hagins
652c5bc865 formula_installer: fix regression in #1253
Apparently `cellar :any_skip_relocation` doesn't actually mean we
can skip relocation, at least for text files.
2016-10-25 03:41:37 -04:00
Josh Hagins
9c519bbdbc keg_relocate: refactor relocate_text_files
Replace relocate_text_files with three methods that clarify intent:
replace_locations_with_placeholders, replace_placeholders_with_locations
and replace_text_in_files, the first two calling the third.
2016-10-24 16:21:08 -04:00
Josh Hagins
c46155aba4 keg_relocate: cache files rewritten during brew bottle
`brew bottle` replaces instances of the Homebrew prefix, cellar, and
repository with placeholders in all text files. Cache these files in
INSTALL_RECEIPT.json so that we don't have to check every single text
file for placeholders on install.
2016-10-24 16:21:08 -04:00
Andrew Janke
802402ee34 install: prune build-only deps of deps
This avoids needlessly installing build-time dependencies of dependencies
which are not themselves being built from source.
2016-10-17 04:45:49 -04:00
William Woodruff
5163aa5d21
formula_installer: Remove obsolete hard dependency on cctools.
ruby-macho now performs all relocations in Homebrew.

Additionally, delete the defunct CctoolsRequirement.
2016-10-12 15:00:40 -04:00
Bruce Steedman
62e14ea673 invalid build options - fixed conflicts; rename 2016-10-03 09:42:53 +01:00
Markus Reiter
75e8b59aad Add Formatter module. 2016-10-01 20:00:49 +02:00
Mike McQuaid
98e7fb6b60 Merge pull request #1052 from sjackman/store-formula
Store the formula used to build the keg in the keg
2016-10-01 12:24:19 +01:00
Markus Reiter
58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Shaun Jackman
25df0c03d6 Store the formula used to build the keg in the keg
Store the formula used to build the keg inside the keg in a
file named NAME/VERSION/.brew/NAME.rb after removing the
bottle do ... end block.

See https://github.com/Homebrew/brew-evolution/pull/6.
Closes https://github.com/Homebrew/brew/issues/931.
2016-09-23 17:11:24 -07:00
Markus Reiter
fe2d51e0b9 Fix Style/IfUnlessModifier. 2016-09-23 15:30:07 +02:00
Markus Reiter
4064084c58 Fix Style/MethodName. 2016-09-23 15:30:06 +02:00
Markus Reiter
23eac7ab89 Fix DoubleNegation. 2016-09-23 15:30:06 +02:00
Mike McQuaid
997ccb044d Relocate HOMEBREW_REPOSITORY when necessary.
Now that the default from the installer, our CI and soon all users
is `/usr/local/Homebrew` it's a lot easier to check if there's
references to it (as we cannot look for `/usr/local` as it's a too
commonly hardcoded path).
2016-09-18 16:31:58 +01:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
6693915399 rubocop --auto-correct all remaining files.
But remove some manual `.freeze`s on constants that shouldn't be
constants.
2016-09-17 16:14:13 +01:00
Alex Wang
71063aa2e3 Make scons use stdenv only if immediate build dep
formula_installer will use stdenv if scons is anywhere in the formula's
recursive dependency list:

    https://github.com/Homebrew/legacy-homebrew/issues/40401#issuecomment-110066355

Having scons as a dependency should only require stdenv if it is an
immediate build dependency, as otherwise scons shouldn't be invoked.
2016-09-13 12:36:56 -04:00
Mike McQuaid
1d66cdd3ad Merge pull request #863 from penman/preserve_alias
Save aliases in INSTALL_RECEIPT
2016-09-09 07:47:05 +01:00
Vlad Shablinsky
a04030a6f7 formula_installer: don't allow pinned dependencies
Prompt user to unpin pinned dependencies of the formula
2016-09-07 20:58:09 +03:00
Alyssa Ross
c58bbdc213 Formula#specified_path 2016-09-05 22:13:55 +01:00
Alyssa Ross
65ee5408c3 Replace install_name/install_ref with alias_path 2016-09-05 01:19:08 +01:00
Alyssa Ross
0ef3e1e0dc Preserve alias when installing formulae
Part of #567
2016-09-03 21:16:43 +01:00
ilovezfs
6217e5200e formula_installer: install deps of dep before dep
Dependencies/requirements of a dependency need to be installed/satisfied
before the dependency. The fact that @pour_failed may be false is
irrelevant to that imperative if we weren't pouring to begin with, so
this commit now checks for that case as well.
2016-09-01 03:51:05 -07:00
Andrew Janke
954445634c separate build and test logs 2016-08-19 01:04:32 -04:00
Mike McQuaid
6375adc0ff formula_installer: use Sandbox.formula? method. 2016-08-15 08:33:59 +01:00
Shaun Jackman
da52fb67f0 install_dependencies: Do not truncate dependencies
See Homebrew/legacy-homebrew#48449
2016-08-12 20:54:18 -04:00
Mike McQuaid
19920e18a1 formula_installer: report --HEAD/--devel usage. 2016-08-09 19:41:30 +01:00
Mike McQuaid
cc752e97f6 formula_installer: tweak dependent requirements.
If a requirement is for a dependent that's already installed and that
dependency is not using a `default_formula` (which would have already
been converted from a `Requirement` to `Dependency` at this stage) then
we want to stop it killing the build.
2016-08-09 09:59:05 +01:00
Dominyk Tiller
202e5f5332 formula_installer: prevent MaximumMacOSRequirement leakage
Read the discussion in https://github.com/Homebrew/homebrew-core/pull/3703. If you
have a better idea, please file a competing PR. I'm sick to death of discussion.

Closes #662.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-08-09 09:58:49 +01:00
Mike McQuaid
3847db6026 formula_installer: better handle missing conflict.
Doesn't feel like a good reason to abort installation for users if the
formula author has specified a conflict that doesn't exist. Instead,
behave more like the `TapFormulaUnavailableError` but print a message
telling people to report to the formula authors.

Closes https://github.com/Homebrew/homebrew-versions/issues/1327
2016-08-08 10:54:48 +01:00
Mike McQuaid
164e46a729 Add missing development_tools requires. 2016-07-29 21:21:02 -06:00
Xu Cheng
8b9ce59ce4
FormulaInstaller#sanitized_ARGV_options: fix regex
This fixes a regression caused by 2e961dc9dee63f641f7f162fd7a2845c5fd092fe,
where a misplaced `+` cause the regex only catch one character.

Fixes https://github.com/Homebrew/homebrew-science/issues/3847.
2016-07-21 14:08:06 +08:00
Vlad Shablinsky
2e916110e4
Use HeadVersion for install/reinstall 2016-07-16 20:39:13 +08:00
Mike McQuaid
f1c4141885 keg_relocate: port to generic OS. (#453) 2016-07-09 13:52:05 +01:00
Mike McQuaid
a5ec0aa259 emoji: extract logic into generic OS classes. (#450) 2016-07-09 13:51:43 +01:00
Martin Afanasjew
77dd9d56ff Use GitRepositoryExtension for HOMEBREW_REPOSITORY 2016-07-07 01:46:58 +02:00
Mike McQuaid
3a127e405e development_tools: add installed? method. (#455) 2016-07-06 11:07:24 +01:00
ilovezfs
b2c9625d78 formula_installer: accumulate inherited options
When a given dependency appears multiple times in a formula's dependency
tree, the inherited options for that dependency should accumulate rather
than being overwritten each time that dependency is considered by
expand_dependencies. In particular, this impacts "universal" since the
dependency should be built with universal unless all of its instances in
the dependency tree don't have "universal" as opposed to only if the last
instance considered has "universal."

Closes Homebrew/homebrew-core#1604.

Closes #308.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-06-02 02:19:58 -07:00
Martin Afanasjew
2e961dc9de formula_installer: fix option-with-value handling
When passing formula options with value, e.g. `--with-qt=5`, to the
child process responsible for building a formula, `ARGV.value` would be
invoked with `nil`. Handle this more elegantly (no change in behavior).

For consistency, use a regular expression adapted from `Options.create`
instead of the somewhat bogus one used before.
2016-05-12 08:09:19 +02:00
Mike McQuaid
931e292bf1 Make bottle code cross-platform. 2016-05-08 16:51:22 +01:00