Skip to content

Commit 053e342

Browse files
authored
Merge branch 'master' into portable-ruby-3.3.8
2 parents a272310 + 7b34fcc commit 053e342

File tree

103 files changed

+605
-517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+605
-517
lines changed

.github/workflows/actionlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
path: results.sarif
7878

7979
- name: Upload SARIF file
80-
uses: github/codeql-action/upload-sarif@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
80+
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
8181
with:
8282
sarif_file: results.sarif
8383
category: zizmor

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ jobs:
2828
persist-credentials: false
2929

3030
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
31+
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
3232
with:
3333
languages: ruby
3434
config: |
3535
paths-ignore:
3636
- Library/Homebrew/vendor
3737
3838
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
39+
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15

.github/workflows/tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,6 @@ jobs:
257257
test-flags: --coverage
258258
runs-on: ubuntu-latest
259259
container: ghcr.io/homebrew/ubuntu20.04:latest
260-
- name: tests (macOS 13 x86_64)
261-
test-flags: --coverage
262-
runs-on: macos-13
263260
- name: tests (macOS 15 arm64)
264261
test-flags: --coverage
265262
runs-on: macos-15

Library/Homebrew/Gemfile.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ GEM
4747
pycall (1.5.2)
4848
racc (1.8.1)
4949
rainbow (3.1.1)
50-
rbi (0.3.1)
50+
rbi (0.3.2)
5151
prism (~> 1.0)
5252
rbs (>= 3.4.4)
5353
sorbet-runtime (>= 0.5.9204)
@@ -103,7 +103,7 @@ GEM
103103
rubocop (~> 1.72, >= 1.72.1)
104104
rubocop-sorbet (0.10.0)
105105
rubocop (>= 1)
106-
ruby-lsp (0.23.13)
106+
ruby-lsp (0.23.14)
107107
language_server-protocol (~> 3.17.0)
108108
prism (>= 1.2, < 2.0)
109109
rbs (>= 3, < 4)
@@ -121,15 +121,15 @@ GEM
121121
simplecov-html (0.13.1)
122122
simplecov_json_formatter (0.1.4)
123123
simpleidn (0.2.3)
124-
sorbet (0.5.11993)
125-
sorbet-static (= 0.5.11993)
126-
sorbet-runtime (0.5.11993)
127-
sorbet-static (0.5.11993-aarch64-linux)
128-
sorbet-static (0.5.11993-universal-darwin)
129-
sorbet-static (0.5.11993-x86_64-linux)
130-
sorbet-static-and-runtime (0.5.11993)
131-
sorbet (= 0.5.11993)
132-
sorbet-runtime (= 0.5.11993)
124+
sorbet (0.5.12003)
125+
sorbet-static (= 0.5.12003)
126+
sorbet-runtime (0.5.12003)
127+
sorbet-static (0.5.12003-aarch64-linux)
128+
sorbet-static (0.5.12003-universal-darwin)
129+
sorbet-static (0.5.12003-x86_64-linux)
130+
sorbet-static-and-runtime (0.5.12003)
131+
sorbet (= 0.5.12003)
132+
sorbet-runtime (= 0.5.12003)
133133
spoom (1.6.1)
134134
erubi (>= 1.10.0)
135135
prism (>= 0.28.0)

Library/Homebrew/bundle/commands/exec.rb

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# typed: false # rubocop:todo Sorbet/TrueSigil
22
# frozen_string_literal: true
33

4+
require "English"
45
require "exceptions"
56
require "extend/ENV"
67
require "utils"
@@ -10,47 +11,9 @@ module Homebrew
1011
module Bundle
1112
module Commands
1213
module Exec
13-
# Homebrew's global environment variables that we don't want to leak into
14-
# the `brew bundle exec` environment.
15-
HOMEBREW_ENV_CLEANUP = %w[
16-
HOMEBREW_HELP_MESSAGE
17-
HOMEBREW_API_DEFAULT_DOMAIN
18-
HOMEBREW_BOTTLE_DEFAULT_DOMAIN
19-
HOMEBREW_BREW_DEFAULT_GIT_REMOTE
20-
HOMEBREW_CORE_DEFAULT_GIT_REMOTE
21-
HOMEBREW_DEFAULT_CACHE
22-
HOMEBREW_DEFAULT_LOGS
23-
HOMEBREW_DEFAULT_TEMP
24-
HOMEBREW_REQUIRED_RUBY_VERSION
25-
HOMEBREW_PRODUCT
26-
HOMEBREW_SYSTEM
27-
HOMEBREW_PROCESSOR
28-
HOMEBREW_PHYSICAL_PROCESSOR
29-
HOMEBREW_BREWED_CURL_PATH
30-
HOMEBREW_USER_AGENT_CURL
31-
HOMEBREW_USER_AGENT
32-
HOMEBREW_GENERIC_DEFAULT_PREFIX
33-
HOMEBREW_GENERIC_DEFAULT_REPOSITORY
34-
HOMEBREW_DEFAULT_PREFIX
35-
HOMEBREW_DEFAULT_REPOSITORY
36-
HOMEBREW_AUTO_UPDATE_COMMAND
37-
HOMEBREW_BREW_GIT_REMOTE
38-
HOMEBREW_COMMAND_DEPTH
39-
HOMEBREW_CORE_GIT_REMOTE
40-
HOMEBREW_MACOS_VERSION_NUMERIC
41-
HOMEBREW_MINIMUM_GIT_VERSION
42-
HOMEBREW_MACOS_NEWEST_UNSUPPORTED
43-
HOMEBREW_MACOS_OLDEST_SUPPORTED
44-
HOMEBREW_MACOS_OLDEST_ALLOWED
45-
HOMEBREW_GITHUB_PACKAGES_AUTH
46-
].freeze
47-
4814
PATH_LIKE_ENV_REGEX = /.+#{File::PATH_SEPARATOR}/
4915

