974 Commits

Author SHA1 Message Date
Mike McQuaid
170c5493a4
Update deprecations
- Add some `odeprecated`
- Make some `odeprecated` now `odisabled`
- Remove `odisabled` code.
- Remove old update migrations
- Remove GCC 4.0 compiler
- Remove Tiger-only code
- Remove 32-bit-only code
- Remove use of LD64
- Remove GCC 4.3 - 4.8 support.
2019-01-08 19:13:46 +00:00
Mike McQuaid
549b02f20a
Manual brew style fixes. 2018-11-02 17:29:26 +00:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Mike McQuaid
fc418fd333
More deprecated/disabled updates
- remove odisabled
- move odeprecated to odisabled
2018-10-24 10:40:39 +01:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Markus Reiter
c4d418e126 Use ActiveSupport’s #second. 2018-10-07 23:10:56 +02:00
Markus Reiter
a37c02982e Fix brew mirror. 2018-10-01 10:28:07 +02:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
commitay
a5af6e8ef4 formula: set CARGO_HOME to enable cache 2018-09-04 12:00:38 +10: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
bcb1ec5499
Improve Homebrew/brew line length.
Use 124 max line length everywhere. Also, reduce tap max line length to
189 as Homebrew/homebrew-core has that as a maximum now. In future
Homebrew/homebrew-core will also be reduced to 124 maximum line length.
2018-09-02 16:15:09 +01:00
Dominyk Tiller
4598995a41
formula: always set GOCACHE
I hadn't planned to move on this so quickly but impressively core
today had its first Go Module using PR, so this has become more useful
than it would've been. Useful reading on the Modules system can be found
via https://golang.org/doc/go1.11#modules.

`GOCACHE` has been a thing for a while but it hasn't really been
especially beneficial to us, so I've ignored it, but with the Go Modules
system it can be incredibly useful in reducing build times & thus CI
burden. A lot of this is explained rather nicely here:
  https://groups.google.com/forum/#!msg/golang-dev/RjSj4bGSmsw/KMHhU8fmAwAJ

The upsides here for us are obvious:
1) We do a *lot* of go-based builds, and the more things move over to the
module system the more comprehensive that cache will become and we'll
need to remotely fetch less dependencies, which massively speeds up
build times even on high-speed connections.
2) Module dependencies aren't limited per formula. If `hugo` fetches a
dependency that is the same version as, for example, `wiki` also needs
`wiki` won't bother to fetch that version remotely but instead will
simply pluck it out of the cache.

If we look at `hugo`, because it's the only formula so far with Module
support:

First build: `built in 1 minute 41 seconds`
Second build: `built in 14 seconds`.

It's worth noting perhaps that we can use just the module cache rather
than the build cache + module cache combination, but doing so leads to
a significant reduction in regained build time. A build under that
system pops an average build time with `hugo` (after the first build)
of ~70 seconds, which is only a 30 second saving on the first build.
However, if we wanted to speed up builds whilst also not eating big chunks
of disk space that is an option.

The downside of a build cache + module cache system is disk usage.
`go` does not exactly eat up disk space sparingly, and the cache size
from `hugo` alone is 258.8MB. That could be an issue on CIs where disk
space is already a squeeze at times, but it's not much different to how
we let the `java_cache` behave now.

All Module-supporting formulae need to do to use the shared cache is
instead of deleting the `GOPATH` env we set everywhere replace it with
this:
```
ENV["GOPATH"] = "#{HOMEBREW_CACHE}/go_cache"
```
2018-08-29 13:16:36 +01:00
Markus Reiter
d33241bc11 Use -- for bottles. 2018-08-06 17:59:51 +02:00
Markus Reiter
13c65eed70 Change docs to use symbols instead of class names. 2018-08-03 17:50:57 +02:00
Mike McQuaid
e52d6dba79 formula: handle unavailable versioned formulae.
If people decide to copy these into their Homebrew/homebrew-core
`Formula` directory then it breaks generating the hash for any
non-versioned formulae.

See https://github.com/Homebrew/homebrew-bundle/issues/351
2018-07-30 09:16:53 +01:00
Mike McQuaid
e63d490874 formula: handle unavailable missing formulae.
Fixes #4494.
2018-07-17 14:59:50 +01:00
Mike McQuaid
375d401580 Handle missing formulae in runtime_dependencies
Hopefully put this to bed for once and for all. Add a new method
`runtime_formulae_dependencies` which returns the `runtime_dependencies`
which have only the `Formula` objects that exist. I've checked all the
`runtime_dependencies` callers and updated them accordingly.

