487 Commits

Author SHA1 Message Date
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
Andrew Janke
d887dd39ec brew install: make -s apply only to given formula, not deps (#205) 2016-05-06 12:02:13 -07:00
Mike McQuaid
0ef21ddf87 analytics: move to a class.
Global namespaces are good to avoid when possible.
2016-05-03 14:21:08 +01: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
Mike McQuaid
0c85113053 Homebrew (opt-in) Analytics tweaks. (#57)
- add `HOMEBREW_PRODUCT` global variable
- only differentiate between `/usr/local` and `non-/usr/local` Homebrew
  prefixes to avoid sharing sensitive user information
- note if e.g. build errors are occurring under CI
- Add `HOMEBREW_NO_ANALYTICS` variable (this will be how people opt-out
  when this is enabled for everyone)
- Add `HOMEBREW_ANALYTICS_DEBUG` variable to output all the analytics
  that are sent
- Move Bash analytics code to `Library/Homebrew/utils/analytics.sh`
- Add documentation for our analytics and why/what/when/how and opt-out
- Only official Homebrew commands are reported
- Ruby analytics are now reported in a forked, background process
2016-04-12 11:02:22 +01:00
Mike McQuaid
342ed4c830 formula_installer: report install attempts.
Closes https://github.com/Homebrew/legacy-homebrew/pull/50462.
2016-04-04 12:27:47 +01:00
ilovezfs
9bbaaca98c FormulaInstaller: rescue tap unavail for reqs too
Calling `compute_dependencies` will make sure both requirements and
dependencies are expanded, so that any referenced taps can be
auto-tapped. Prior to this commit only dependencies were expanded for
the sake of auto-tapping, so dependencies of requirements would cause
installation to fail whenever a tap unavailable exception was
encountered.

Closes Homebrew/homebrew#50271

Closes Homebrew/homebrew#50281.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-03-29 16:19:37 +08:00
Mike McQuaid
f2faf49e3f formula_installer: use new pour_bottle DSL. 2016-02-18 10:21:20 +00:00
Mike McQuaid
c5ec986c72 formula_installer: improve bottle cellar message. 2016-02-18 10:21:20 +00:00
Mike McQuaid
e62dc13252 formula_installer: cleanup existing pour_bottle logic. 2016-02-18 10:21:20 +00:00
Xu Cheng
2facb5166c FormulaInstaller: uncache Tab to keep it fresh
Fixes Homebrew/homebrew#48612.
Fixes Homebrew/homebrew#48657.

Closes Homebrew/homebrew#48886.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-10 14:23:18 +08:00
Mike McQuaid
84a85b97ff Revert "formula_installed: tweak source build behaviour."
This reverts commit 5dd200c6b40f4fa9cc3a70cbc9ca2885e4626943.

Closes Homebrew/homebrew#47889.
2016-01-19 10:16:59 +00:00
Mike McQuaid
42681b51f8 formula_installer: build formula options better.
Previously we got all the options based on the build, any inherited
options, any passed options and the tab. We want to make sure that these
then exclude any options that don't exist as, otherwise, passing an
option that doesn't exist (or has been deleted) is enough to stop a
bottle being poured. This was particularly nasty on upgrades where we
deleted options and one left in the tab would stop the bottle being
poured.

Closes Homebrew/homebrew#47891.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-17 20:06:00 +00:00
Mike McQuaid
e7bffe4809 formula_installed: tweak source build behaviour.
Currently `brew install —build-from-source wget` builds all the
dependencies also from source. I can see people wanting to do this when
`HOMEBREW_BUILD_FROM_SOURCE` is set by passing it on the command-line
is mostly just annoying; it means you have to use `—build-bottle` and
deal with the CFLAGS and `post_install` changes if you want to build
from source. Tweak `formula_installer` so this behaviour is more
intuitive.

Closes Homebrew/homebrew#47889.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-17 20:05:32 +00:00
Martin Afanasjew
08fb36252c formula_installer: fix --default-fortran-flags
Setting the `FC` environment variable allows the user to override the
default Fortran compiler. The `SharedEnvExtension#fortran` method then
checks whether any of `FCFLAGS` and `FFLAGS` environment variables are
set and, if not, suggests to use `--default-fortran-flags` when running
`brew install`. However, `--default-fortran-flags` never makes it to
`build.rb` (that is executed by `FormulaInstaller`) because the flag is
not whitelisted in `FormulaInstaller#sanitized_ARGV_options`.

This change rectifies this and thereby eliminates the confusing message.

Fixes Homebrew/homebrew#47852.
2016-01-10 02:59:22 +01:00
Xu Cheng
885022a5e3 add Keg#empty_installation?
Avoid using `FormulaAuditor` in `FormulaInstaller`.

Closes Homebrew/homebrew#47887.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-09 20:28:15 +08:00
Zhiming Wang
6826cd68da formula_installer: improve empty installation detection
Use FormulaAuditor.audit_prefix_has_contents from audit.rb, which has
better logic.

Closes Homebrew/homebrew#47678.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-09 10:22:31 +00:00