5016
def self.run(*args, global: false, file: nil, subcommand: "", services: false)
51-
# Cleanup Homebrew's global environment
52-
HOMEBREW_ENV_CLEANUP.each { |key| ENV.delete(key) }
53-
5417
# Store the old environment so we can check if things were already set
5518
# before we start mutating it.
5619
old_env = ENV.to_h
@@ -153,10 +116,31 @@ def self.run(*args, global: false, file: nil, subcommand: "", services: false)
153116
# No need to export empty values.
154117
next if value.blank?
155118

156-
# Skip exporting non-Homebrew things that were already set in the old environment.
157-
next if !key.start_with?("HOMEBREW_") && old_env.key?(key) && old_env[key] == value
119+
# Skip exporting Homebrew internal variables that won't be used by other tools.
120+
# Those Homebrew needs have already been set to global constants and/or are exported again later.
121+
# Setting these globally can interfere with nested Homebrew invocations/environments.
122+
next if key.start_with?("HOMEBREW_", "PORTABLE_RUBY_")
123+
124+
# Skip exporting things that were the same in the old environment.
125+
old_value = old_env[key]
126+
next if old_value == value
158127

159-
puts "export #{key}=\"#{Utils::Shell.sh_quote(value)}\""
128+
# Look for PATH-like environment variables
129+
if key.include?("PATH") && value.match?(PATH_LIKE_ENV_REGEX)
130+
old_values = old_value.to_s.split(File::PATH_SEPARATOR)
131+
path = PATH.new(value)
132+
.reject do |path_value|
133+
# Exclude Homebrew shims from the PATH as they don't work
134+
# without all Homebrew environment variables.
135+
# Exclude existing/old values as they've already been exported.
136+
path_value.include?("/Homebrew/shims/") || old_values.include?(path_value)
137+
end
138+
next if path.blank?
139+
140+
puts "export #{key}=\"#{Utils::Shell.sh_quote(path.to_s)}:${#{key}:-}\""
141+
else
142+
puts "export #{key}=\"#{Utils::Shell.sh_quote(value)}\""
143+
end
160144
end
161145
return
162146
end

Library/Homebrew/dev-cmd/create.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ def create_formula
240240

241241
sig { returns(T.nilable(String)) }
242242
def __gets
243-
gots = $stdin.gets.chomp
244-
gots.empty? ? nil : gots
243+
$stdin.gets&.presence&.chomp
245244
end
246245
end
247246
end

Library/Homebrew/dev-cmd/edit.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,18 @@ def run
6363

6464
exec_editor(*paths)
6565

66-
if paths.any? do |path|
66+
is_formula = T.let(false, T::Boolean)
67+
if !Homebrew::EnvConfig.no_env_hints? && paths.any? do |path|
6768
next if path == "--project"
6869

69-
!Homebrew::EnvConfig.no_install_from_api? &&
70-
!Homebrew::EnvConfig.no_env_hints? &&
71-
(core_formula_path?(path) || core_cask_path?(path) || core_formula_tap?(path) || core_cask_tap?(path))
70+
is_formula = core_formula_path?(path)
71+
is_formula || core_cask_path?(path) || core_formula_tap?(path) || core_cask_tap?(path)
7272
end
73-
opoo <<~EOS
74-
`brew install` ignores locally edited casks and formulae if
75-
HOMEBREW_NO_INSTALL_FROM_API is not set.
73+
from_source = " --build-from-source" if is_formula
74+
no_api = "HOMEBREW_NO_INSTALL_FROM_API=1 " unless Homebrew::EnvConfig.no_install_from_api?
75+
puts <<~EOS
76+
To test your local edits, run:
77+
#{no_api}brew install#{from_source} --verbose --debug #{args.named.join(" ")}
7678
EOS
7779
end
7880
end

Library/Homebrew/dev-cmd/vendor-gems.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def run
2828
Homebrew.install_bundler!
2929

3030
ENV["BUNDLE_WITH"] = Homebrew.valid_gem_groups.join(":")
31+
ENV["BUNDLER_VERSION"] = HOMEBREW_BUNDLER_VERSION
3132

3233
ohai "cd #{HOMEBREW_LIBRARY_PATH}"
3334
HOMEBREW_LIBRARY_PATH.cd do

Library/Homebrew/formula-analytics/requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ six==1.17.0 \
6868
--hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \
6969
--hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81
7070
# via python-dateutil
71-
typing-extensions==4.13.1 \
72-
--hash=sha256:4b6cf02909eb5495cfbc3f6e8fd49217e6cc7944e145cdda8caa3734777f9e69 \
73-
--hash=sha256:98795af00fb9640edec5b8e31fc647597b4691f099ad75f469a2616be1a76dff
71+
typing-extensions==4.13.2 \
72+
--hash=sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c \
73+
--hash=sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef
7474
# via reactivex
75-
urllib3==2.3.0 \
76-
--hash=sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df \
77-
--hash=sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d
75+
urllib3==2.4.0 \
76+
--hash=sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466 \
77+
--hash=sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813
7878
# via influxdb3-python
7979

8080
# The following packages are considered to be unsafe in a requirements file:

Library/Homebrew/formula.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
require "linkage_checker"
3232
require "extend/ENV"
3333
require "language/java"
34+
require "language/php"
3435
require "language/python"
3536
require "tab"
3637
require "mktemp"

0 commit comments

Comments
 (0)