Skip to content

Add glibc runtime action (14/24) - #23201

Merged
MikeMcQuaid merged 1 commit into
mainfrom
install-step-14-glibc-runtime
Jul 29, 2026
Merged

Add glibc runtime action (14/24)#23201
MikeMcQuaid merged 1 commit into
mainfrom
install-step-14-glibc-runtime

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member

Three glibc-family formulae share locale generation and timezone-link
setup with different rules for the legacy variants.

  • derive requested locales while always providing the UTF-8 default
  • invoke the installed localedef with normalised charmaps
  • preserve host timezone links when their sources exist

AI disclosure: using OpenAI Codex 5.6 Sol max with local review and
testing.

@MikeMcQuaid
MikeMcQuaid force-pushed the install-step-13-gzipped-executables branch from e5f68fb to fa41de0 Compare July 20, 2026 07:22
@MikeMcQuaid
MikeMcQuaid force-pushed the install-step-14-glibc-runtime branch from 4620ad0 to 2fbea75 Compare July 20, 2026 07:22
@MikeMcQuaid
MikeMcQuaid force-pushed the install-step-13-gzipped-executables branch from fa41de0 to 65c8140 Compare July 21, 2026 07:14
@MikeMcQuaid
MikeMcQuaid force-pushed the install-step-14-glibc-runtime branch from 2fbea75 to 46ec0ad Compare July 21, 2026 07:14
@MikeMcQuaid
MikeMcQuaid force-pushed the install-step-13-gzipped-executables branch from 65c8140 to f8711ab Compare July 26, 2026 15:46
@MikeMcQuaid
MikeMcQuaid force-pushed the install-step-14-glibc-runtime branch from 46ec0ad to d5ef087 Compare July 26, 2026 16:16
@MikeMcQuaid
MikeMcQuaid requested a review from Copilot July 26, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new install-steps “formula action” to configure glibc-family runtime state (locale generation and timezone link setup), and wires it into the install steps DSL, runner dispatch, RuboCop auditing, tests, and documentation.

Changes:

  • Introduces configure_glibc_runtime as an install-step DSL action and adds runner support (run_configure_glibc_runtime).
  • Extends RuboCop’s allowed install-step method list and updates related RuboCop specs.
  • Adds a dispatch spec for the new action and documents the repeated action in the Formula Cookbook.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Library/Homebrew/test/rubocops/install_steps_spec.rb Updates RuboCop cop specs to include the new DSL action in allowed methods.
Library/Homebrew/test/install_steps_spec.rb Adds a spec asserting runner dispatch for the new configure_glibc_runtime step.
Library/Homebrew/rubocops/shared/install_steps_helper.rb Allows configure_glibc_runtime within post_install_steps blocks.
Library/Homebrew/install_steps/formula_actions.rb Implements run_configure_glibc_runtime to generate locales and set timezone-related symlinks.
Library/Homebrew/install_steps.rb Adds DSL method configure_glibc_runtime and runner dispatch case.
docs/Formula-Cookbook.md Documents the new repeated action (but currently with a name mismatch).
Comments suppressed due to low confidence (2)

Library/Homebrew/install_steps/formula_actions.rb:114

  • run_configure_glibc_runtime creates lib/locale but doesn’t ensure the parent directories for the timezone symlink targets exist. File.symlink will raise Errno::ENOENT if context_path("etc") or context_path("share") don’t already exist.
        [[Pathname("/etc/localtime"), context_path("etc")/"localtime"],
         [Pathname("/usr/share/zoneinfo"), context_path("share")/"zoneinfo"]].each do |source, target|
          File.symlink source, target if source.exist? && !target.exist?
        end

Library/Homebrew/install_steps/formula_actions.rb:105

  • Charmap normalisation only handles the exact lowercase string "utf8". To reliably normalise common variants (e.g. "UTF8", "utf-8"), compare case-insensitively after removing dashes.
          if charmap.present?
            charmap = "UTF-8" if charmap == "utf8"
            run_command context_path("bin")/"localedef", "-i", lang, "-f", charmap, locale

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/Formula-Cookbook.md Outdated
Comment thread Library/Homebrew/install_steps/formula_actions.rb
@MikeMcQuaid
MikeMcQuaid force-pushed the install-step-13-gzipped-executables branch from f8711ab to a959228 Compare July 26, 2026 17:13
Three glibc-family formulae share locale generation and timezone-link
setup with different rules for the legacy variants.

- derive requested locales while always providing the UTF-8 default
- invoke the installed `localedef` with normalised charmaps
- preserve host timezone links when their sources exist
@MikeMcQuaid
MikeMcQuaid force-pushed the install-step-14-glibc-runtime branch from d5ef087 to d39b823 Compare July 26, 2026 17:13
Base automatically changed from install-step-13-gzipped-executables to main July 27, 2026 01:18
@MikeMcQuaid
MikeMcQuaid marked this pull request as ready for review July 29, 2026 13:28
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 5a2627b Jul 29, 2026
43 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the install-step-14-glibc-runtime branch July 29, 2026 16:58
dduugg added a commit that referenced this pull request Jul 30, 2026
Main added the `configure_glibc_runtime` and `configure_clang_system`
install-steps DSL methods (#23201, #23190). They are formula-facing DSL with
no in-repo caller, like their siblings, so mark them `@api internal` to keep
brew deadcode idempotent.

Claude-Session: https://claude.ai/code/session_011BgWRBydtdkvt8ocqH4nj9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants