8231 Commits

Author SHA1 Message Date
Martin Afanasjew
d59f0f77a7 tests: fix fluctuations in test coverage (#647)
This basically started once our integration tests caused the overall
test time to raise above 10 minutes, causing some coverage data to be
dropped because SimpleCov believed it to be stale.
2016-08-06 04:24:18 +02:00
Martin Afanasjew
65203bbd1e test-bot: avoid duplicate coverage reports
When running on Travis CI, both the Linux and macOS build will send a
coverage report, causing them to be merged by Coveralls. This results
in inferior coverage due to the early stage of the Linux-specific tests
and is probably not what we want. Make sure we only send a report for
macOS (assuming we stick with a single macOS build in `.travis.yml`).
2016-08-06 01:52:28 +02:00
Mike McQuaid
66d564d885 update-report: tweak Cask migration output.
No longer output every cask under the list of changed formulae but
instead create a dedicated, unprinted report section for casks and then
iterate through that instead.
2016-08-05 16:34:56 +01:00
Mike McQuaid
3f505fe642 update-report: print developer exception backtraces. 2016-08-05 16:34:56 +01:00
Mike McQuaid
a9ab066654 Revert "Partially reverts 4338f35b848ad61462fc4f73e1365e6c002201a2"
This reverts commit b33b1af073979c8a699ed9688dba37fb7e74f0b5.
2016-08-05 15:28:20 +01:00
Xu Cheng
b33b1af073
Partially reverts 4338f35b848ad61462fc4f73e1365e6c002201a2 2016-08-05 22:16:19 +08:00
Xu Cheng
a8566c9848 various: eliminate the usage of any? (#638)
`any?` is not the opposite of `empty?`. Besides the case that
`[false, nil].any?` will return false, `any?`(O(n)) has much worse
performance than `empty?`(O(1)).
2016-08-05 22:01:32 +08:00
Andrea Kao
38209aadbf tests: add cmd/migrate integration test 2016-08-04 11:44:39 +01:00
Anastasia Sulyagina
4338f35b84 tap: add cask methods. 2016-08-04 11:37:37 +01:00
Martin Afanasjew
b77a695b7a python: tweak script linking in virtualenv (#613)
* python: tweak script linking in virtualenv

Instead of making the formula author use a slightly awkward block like

  venv.link_scripts(bin) { venv.pip_install buildpath }

avoid exposing this implementation detail and offer the more familiar:

  venv.pip_install buildpath, :link_scripts => bin

* Add non-block form and use instead of recursion

* Update 'pip_install' documentation

* Remove obsolete 'link_scripts'

* Add test for 'pip_install' with linking scripts

Also drop no longer relevant (and broken) `link_scripts` test, that
served as a template for the new test.

* Restore compatibility with Ruby 1.8.7

* Replace option hash with 'pip_install_and_link'

* Avoid confusing 'Object#tap' and fix silly bug

* Avoid side effects in mock object parameter check

* Simplify argument check (no need for a block)
2016-08-02 13:37:15 -07:00
Mike McQuaid
a6033529cf Revert "tap: add cask methods."
This reverts commit 05daa0574732a7884bd158b2c3e14bd0709367da.
2016-08-02 14:11:40 +01:00
AnastasiaSulyagina
05daa05747 tap: add cask methods.
Closes #562.
2016-08-02 13:44:19 +01:00
Mike McQuaid
0302a6bc7c audit: add --new-formula option.
Rather than nudge people to run `--strict` and then ignore some of the
results sometimes (e.g. GitHub repository notability) instead add a
dedicated `--new-formula` option that implies this is a one-time
advisory check.
2016-08-02 12:44:41 +01:00
Mike McQuaid
ebe8b8d328 update-report: use --overwrite to migrate Casks.
`--force` isn't quite what we want here as it'll just allow keg-only
linkage whereas we want to ensure we overwrite anything the Cask
installed.
2016-08-02 11:48:11 +01:00
AnastasiaSulyagina
be5484da8c update-report: allow Casks migration to formulae.
Closes #588.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-08-02 11:45:47 +01:00
Mike McQuaid
2bd5e0e5ad update-report: tweak cask migration text. 2016-08-02 11:45:32 +01:00
Andrea Kao
762e56db72 tests: update cmd/analytics integration test 2016-08-02 11:00:42 +01:00
Dominyk Tiller
604f4b6a07
keg_relocate: refactor path.find change for performance
Closes #616.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-08-02 03:50:50 +01:00
Dominyk Tiller
196a6946e1
keg_relocate: work around file bug
There's an old bug in `file` which means it can't read certain files under a
non-C locale. This has been fixed upstream for some time, but Apple hasn't
picked that fix up & even on OS X El Capitan the `file` is ancient.

This is currently causing a lot of false positives in our bottle code around
relocating things like manpages translated into non-English languages, because
currently the test does:

```
pn = "/usr/local/Cellar/vim/7.4.2109/share/man/fr/man1/vim.1"
Utils.popen_read("/usr/bin/file", "--brief", pn).include?("text")
```
Which returns `false`. But it isn't returning `false` because the actual result
is false, but because `file` panics & fails, which for us equals a `false`. The
actual output when accessed is:
```
pn = "/usr/local/Cellar/vim/7.4.2109/share/man/fr/man1/vim.1"
Utils.popen_read("/usr/bin/file", "--brief", pn)
"ERROR: line 22: regexec error 17, (illegal byte sequence)\n"
```
Forcing this check to be done under a "C" locale eliminates this particular false
positive for strings we can't relocate & consequently things such as NLS may
prove to be more portable in some formulae than is currently the case.

Using `vim` again for the example:
```
pn = "/usr/local/Cellar/vim/7.4.2109/share/man/fr/man1/vim.1"
Utils.popen_read("/usr/bin/file", "--brief", pn).include?("text")
true
```
This reduces the flagged strings from `vim` from 4 issues to 2, the remaining
two with the `vim` executable itself which "remembers" the full path to perl,
python, ruby, etc during build & vomits that information out when requested
by the user. Both the manpages flagged before this change are no longer flagged
as unrelocatable.

This won't entirely resolve the NLS problem because some things hardcode in
a locale path, which will be stored in the executable, but at the very least it
should reduce the number of false positives & may enable relocation where that
locale path hasn't been burnt in.
2016-08-02 03:50:49 +01:00
Dominyk Tiller
774eefa8ae
test_utils: add with_custom_locale test 2016-08-02 03:50:49 +01:00
Dominyk Tiller
de4016e049
utils: add with_custom_locale helper 2016-08-02 03:50:49 +01:00
Dominyk Tiller
f10370bde5
xcode: update expected clang for macOS 10.12 2016-08-01 23:46:54 +01:00
Tim D. Smith
a5a930c48b Allow virtualenvs to find Python bindings provided by deps (#608)
Allow virtualenvs to find Python bindings provided by deps

Closes #603.
2016-07-31 11:59:30 -07:00
Mike McQuaid
7a00f03c92 utils: tell people to report deprecations to tap.
This should hopefully avoid Homebrew/brew or Homebrew/homebrew-core
having these exceptions reported to us.
2016-07-31 19:22:12 +01:00
Mike McQuaid
3e5ccaf3d2 link: don't allow more openssl/libressl linkage.
This extends the approach in #597 to further prevent linkage of formulae
that conflict with the system OpenSSL and can cause the issues
described in that issue.
2016-07-31 19:12:20 +01:00
Dominyk Tiller
12e7a08b7a
test_cleaner: add perl removal tests
Closes #609.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-07-31 03:44:29 +01:00
Dominyk Tiller
202f793d8a
cleaner: kill unnecessary perl elements
We shouldn't be packaging either `perllocal.pod` or `.packlist` files. Both
are only really useful outside of package management. They get automatically
generated whenever you install a Perl module.

Debian, Arch, MacPorts & others remove them and we should have been as well
really; keeping them causes completely unnecessary conflicts between formulae.
2016-07-31 03:44:29 +01:00
Martin Afanasjew
1244aa6ece utils: fix option handling in 'odisabled'
Options passed to `odisabled` were completely ignored. Instead, merge
them with the defaults that distinguish `odisabled` from `odeprecated`.
2016-07-30 14:59:16 +02:00
Martin Afanasjew
0a33cc591d utils: provide a better location in 'odeprecated'
Try to find a formula in the backtrace to make the warning message more
helpful in identifying the culprit, as the formula is not always the
immediate caller of a deprecated method. Provide some sane fallbacks if
there's not formula in the call stack.
2016-07-30 14:51:14 +02:00
ilovezfs
19a77c816e formula_versions: ignore FormulaMethodDeprecatedError
old formula revisions have deprecated elements such as sha1 checksums

Closes #605.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-07-29 23:12:13 -07:00
Mike McQuaid
bc5b9c1e97 test-bot: fix non-OS X report generation. 2016-07-29 21:58:17 -06:00
Mike McQuaid
81b034a577 test_cmd_audit: don't print compat warnings. 2016-07-29 21:21:29 -06:00
Mike McQuaid
aadd465712 compat/xcode: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
ade09145d9 compat/version: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
f334806eb1 compat/tap: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
aacdaa554c compat/sha1: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
3d36208328 compat/pathname: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
dd3a8d4b2f compat/md5: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
a2347dc997 compat/macos: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
3a0f23239c compat/language/haskell: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
6bd8e1d64e compat/keg: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
b950966bdd compat/hardware: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
e107c86aec compat/formula_specialities: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
b3e423fc7c compat/formula: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
bf13eb9b59 compat/fails_with_llvm: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
369fc93479 compat/dependency_collector: cleanup style. 2016-07-29 21:21:29 -06:00
Mike McQuaid
10ddb2ed97 utils: add API removal messaging methods.
Add new `odeprecated` and `odisabled` methods to print API removal
messages. Currently these are just used by things in `compat/`.
2016-07-29 21:21:29 -06:00
Mike McQuaid
af2101b64d exceptions: add FormulaMethodDeprecatedError.
This will be raised when Homebrew developers try to use formulae that
call deprecated methods.
2016-07-29 21:21:29 -06:00
Mike McQuaid
80b68add13 compat: add Rubocop file. 2016-07-29 21:21:29 -06:00
Mike McQuaid
164e46a729 Add missing development_tools requires. 2016-07-29 21:21:02 -06:00