Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add generated SPDX file on bottling #16594

Merged
merged 1 commit into from May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/Gemfile
Expand Up @@ -35,7 +35,7 @@ end
group :man, optional: true do
gem "kramdown", require: false
end
group :pr_upload, optional: true do
group :pr_upload, :bottle, optional: true do
gem "json_schemer", require: false
end
group :prof, optional: true do
Expand Down
8 changes: 8 additions & 0 deletions Library/Homebrew/dev-cmd/bottle.rb
Expand Up @@ -6,6 +6,7 @@
require "formula"
require "utils/bottles"
require "tab"
require "sbom"
require "keg"
require "formula_versions"
require "utils/inreplace"
Expand Down Expand Up @@ -95,6 +96,8 @@ class Bottle < AbstractCommand

sig { override.void }
def run
Homebrew.install_bundler_gems!(groups: ["bottle"])

if args.merge?
Homebrew.install_bundler_gems!(groups: ["ast"])
return merge
Expand Down Expand Up @@ -491,6 +494,8 @@ def bottle_formula(formula)
Tab.clear_cache
Dependency.clear_cache
Requirement.clear_cache
SBOM.clear_cache

tab = keg.tab
original_tab = tab.dup
tab.poured_from_bottle = false
Expand All @@ -503,6 +508,9 @@ def bottle_formula(formula)
tab.write
end

sbom = SBOM.create(formula)
sbom.write

keg.consistent_reproducible_symlink_permissions!

cd cellar do
Expand Down