14644 Commits

Author SHA1 Message Date
commitay
a5af6e8ef4 formula: set CARGO_HOME to enable cache 2018-09-04 12:00:38 +10:00
William Woodruff
1eec585afe
Merge pull request #4752 from woodruffw/error-pipe
Use JSON to marshal errors from children
2018-09-03 18:59:40 -04:00
William Woodruff
86b9647450
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-03 18:42:59 -04:00
Markus Reiter
89dd608766 Deprecate gpg stanza. 2018-09-03 20:47:52 +02:00
Mike McQuaid
61ace27006
Merge pull request #4805 from Homebrew/dependabot/bundler/Library/Homebrew/test/parallel_tests-2.22.1
Bump parallel_tests from 2.22.0 to 2.22.1 in /Library/Homebrew/test
2018-09-03 17:21:10 +01:00
Mike McQuaid
56453bc8f8
os/mac: note installation docs need bumped too.
I noticed these contain a reference to our supported versions so should
be bumped whenever this version is bumped.
2018-09-03 17:00:02 +01:00
dependabot[bot]
64869a6368
Bump parallel_tests from 2.22.0 to 2.22.1 in /Library/Homebrew/test
Bumps [parallel_tests](https://github.com/grosser/parallel_tests) from 2.22.0 to 2.22.1.
- [Release notes](https://github.com/grosser/parallel_tests/releases)
- [Commits](https://github.com/grosser/parallel_tests/compare/v2.22.0...v2.22.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-03 15:56:52 +00:00
Mike McQuaid
9cd637ac20
formulary: NameError makes formulae unreadable.
And `NoMethodError` is a type of `NameError`.
2018-09-03 15:40:07 +01:00
Mike McQuaid
3b91c5f1ae
Merge pull request #4797 from MikeMcQuaid/rubocop-tweaks
.rubocop: tweak rules.
2018-09-02 21:13:23 +01:00
Mike McQuaid
0aa9dce03c
Revert "Add $LOAD_PATH for RuboCop cops." 2018-09-02 20:49:25 +01: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
0dc2c72693
Merge pull request #4795 from MikeMcQuaid/tests-leaks-prompt
tests: handle file leaks and SVN test prompt.
2018-09-02 18:31:44 +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
Mike McQuaid
ec9e45a8f0
tests: handle file leaks and SVN test prompt.
- Ignore files that are generated by `brew tests`
- Make the SVN tests work without prompting for GitHub's SSL certificate
2018-09-02 13:43:58 +01:00
Mike McQuaid
c46cecf277
tests: set HOME.
This is the only way to override the user's Git configuration which can
break tests when e.g. `gpg` cannot be found but signing is requested.
2018-09-02 12:56:31 +01:00
Dominyk Tiller
9102c120bb
cleanup: fix go_cache cleanup 2018-09-02 04:27:22 +01:00
Markus Reiter
e377bdb6fe Fix CurlApacheMirrorDownloadStrategy URL resolution. 2018-09-02 03:30:37 +02:00
Markus Reiter
b54682f709 Avoid network call in #initialize. 2018-09-01 16:20:10 +02:00
Markus Reiter
f66ce9ce5d
Merge pull request #4788 from reitermarkus/no-cache-no-migration
Skip migration if cache is empty or doesn’t exist.
2018-09-01 16:17:54 +02:00
Markus Reiter
b954391214 Skip migration if cache is empty or doesn’t exist. 2018-09-01 15:29:17 +02:00
Vítor Galvão
ad66d54143
Merge pull request #4782 from amyspark/fix-quarantine-broken-symlinks
quarantine: do not automatically follow symlinks
2018-09-01 10:41:47 +01:00
Markus Reiter
3d15c7cb75 Only migrate cache files containing --. 2018-09-01 11:04:51 +02:00
Markus Reiter
ae18bdf161 Skip mtime for non-existent symlink. 2018-09-01 06:42:54 +02:00
L. E. Segovia
4c47a4b76d
quarantine: do not automatically follow symlinks
This prevents failure when Casks have broken framework symlinks.
2018-08-31 15:31:00 +00:00
Markus Reiter
f287214699 Just use resolved_path.file?. 2018-08-31 16:51:23 +02:00
Markus Reiter
9b50fd81d7 Move everything into one file. 2018-08-31 16:51:23 +02:00
Markus Reiter
443111896e Share common logic. 2018-08-31 16:51:23 +02:00
Markus Reiter
ccf396887a Add comment about refinement scope. 2018-08-31 16:51:23 +02:00
Markus Reiter
2773ce6156 Don’t clean up symlink target. 2018-08-31 16:51:23 +02:00
Markus Reiter
b63ac557bc Update symlink even if cached_location already exists. 2018-08-31 16:51:23 +02:00
Markus Reiter
9edc355052 Don’t glob for .incomplete downloads. 2018-08-31 16:51:23 +02:00
Markus Reiter
b7847e4657 Don’t migrate symlinks. 2018-08-31 16:51:23 +02:00
Markus Reiter
3988458919 Use real basename for output. 2018-08-31 16:51:23 +02:00
Markus Reiter
516a39f5a4 Move migrations into UpdateMigrator module. 2018-08-31 16:51:23 +02:00
Markus Reiter
fbcaa8c85a Resolve URL to get real file extension. 2018-08-31 16:51:23 +02:00
L. E. Segovia
f7cafb50ad
Enable quarantining of Homebrew-Cask's downloads 2018-08-31 13:16:11 +00:00
Michka Popoff
6e31c662f5
Merge pull request #4773 from iMichka/o2flag
superenv: Use 02 optimization flag for Linux builds
2018-08-30 11:09:50 +02:00
Dominyk Tiller
baab9d841f
Merge pull request #4774 from DomT4/GOCACHE
go: support & use aggressive caching
2018-08-30 04:44:37 +01:00
commitay
e4049b3005
Merge pull request #4775 from commitay/cargo-install
text_cop: update `cargo build` cop
2018-08-30 08:03:42 +10:00
Markus Reiter
801ec6e0a5
Merge pull request #4771 from reitermarkus/rubocop-path
Add `$LOAD_PATH` for RuboCop cops.
2018-08-29 23:51:11 +02:00
Markus Reiter
ad7054cc88 Fix executable with spaces. 2018-08-29 19:30:08 +02:00
commitay
0ce583964e text_cop: update cargo build cop 2018-08-29 23:06:53 +10:00
Dominyk Tiller
b333f7abe6
cleanup_spec: test go_cache cleanup 2018-08-29 13:16:56 +01:00
Dominyk Tiller
318eb5054f
cleanup: cleanup go_cache 2018-08-29 13:16:55 +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
Michka Popoff
b7b5fb930d superenv: Use 02 optimization flag for Linux builds
`-Os` produces sometimes bigger binaries on Linux.
Also, llvm built with `-Os` is really slow at runtime for Linux.

Using `-02` aligns us with what Debian does, and as we are compiling most of our stuff with gcc (and not clang), it makes sense to use `-02` on Linux.
`-Os` does probably slightly different things when used on mac with llvm, compared to when it is used with gcc on Linux.
2018-08-29 13:40:39 +02:00
Markus Reiter
f6e7a3ed9d Fix style. 2018-08-29 01:44:47 +02:00
Markus Reiter
444e3d2a78 Add $LOAD_PATH for RuboCop cops. 2018-08-29 01:44:47 +02:00
Gautham Goli
32bc5535b6
style: Fix npe and add test for corrected offense results 2018-08-28 23:31:35 +05:30
Gautham Goli
b707d2a232
Merge pull request #4765 from GauthamGoli/style-results-npe-fix-2
audit: Use `fetch` with default value prevent NPE
2018-08-28 13:42:13 +05:30