- check the version of `/usr/bin/ld` for support of `-no_fixup_chains`
- check for usage of the `-fuse-ld` flag, since this flag is only
supported by Apple ld64
Also, call `no_fixup_chains` when setting up the build environment.
- Apparently the "verified" parameter in the URL (present when a Cask's
download URL is not the same as its homepage) shouldn't have the
protocol (`https`, `http`) at the front.
- Removing this has happened manually in the past, so here's an
autocorrecting RuboCop for it.
- These had a lot of offenses that were marked as "try to enable".
- A lot of the "describe class" ones were for tests for cmds or dev-cmds,
`brew typecheck` or `brew --env`, and the cop would only pass if I
changed these "describe"s to `BrewTypecheck` or `Brew__Env` which
seemed unhelpful.
- The usefulness of the stubbed mocks cop is
[disputed](https://github.com/rubocop/rubocop-rspec/issues/ 1271), and
fixing the offenses (not autocorrectable) would involve us doing a
fair number of changes since changing `expect` to `allow` would then
force us to make each of the affected tests have `expect` assertions
at the end, where they sometimes don't currently.
- Other occurrences of `@@` and `$` variables are individually disabled
in-line in other files.
- So let's follow the same pattern for Homebrew/homebrew-cask developer
scripts, since there are only a few.
- `Include` and `Exclude` are ubiquitous but `AllowedMethods` less so.
- Move the inheritance to the single cop configuration that it's used
in. Like we do with some other cop configs where they have default
paths/settings that we want to add to, not replace.
- Part of trying to reduce the number of `Excludes:` we have in our
RuboCop configs.
- The fixes here all seemed reasonable, with some minimal tweaks for
line length and less floatiness. Apart from `test/dev-cmd/bottle_spec.rb`
where RuboCop wanted to do some ridiculously floaty indentation and there
wasn't an obvious alternative place to break the lines, so I opted for
in-line disables instead.
Invoking `ld` with `-undefined dynamic_lookup` emits a warning starting
Xcode 14:
ld: warning: -undefined dynamic_lookup may not work with chained fixups
Chained fixups is a linker optimisation that results in faster binary
load times, and is enabled by default starting Xcode 13 when the target
is macOS 12 or newer.
However, this interacts poorly with `-undefined dynamic_lookup`, and
Xcode will disable chained fixups when it is invoked with this flag
starting Xcode 14.3. Until then, we may be shipping binaries that are
broken in subtle ways, so let's disable chained fixups when necessary
instead.
I patterned the changes here after the handling of `-no_weak_imports`.
The only difference is that we need to check the flags that were passed
to the linker first to see if we do need to disable chained fixups.
For additional context, see:
https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-noteshttps://www.wwdcnotes.com/notes/wwdc22/110362/https://www.emergetools.com/blog/posts/iOS15LaunchTimehttps://github.com/python/cpython/issues/97524https://github.com/pybind/pybind11/pull/4301
- For a situation where `authored = 3`, `committed = 4`, the previous
calculation was `3 - 4` which meant that `committed = -1` in the end.
- This was incorrect, since a user can't have negative contributions!
- Instead, only do the subtraction to get the deduplicated `committed`
count if the number of authored commits is higher than the number of
committed commits. This approach should achieve the desired "don't
double count things that the user authored and committed, but do count
things that another person authored that the user committed".