132 Commits

Author SHA1 Message Date
Carlo Cabrera
fb2b21b298
Merge pull request #13750 from carlocab/gcc-dependency-check
formula_auditor: refactor GCC dependency check into separate method
2022-08-25 21:41:05 +08:00
Carlo Cabrera
84f544f08f
Require git log only when not strict 2022-08-25 20:54:19 +08:00
Carlo Cabrera
6175b3fe4c
Require --git. 2022-08-25 20:48:37 +08:00
Carlo Cabrera
378ff06f53
Speed up #linux_only_gcc_dep?.
`#to_hash_with_variations` is slow, let's avoid doing it unless needed.
2022-08-25 20:44:27 +08:00
Carlo Cabrera
8e09ec4bf4
Handle on_system blocks. 2022-08-24 20:34:43 +08:00
Carlo Cabrera
be4e926b15
Fix "dependencies" being nil. 2022-08-24 18:18:10 +08:00
Carlo Cabrera
69fbaf2dbf
Fix comment; reuse variations. 2022-08-24 15:12:58 +08:00
Carlo Cabrera
e68b1a4a89
Tweak #linux_only_gcc_dep?. 2022-08-24 15:09:53 +08:00
Carlo Cabrera
5f95cc388d
formula_auditor: refactor GCC dependency check into separate method
The GCC dependency check is adding a couple of minutes to our
`tap_syntax` jobs. Let's fix that by moving the check into a separate
method so we can exclude it from `tap_syntax`.
2022-08-24 13:22:00 +08:00
Carlo Cabrera
c42b6e2cad
Revert "formula_auditor: skip rename audit for glib-utils"
The necessary PRs in Homebrew/homebrew-core have been merged. See:
- Homebrew/homebrew-core#108307
- Homebrew/homebrew-core#108497

This reverts commit 6ca02b22bb27a45525fa62c6fba9902039152fcc.
2022-08-24 10:43:57 +08:00
Mike McQuaid
c294dcc616
glibc related cleanup
Extracted from https://github.com/Homebrew/brew/pull/13577
2022-08-23 12:42:02 +01:00
Mike McQuaid
c09b1a09ea
Merge pull request #13648 from carlocab/gcc-linux-audit
formula_auditor: audit for Linux-only dependencies on GCC
2022-08-23 11:46:38 +01:00
Carlo Cabrera
718cf8b0df
Fix Linux-only GCC dependency check.
This is based on feedback from code review.
2022-08-22 14:54:52 +08:00
Carlo Cabrera
6ca02b22bb
formula_auditor: skip rename audit for glib-utils
I am removing `glib-utils` in (1) Homebrew/homebrew-core#108307, and all
`glib-utils` dependencies in (2) Homebrew/homebrew-core#108497.

This audit prevents me from proceeding with (1) without rebuilding all
the formulae modified in (2). I don't think that is needed, so I'd like
to exempt `glib-utils` from the rename audit instead.

To give you a clearer idea of how I plan to do this, this is the order
of events:
1. Merge this change.
2. Merge Homebrew/homebrew-core#108307.
3. Merge Homebrew/homebrew-core#108497.
4. Revert this change.

This should allow us to get rid of `glib-utils` and its accompanying
hacks without having to rebuild dozens of formulae needlessly.
2022-08-20 17:30:24 +08:00
Carlo Cabrera
18722901ee
formula_auditor: create a versioned formula dependent conflict allowlist
We have an audit that checks each formula's dependency tree for multiple
versions of the same software. We have an allowlist that allows us to
ignore this audit, but this allowlist requires each formula with a
conflict in its dependency tree to be listed there.

Here, I propose the reverse: if formula `foo` appears in the
`versioned_formula_dependent_conflicts_allowlist`, then all its
dependents will not fail the versioned dependencies conflict because of
a conflict with formula `foo`.

I'd like to do this in the case of `python`, where I think the versioned
dependencies conflict check hurts us more than helps us. Versioned
dependency conflicts are most problematic in the case of libraries with
the same install name but incompatible ABIs. This is almost never a
problem with Python: almost no formulae link with the Python framework
on macOS (in part due to one of our audits that disallows Python
framework linkage in Python modules). Moreover, the various Python
frameworks that we ship have the version in the install name.

