43 Commits

Author SHA1 Message Date
Rylan Polster
431d8f1ff7
Consistently use ClassMethods sub-module for prepending class methods 2025-06-21 21:40:57 -04:00
Rylan Polster
508c8b606c
Fix DevelopmentTools::ld64_version on macOS 2025-06-21 21:13:38 -04:00
Douglas Eichelberger
eed660e784 Move remaining OS extensions to prepend 2024-10-05 12:18:29 -07:00
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Issy Long
0e81efcccb
sorbet: Comment more files that can't be strict because of undef
- Found with
  `grep -rL "# typed: strict" Library/Homebrew | xargs grep -l "undef "`.
- This stops people from trying to bump them and
  getting an error that they can't fix because
  [it's a Sorbet limitation](https://sorbet.org/docs/error-reference#3008),
  wasting contributor time.
2024-08-09 18:23:00 +01:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Bo Anderson
5582849ae7
Reproducible builds for native compiled binaries 2024-03-11 16:06:55 +00:00
Ruoyu Zhong
99607e8ec4
development_tools: allow Symbols to be located
Fixes error seen in Homebrew/homebrew-core#138452.
`DevelopmentTools.default_compiler` can return a `Symbol` like `:clang`.
Make sure its result can be fed to `DevelopmentTools.locate`.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2023-08-04 11:26:30 +08:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Michka Popoff
bc83c39337
debian7: force usage of brewed ca-certificates 2022-02-22 13:26:59 +01:00
Bo Anderson
1952d27ba2
Install and use Homebrew's ca-certificates on macOS <= 10.15.5 2021-10-03 17:52:10 +01:00
fn ⌃ ⌥
9638e3e8c0 development_tools: update type signatures 2021-09-29 17:44:26 -07:00
fn ⌃ ⌥
61a7ffb999 development_tools: add type signatures 2021-09-29 15:12:53 -07:00
Bo Anderson
91ab5fe0ce
extend/os/mac/development_tools: add preferred_perl to built_on 2021-05-10 05:50:08 +01:00
Bo Anderson
fe52b3a402 os/mac/diagnostic: check SDK version matches the path 2021-02-11 01:19:59 +00:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Bo Anderson
b338398a8c tab: add built_on & arch information 2020-08-18 15:58:00 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
EricFromCanada
fa6404e0f5 grammar fixes 2019-04-13 21:29:32 -04:00
Mike McQuaid
1aa8ad09e2
Deprecate macOS versions below Mavericks
And remove all dead/unneeded code.
2019-01-27 12:27:47 +00:00
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
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Mike McQuaid
6b3bb666e8 Merge pull request #3174 from sjackman/popen-options
popen: Do not suppress stderr when HOMEBREW_STDERR
2017-09-23 16:31:52 +01:00
Mike McQuaid
0e766d00a5 development_tools: fix curl https handling.
`curl` can handle modern certificates _unless_ it is too old. This
broke `brew audit`'s HTTPS detection code.
2017-09-22 16:02:09 +01:00
Shaun Jackman
8bb57187ab locate: Suppress stderr
Suppress the error message:
xcrun: error: unable to find utility "gcc-4.0", not a developer tool or in PATH
2017-09-20 13:25:37 -07:00
Mike McQuaid
ffdda0eb9f Tweaks for older Mac OS X versions.
- `brew update` should try to install `curl` before `git` on older
  versions of Mac OS X where it is needed for accessing modern SSL
  certificates.
- We don't need an HTTP mirror for `git` because `curl` will already be
  installed before it is downloaded.
- Don't recommend GCC on Mac OS X versions where it can't be built with
  the default system compiler.
- Start using the Homebrew `curl` on Mac OS X versions where it is
  needed as soon as it is installed.
2017-09-16 12:41:08 +01:00
EricFromCanada
60f6dfea14 update suggested Xcode/CLT download URLs 2017-03-28 11:12:34 -04:00
Mike McQuaid
e26cf3a83f Don't check Subversion HTTPS pre-Sierra.
The system Subversion doesn't handle new certificate authorities (e.g.
Let's Encrypt) well enough for this check to be useful.
2017-03-05 11:42:59 +01:00
Mike McQuaid
b1e27d689d Merge pull request #1701 from MikeMcQuaid/deprecate-std-superenv-stuff
ENV: deprecate old methods.
2016-12-30 20:43:27 +00:00
Mike McQuaid
e50102d91e ENV: deprecate old methods.
These should have been deprecated long ago but we didn’t really have
the necessary framework to do so.
2016-12-30 20:20:13 +00:00
Mike McQuaid
b3c6334d3c audit: use new curl_args form.
This will use Curl’s default user agent to reduce homepage errors and
provides a function that can be used for other audits to perform
similar tests on URLs.
2016-12-30 20:17:34 +00:00
Mike McQuaid
6f44dc41d5 development_tools: remove unused method. 2016-12-29 12:51:12 +00:00
Mike McQuaid
b1a16deb19 Use BSD tar's libarchive LZMA support if available
Avoid using an unnecessary `xz` dependency when it's not needed.
2016-10-15 13:10:37 +01:00
Markus Reiter
e851c9bf6c Style/Alias: Prefer alias. 2016-09-23 18:19:53 +02:00
Mike McQuaid
6a81782753 extend/os/mac/development_tools: fix Rubocop warnings. 2016-09-13 07:57:09 +01:00
Mike McQuaid
012fc4709a development_tools: add install instruction helpers. 2016-07-27 15:05:42 -06:00
Xu Cheng
de1049f1f1
various: proper escape dot in regex 2016-07-13 19:11:46 +08:00
Mike McQuaid
3a127e405e development_tools: add installed? method. (#455) 2016-07-06 11:07:24 +01:00
Martin Afanasjew
aa747b915a development_tools: fix broken 'Xcode' reference
Affects only legacy systems that don't have a `/usr/bin/cc` binary.
2016-05-26 19:02:25 +02:00
Mike McQuaid
375efe0945 Remove LLVM-GCC support. (#252)
At this point it's never a good compiler to use so let's just remove it.
2016-05-22 09:40:08 +01:00
Mike McQuaid
e316cc9296 Make development tools code cross-platform. 2016-05-08 16:51:22 +01:00