Homebrew Core

repository·main·Indexed 12 days ago

https://github.com/homebrew/homebrew-core

The central repository for the Homebrew package manager, containing core formulae for macOS and Linux. Includes documentation for installing packages via `brew install` and internal maintenance utilities such as `aspell-dictionaries`, `check-bottle-modification`, `check-ci-status`, and `determine-rebottle-runners`.

Tokens
1.7K
Snippets
10
Records
12
Agent score
93%

What's inside Homebrew Core

  1. Install formulae from Homebrew Core

    main

    To install a package (formula) from the Homebrew Core repository, use the brew install command followed by the formula name. Homebrew Core is the default tap and is installed automatically when you install Homebrew.

    brew install <formula>
  2. Arguments for `determine-rebottle-runners`

    main

    The command accepts two positional arguments:

    1. <formula>: The name of the formula to be rebottled.
    2. <timeout>: An integer representing the timeout value used to determine the Linux runner type (e.g., whether to use a specialized linux-arch-dispatch runner or a standard ubuntu-latest runner).
    # Usage pattern:
    `determine-rebottle-runners` my-formula 600
  3. Output format of `determine-rebottle-runners`

    main

    The command outputs a JSON array of runner specifications to the GITHUB_OUTPUT file.

    For macOS, the output is typically a simple object with a runner key:

    { "runner": "macos-14-arm64-12345678-dispatch" }

    For Linux, the output is a more complex object containing the runner name, container image, and working directory:

    {
      "runner": "linux-x86_64-12345678-dispatch",
      "container": {
        "image": "ghcr.io/homebrew/brew:main",
        "options": "--user=linuxbrew --env=HOMEBREW_SANDBOX_LINUX_LANDLOCK=1"
      },
      "workdir": "/github/home"
    }
  4. Reference: `check-ci-status` flags and arguments

    main

    The following arguments and flags are available for the check-ci-status command:

    Arguments:
      pull_request_number (1) - The number of the pull request to check.
    
    Flags:
      --cancel                - Determine whether tests can be cancelled.
      --long-timeout-label    - Determine whether a long-timeout label can be removed.
  5. Use `check-ci-status` flags to determine CI actions

    main

    The check-ci-status command provides two primary flags to drive automation logic:

    • --cancel: Determines whether the current CI tests can be cancelled. If cancellable, it outputs cancellable-run-id (the GitHub workflow run database ID).
    • --long-timeout-label: Determines whether a long-timeout label can be removed. It returns true if the CI status is COMPLETED or if the number of incomplete macOS checks is within the allowable limit (ALLOWABLE_REMAINING_MACOS_RUNNERS = 1). It returns false if the test_deps job is still waiting or if too many macOS checks are incomplete.

    Requirement: You must provide at least one of these flags, otherwise the command will raise a UsageError.

    # To get the cancellable run ID
    check-ci-status --cancel 123
    
    # To check if the long-timeout label can be removed
    check-ci-status --long-timeout-label 123
  6. Use `aspell-dictionaries` to generate aspell dictionary resources

    main

    The aspell-dictionaries command is a utility used to generate the Ruby code required to define new dictionary resources for the aspell formula. It scrapes the GNU FTP mirror to identify available language dictionaries and outputs a formatted Ruby block for each language, including the URL, mirror URL, and the SHA256 checksum of the downloaded file.

    This is primarily used by maintainers to update the aspell formula with new language support.

    `aspell-dictionaries`
    
    Generates the new dictionaries for the `aspell` formula.
  7. Check CI status with `check-ci-status`

    main

    The check-ci-status command is used to determine the status of CI tests for a specific Pull Request. It is primarily used to decide if CI tests can be cancelled or if a long-timeout label can be removed.

    Note: This command is hidden from man pages and is intended for CI/automation workflows. It requires a Pull Request number as a positional argument and requires at least one of the --cancel or --long-timeout-label flags to be set.

    Outputs: Results are written to the file specified by the GITHUB_OUTPUT environment variable in the format key=value.

    # Usage pattern:
    # check-ci-status [options] <pull_request_number>
    
    # Example: Check if tests can be cancelled and if the long-timeout label can be removed for PR 123
    check-ci-status --cancel --long-timeout-label 123
  8. Run the check-bottle-modification command

    main

    The check-bottle-modification command is used to verify that the bottle block of a formula in a Pull Request is modified only by BrewTestBot. It inspects the commits associated with a specific Pull Request number and checks if any commit (excluding those by BrewTestBot) modifies lines matching the bottle block pattern (e.g., bottle do or sha256 definitions).

    If a modification is detected, the command will exit with an error using odie and, if the GITHUB_OUTPUT environment variable is set, it will append bottle_modified=true to that output file.

    # Usage pattern (conceptual):
    # brew check-bottle-modification <pull_request_number>
    
    # Example execution:
    brew check-bottle-modification 12345
  9. Use `determine-rebottle-runners` to identify CI runners

    main

    The determine-rebottle-runners command determines the specific GitHub Actions runners required to rebottle a given formula. It calculates the necessary macOS and Linux runner configurations based on the formula's bottle specification tags and a provided timeout value. The resulting list of runners is written to the GITHUB_OUTPUT environment variable in JSON format, specifically under the runners key.

    `determine-rebottle-runners` <formula> <timeout>