The above _might_ be a problem on Linux, since we allow unrestricted
linkage with `libpython`. However, we don't even check versioned
conflicts on Linux, so we aren't as concerned about this in the first
place.

This is also a lot more convenient than adding the dependents of some
Python formula one by one as they acquire conflicts due to changes in
other formulae.

I've also amended `tap_auditor` to allow the use of formula aliases in
an allowlist, to allow us to add `python` to this allowlist instead of
each individual versioned Python formula.

See also discussion at Homebrew/homebrew-core#108307.
2022-08-18 15:40:54 +08:00
Rylan Polster
d4ddfb88df
Merge pull request #13616 from Rylan12/simulate-macos-on-linux
Move `HOMEBREW_SIMULATE_MACOS_ON_LINUX` handling to `SimulateSystem`
2022-08-05 10:23:13 -04:00
Carlo Cabrera
4302af67b7
formula_auditor: audit for Linux-only dependencies on GCC
As we've seen, allowing Linux-only dependencies on GCC results in its
dependency tree growing out of control to the point of being extremely
painful to maintain.

Let's stop this situation from getting worse by:
- failing a `--strict` audit when there is a Linux-only GCC dependency.
  This also prevents new formulae from having such a dependency.
- failing any audit whenever a formula that did not previously have a
  Linux-only GCC dependency picks one up

