1412 Commits

Author SHA1 Message Date
Tokarak
261f55a526 Prepare to migrate to RUSTFLAGS 2023-06-14 17:14:05 +01:00
Tokarak
c698174200 Fix error on empty target-cpu 2023-06-13 20:40:23 +01:00
Tokarak
2bd20eaa15 Fix 2023-06-13 19:45:52 +01:00
Tokarak
b4dd639189 Use rustflags_target_cpu 2023-06-13 19:28:53 +01:00
Tokarak
a0725083f1 Revert "Apply cpu-optimisation to Rust projects (hardcoded)"
This reverts commit c344a3ff3dbde3db05edb802d8951924689d1d65.
2023-06-13 19:17:28 +01:00
Tokarak
c344a3ff3d Apply cpu-optimisation to Rust projects (hardcoded) 2023-06-13 11:50:20 +01:00
Markus Reiter
e9bfcb9296
Merge pull request #15225 from reitermarkus/audit-os-arch
Add `--os=all` and `--arch=all` options for `brew audit`.
2023-05-19 15:03:32 +02:00
Kevin
946478aed4
Merge pull request #15396 from apainintheneck/custom-service-name
Custom service name
2023-05-17 22:09:31 -07:00
Markus Reiter
486c3765ce
Add --os=all and --arch=all options. 2023-05-17 15:26:46 +02:00
Markus Reiter
f60612e6b2
Add Formula#loaded_from_api?. 2023-05-15 13:58:33 +02:00
Markus Reiter
94d6213196
Merge pull request #15418 from reitermarkus/simplify-hash-merge
Simplify hash merge.
2023-05-14 21:41:39 +02:00
Markus Reiter
d2231086bd
Merge pull request #15420 from reitermarkus/simulate-system-with
Add `SimulateSystem::with`.
2023-05-14 21:41:20 +02:00
Markus Reiter
0d56b97b07
Add SimulateSystem::with. 2023-05-14 01:45:04 +02:00
apainintheneck
1111706378 service: add custom service name DSL
The main thing is that this DSL allows us to provide an
interface that can be serialized to the JSON API.

Changes:
- Homebrew::Service
  - Adds `#service_name` and `#plist_name` methods
    - Each is now included in the `#serialize` method as well
  - Eval block on instantiation
    - Before we lazy evaluated this but the cost is not significant
      and it complicated the code a bunch. This only gets called
      during install, when evaluating caveats and in the `brew service`
      command. It skips this evaluation if the service block isn't there.
  - Add `#command?` helper to avoid `#command.blank?` and `#command.present?`
- Formula
  - `#service` now returns a service whenever it's called. This call is
    hidden behind a call to `#service?` most of the time anyway so this
    should be fine.
  - `#plist_name` and `#service_name` now call the methods of the same name
    on the service class. This should have already been in the service object
    to begin with and keeping these methods here helps preserve backwards
    compatibility with people who were overwriting these methods before.
- Caveats
  - Prefer `service#command?`
  - Add helpers for checking on service commands
    - This duplicates some of the work in `brew services`. Maybe we should
      merge that repo in at some point.
  - Check for installed service at `#plist_name` or `#service_name`. I think
    this should be used instead of `Keg#plist_installed?` which checked for any plist file.
    We should think about deprecating `#plist_installed?` in the future.
  - Stop using `ps aux | grep #{formula.plist_name}` to check for service files
    because it was inaccurate (it always returns true on my machine) because the grep
    process is started before the ps process.
  - Note: The behavior is the same as it was before. This means that caveats
    only show up for custom service files on install or if they're already installed.
    Otherwise it won't show up in `brew info`. This is because it has to check
    first if the service file has been installed.
- Utils::Service
  - Add utils for evaluating if a service is installed and running. This duplicates
    some of the work already found in `brew services`. We should seriously consider
    merging `brew services` with the main brew repo in the future since it's already
    tightly coupled to the code in the main repo.
- Formulary.load_formula_from_api
  - Be more explicit about which types can be deserialized into run params since
    it is now possible for run params to be nil.
- Update and add tests
2023-05-13 14:53:01 -07:00
Markus Reiter
023238a761
Simplify hash merge. 2023-05-13 22:18:17 +02:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Bo Anderson
44f058edb5
Refactor formula, cask and Ruby source downloads to use shared code 2023-04-27 23:23:07 +01:00
Bo Anderson
a696bd8203
Support multiple oldnames for formulae 2023-04-27 05:15:43 +01:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
EricFromCanada
e67abce950
formula: consider arbitrary formula source paths 2023-04-22 18:56:01 -04:00
Markus Reiter
844db75361
Add source paths to API. 2023-04-07 15:20:01 +02:00
Douglas Eichelberger
f3a8241e69 Remove useless T.unsafe wrappers 2023-04-03 17:34:39 -07:00
apainintheneck
c073cf901a search: show results by platform
This means that formulas that are only available on one
OS should only show up in the search results for the platform.
2023-03-27 20:04:57 -07:00
Markus Reiter
5e52d415a9
Allow fetching for different arch. 2023-03-25 11:56:09 +01:00
apainintheneck
38146893c3 api_hashable: Make API path subs generic
This turns the ability to replace common paths with placeholders
into a mixin that can be used with both Casks and Formulae.