Also, fix a few cases where runtime dependencies were being read from
the tab when this wasn't desirable.
2018-07-16 16:46:39 +01:00
Mike McQuaid
256dfc1af9 Move methods from FileUtils to Formula
These don't need to live on FileUtils and don't really make sense there
either.
2018-07-14 18:13:23 +01:00
Mike McQuaid
abf3043125 formula: move mktemp.
This should be an instance rather than a class method.
2018-07-14 15:41:16 +01:00
Mike McQuaid
0a76c9f02e mktemp: move to Formula and compat.
Move this method away from FileUtils as it doesn't need to be on that
class.
2018-07-13 14:42:49 +01:00
Markus Reiter
7762ce32aa Use more descriptive heredoc names. 2018-07-11 18:15:30 +02:00
Mike McQuaid
f5fbb74aaf linkage: fix output of optional dependencies.
Check the runtime dependencies from the tab when outputting the
`brew linkage` declared vs. undeclared dependencies.
2018-07-05 20:29:19 +01:00
Mike McQuaid
42e5ef9f89 tab: set runtime_dependencies consistently. 2018-06-01 19:53:26 +01:00
Mike McQuaid
6b817f775f Formula: handle bad tap runtime dependencies.
Also add some better exceptions for the cases that `nil`s end up
getting passed around incorrectly.
2018-06-01 19:22:33 +01:00
Mike McQuaid
a674a972a5
Merge pull request #4258 from MikeMcQuaid/update_head_version_path
Formula#update_head_version: fix PATH.
2018-06-01 16:59:39 +01:00
Mike McQuaid
f24c77f3dd Formula#update_head_version: fix PATH.
Ensure that all the necessary tools are accessible.
2018-06-01 16:43:11 +01:00
Mike McQuaid
31112934b0
Merge pull request #4257 from MikeMcQuaid/required-recommended
runtime_dependencies: include recommended deps.
2018-06-01 16:38:55 +01:00
Mike McQuaid
61617a257e linkage_checker: use default use_cache parameter for callers. 2018-06-01 14:05:16 +01:00
Mike McQuaid
b66aafc218 runtime_dependencies: include recommended deps.
These previously weren't being generated correctly for dependencies of
formulae that weren't installed.
2018-06-01 14:01:34 +01:00
Mike McQuaid
97645d061d
Merge pull request #3720 from AndrewMcBurney/cache-optimization
Cache optimization for `brew linkage` command.
2018-05-24 09:14:02 +01:00
Andrew R. McBurney
ddb7f06e9f Fixed rubocop offenses from brew style. 2018-05-22 12:54:54 -04:00
Mike McQuaid
44f5d3ec79 Refactor cache store code. 2018-05-22 14:46:14 +01:00
Andrew R. McBurney
010207b982 Changed cache usage behavior.
1. Running `brew linkage some_package` does not set the cache.
2. Running `brew linkage --cached some_package` when `DatabaseCache.empty?` returns `true` should build the cache.
3. Running `brew linkage --cached some_package` when `DatabaseCache.empty?` returns `false` should use the cache.
2018-05-21 17:36:30 -04:00
Andrew R. McBurney
e93e8f3266 Lazily load db of type DBM instance variable for DatabaseCache so the corresponding database file isn't created in the .use block for a DatabaseCache. 2018-05-18 16:37:01 -04:00
Andrew R. McBurney
ddd2ec05d8 Added static use method for DatabaseCache. 2018-05-17 16:56:59 -04:00
Andrew R. McBurney
17f484b0ae Set the return_value from the initialize block in the DatabaseCache. 2018-05-15 13:15:30 -04:00
Mike McQuaid
11c7b08a34 formula: add versioned_formulae to to_hash. 2018-05-12 15:02:29 -04:00
Mike McQuaid
840c97c1cc formula: add versioned formulae method. 2018-05-12 15:02:29 -04:00
Mike McQuaid
524379e897 formula: improve dependencies hash output.
It doesn't really make any sense for the `dependencies` hash to include
all optional, recommended and build dependencies when these are already
separately output.
2018-05-12 14:28:08 -04:00
Mike McQuaid
0797a3e19e formula: reorder to_hash.
Let's reorder this to more closely match the ordering in a formula file.
This makes `to_hash` (and our JSON output) more useful and easily
readable for people used to formula files.
2018-05-12 14:28:08 -04:00
Andrew R. McBurney
d3120c0206 Use cache if HOMEBREW_LINKAGE_CACHE exists in formula_cellar_checks and formula. Make functions private in LinkageChecker. 2018-05-06 15:55:33 -04:00
Mike McQuaid
555e2a2fc8 Merge remote-tracking branch 'origin/master' into cache-optimization 2018-05-02 09:46:58 +01:00
Mike McQuaid
191724ce83 formula: read runtime dependencies from more tabs.
The fixes the issue mentioned in:
https://github.com/Homebrew/brew/pull/4066#issuecomment-381308153
where `brew missing` was not reading from a tab of an outdated formula.

The `installed_prefix.directory?` check is unnecessary as the following
`opt_or_installed_prefix_keg` call is already checking that when it is
necessary. In this case it's not necessary anyway as `opt_prefix` is
preferred and makes more sense on outdated formulae.
2018-04-28 15:29:19 +01:00
AndrewMcBurney
461d7d72de Fixed failing tests in formula.rb caused by merge. 2018-04-25 10:25:00 -04:00
Mike McQuaid
3454d6a961 runtime_deps: improve documentation and consistency. 2018-04-25 11:44:29 +01:00
Mike McQuaid
598bbd4c72
Merge branch 'master' into undeclared_runtime_dependencies 2018-04-25 10:41:43 +01:00
Mike McQuaid
63c0706190 formula: sort aliases in to_hash.
Otherwise the ordering varies based on the filesystem.
2018-04-18 11:17:57 +01:00
Mike McQuaid
a34c11874b formula: tweak to_hash bottle output.
Make some changes required to have `brew info --json=v1` whether there
is any bottle block rather than a bottle checksum for the given system.

This provides more consistent output.
2018-04-17 21:44:50 +01:00
Mike McQuaid
d08a4accfb
Merge pull request #4083 from MikeMcQuaid/remove-xcode-installed-guards
Remove Xcode.installed? guards.
2018-04-17 11:16:43 +01:00
Mike McQuaid
85edbd28b1 Remove Xcode.installed? guards.
It's safe since 600d58f4ca3d85894c66a38802965fd94d4ea469 when
MacOS::Xcode.version started returning `Version::NULL` where
appropriate.
2018-04-17 10:58:51 +01:00