If a future formula update causes a formula to fail to build on Linux
because it needs a newer GCC when it previously did not, then we should
not bottle it. We can bottle this hypothetical formula when our bottling
distribution includes a new enough version of GCC.
2022-08-04 22:17:47 +08:00
Carlo Cabrera
e217fd35c2
Merge pull request #12770 from carlocab/deprecated-dependencies
formula_auditor: audit for deprecated dependencies
2022-07-30 13:23:57 +08:00
Shaun Jackman
7d1197e8eb audit_glibc: Permit glibc 2.27, 2.31, or 2.35 2022-07-29 14:06:51 -07:00
Shaun Jackman
1ac5fc05bd audit_glibc: Permit glibc 2.35
See https://github.com/Homebrew/brew/issues/13619
2022-07-29 10:13:09 -07:00
Shaun Jackman
291eacd482 audit_glibc: Fix the error message
"The glibc version must be 2.35" should have read
"The glibc version must be 2.23".
2022-07-29 09:30:18 -07:00
Carlo Cabrera
7c7a92e8fb
formula_auditor: clean up error wording 2022-07-29 20:10:05 +08:00
Carlo Cabrera
cbff83898e
formula_auditor: audit for deprecated dependencies
Closes #12748.
2022-07-29 15:07:16 +08:00
Rylan Polster
ea1f2098ac
Move HOMEBREW_SIMULATE_MACOS_ON_LINUX handling to SimulateSystem 2022-07-28 15:04:25 -04:00
Mike McQuaid
1bb44979ee
Disable and delete code for 3.5.0
The next planned release will be 3.5.0 so let's fix things up for there.
2022-05-30 14:59:14 +01:00
Bo Anderson
5ea092c464
formula_auditor: fix versioned alias audit
* Fix audit not being run at all due to always-false condition.
* Don't fail audit if versioned alias would clash with a versioned formula.
* Allow versioned aliases with the name of another alias.
2022-03-21 14:44:50 +00:00
Rylan Polster
12b45e85dd
Merge pull request #12854 from jsoref/audit-new-formula-should-not-define-revision
formula_auditor: new formulas should not define a revision
2022-02-11 11:09:46 -05:00
Carlo Cabrera
6c9c3c607c
formula_auditor: disallow external tap dependencies in core
Occasionally, we get PRs that attempt to add a dependency on a formula
in an external tap in homebrew/core (e.g. Homebrew/homebrew-core#94791).

We don't actually have an audit that disallows that. We should have one.
2022-02-10 06:57:46 +08:00
Josh Soref
37fd64b5a3 formula_auditor: new formulas should not define a revision
Logically new formulas should start at revision 0, but a
developer might use an existing formula as a template and
otherwise not realize they should remove this field.

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-02-09 13:14:10 -05:00
Bo Anderson
8ab9465ad2
formula_auditor: fix error with formulae without taps 2021-12-13 23:05:45 +00:00
Alexander Bayandin
27a76295a4
Merge pull request #12279 from bayandin/synced-versions-formulae
formula_auditor: add audit for formulae with synced versions
2021-11-19 12:24:33 +00:00
Carlo Cabrera
f36bb3c6b0
formula_auditor: respect using: :homebrew_curl in resources too
A resource can do `using: :homebrew_curl`, but, without this change, the
audit will still use system `curl`. This fails quite predictably.

Needed for Homebrew/homebrew-core#88330.
2021-10-30 20:04:13 +08:00
Alexander Bayandin
ce2d946a7c
formula_auditor: add audit for formulae with synced versions 2021-10-25 09:40:37 +01:00
Rylan Polster
fa4bb7d74a
Refactor audit exception handling 2021-10-21 21:11:05 -04:00
Mike McQuaid
b622c36be6
Add, use uses_from_macos_names.
This strips e.g. `:build` tags.
2021-09-14 09:48:19 +01:00
Bo Anderson
8dd11e4e4c
Set uses_from_macos_elements in all cases 2021-09-14 04:06:40 +01:00
Mike McQuaid
c6aea445a3
formula_auditor: allow uses_from_macos for aliases.
This will enable https://github.com/Homebrew/homebrew-core/pull/84910 which will
enable https://github.com/Homebrew/brew/pull/12008.
2021-09-09 10:24:35 +01:00
Michka Popoff
bbfa52fcaa
formula_auditor: use brewed curl for homepage check when needed
If the download url is using brewed curl, use that too for the homepage check.
Ideally one would introduce the "using: :homebrew_curl" stanza for the homepage
line in the DSL, but it is easier to implicitely use the same logic
for homepages and url's and define the "using:" only once.
2021-08-20 10:14:50 +02:00
Michka Popoff
07df4a7e70
Use Homebrew curl for audit and fetch when specified in the formula
Introduce new :using for urls
2021-08-17 13:35:55 +02:00
Nanda H Krishna
f69f9be233
Add allowlist, make branch: mandatory 2021-08-12 12:43:22 +05:30
Mike McQuaid
bd627d86ca
Merge pull request #11709 from hyuraku/formula_auditor_repiar-audit_versioned_keg_only
formula_auditor:repiar audit_versioned_keg_only
2021-07-13 16:29:44 +01:00
hyuraku
57911f479a formula_auditor: repair audit_specs 2021-07-13 21:55:47 +09:00
hyuraku
2e80eb060e formula_auditor:repiar audit_versioned_keg_only 2021-07-13 21:20:49 +09:00
Mike McQuaid
0eb9b62c2d
formula_auditor: don't allow bottle :unneeded in core.
Now we have `all:` bottles and Bintray is going away for `mirror`s:
let's bottle everything in Homebrew/homebrew-core.
2021-06-29 12:42:30 +01:00
Alexander Bayandin
c95c2e3258
audit_conflicts: verbose variables name 2021-06-18 17:34:42 +01:00
Alexander Bayandin
43d67816ea
audit_conflicts: enable for third-party taps 2021-06-18 17:34:42 +01:00
Alexander Bayandin
1ddb6ef584
audit: do not allow aliases and renames in formula conflicts 2021-06-18 17:34:42 +01:00
Alexander Bayandin
4c14675021
audit: add more checks for conflics_with audit 2021-06-18 17:34:42 +01:00
Sam Ford
a1cf581118
ResourceAuditor: Allow only/except options 2021-06-16 10:30:52 -04:00
Nanda H Krishna
141edc8506
formula_auditor: add audit for elasticsearch and kibana
Prevent upgrading them to version 7.11 or newer, as they were
relicensed to an incompatible license.
2021-06-03 00:33:37 +05:30