The idea here is to make formula hash generation more consistent.
2023-03-21 23:20:42 -07:00
apainintheneck
db8d488db4 service: add info to API json and load from api
As a part of serializing the hash, certain path
placeholders are used for the HOMEBREW_PREFIX and $HOME
directories. Beyond that certain elements need to be
turned back into strings like cron and sockets and symbols
need to be preserved as well.

The run command accepts either an arg or kwargs so it
has to be treated specially here.
2023-03-19 00:09:10 -07:00
Markus Reiter
3b45ecdc70
Move to_s. 2023-03-13 00:59:08 +01:00
Issy Long
8862c33b62
sorbet: Autogenerate the RBI file for Homebrew::EnvConfig
- I'm not as happy with this as I was with my work on `utils/tty.rb`,
  it feels a lot hackier and prone to breaking - especially the
  `T.nilable` "detection".
- However, it generates an RBI file that passes `brew typecheck`, so we
  can clean up some `hidden-definitions` entries, getting further
  towards fully typed.
2023-03-11 02:13:30 +00:00
Issy Long
6d822d9a62
rubocop: Drop "fn" from Naming/MethodParameterName allowlist
- I originally thought this was short for "function", but upon closer
  inspection all its usages are to do with filenames. So, use "filename",
  it's clearer.
2023-03-08 14:40:56 +00:00
Issy Long
3e7a46f474
rubocop: Drop "v" from Naming/MethodParameterName allowlist
- This was an easy fix, "v" => "version".
2023-03-08 14:40:55 +00:00
Alexander Bayandin
9b4f29e47c
formula: fix alias loading 2023-03-01 09:44:57 +00:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Bo Anderson
e663f532a6
Checksum Ruby source file downloads 2023-02-22 22:50:24 +00:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Bo Anderson
cacd7194f6
Support link_overwrite and conflicts_with in API 2023-02-20 16:28:07 +00:00
Issy Long
f8654bd363
rubocop: In-line disables of Metrics/{Module,Block,Class}Length
- We're not going to make the really long things be any shorter any time soon.
- The instructions in issue 14685 say, pragmatically, "disable all the rubocop
  rules we're never going to realistically fix e.g. Metrics/ClassLength". But
  that felt like a slippery slope to more _really_ long modules/classes/blocks,
  and the limits are here for a reason.
2023-02-19 16:33:23 +00:00
Mike McQuaid
237eec8ef8
Overhaul Formula/Cask JSON generation
- Use constants for placeholders
- Monkeypatch to set `HOMEBREW_PREFIX` consistently to placeholder
- Use environment variable to set `Dir.home` consistently to placeholder
- Use `appdir` short-circuit to set `Cask#appdir` consistently to placeholder
- Use `Cask.generating_hash!` to enable "generating mode" with these patches
- Fix `Formula#caveats` from JSON

Fixes #14505
Fixes #14595
2023-02-14 14:19:40 +00:00
Mike McQuaid
e0ba9a1249
Merge pull request #14617 from Bo98/api-reqs-oldname
formulary: support requirements, aliases etc from API
2023-02-14 11:54:55 +00:00
Bo Anderson
9b26bf9b92
formulary: support requirements, aliases etc from API 2023-02-14 03:32:56 +00:00
Bo Anderson
5619e5cc2c
formula: fix to_hash tampering with requirement names 2023-02-14 02:31:49 +00:00
Bo Anderson
cc956d73aa
Fix brew info --json regressions around install status 2023-02-13 05:07:40 +00:00
Rylan Polster
f7fa5937d8
Allow brew info --json=v2 without taps with JSON API 2023-02-12 12:03:40 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Mike McQuaid
6b4363092d
Revert "Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove"
This reverts commit 932d2cf3b77c9439a57b6a43577fc8d3b6399a62, reversing
changes made to f4e60482791d2ff628efadfdbf0d14d9237d2d29.
2023-02-07 19:25:51 +01:00
Mike McQuaid
6882ac17e7
Revert "Add deprecations and disables" 2023-02-07 15:13:19 +01:00
Bo Anderson
2055792791
Better support source builds under API mode 2023-02-06 13:27:36 +00:00
Bo Anderson
33681f90e3
Add HEAD information to JSON API 2023-02-06 13:06:39 +00:00
Mike McQuaid
a086fcd293
Merge branch 'chore/formula/deprecate_plist_options' into deprecate-disable-remove 2023-02-03 10:51:06 +00:00