Skip to content

Commit d6416b8

Browse files
authored
Merge pull request #19685 from Dogacel/dogac/fix-macos-bom-issue
Fix "make verify" failing in MacOS due to BOM file verification.
2 parents 03b2537 + cad737b commit d6416b8

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

scripts/test.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,10 @@ function bom_pass {
502502
run cp go.sum go.sum.tmp || return 2
503503
run cp go.mod go.mod.tmp || return 2
504504

505-
output=$(GOFLAGS=-mod=mod run_go_tool github.com/appscodelabs/license-bill-of-materials \
505+
# BOM file should be generated for linux. Otherwise running this command on other operating systems such as OSX
506+
# results in certain dependencies being excluded from the BOM file, such as procfs.
507+
# For more info, https://github.com/etcd-io/etcd/issues/19665
508+
output=$(GOOS=linux GOFLAGS=-mod=mod run_go_tool github.com/appscodelabs/license-bill-of-materials \
506509
--override-file ./bill-of-materials.override.json \
507510
"${modules[@]}")
508511
code="$?"

scripts/test_lib.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ function tool_pkg_dir {
320320
# tool_get_bin [tool]
321321
function run_go_tool {
322322
local cmdbin
323-
if ! cmdbin=$(GOARCH="" tool_get_bin "${1}"); then
323+
if ! cmdbin=$(GOARCH="" GOOS="" tool_get_bin "${1}"); then
324324
log_warning "Failed to install tool '${1}'"
325325
return 2
326326
fi

scripts/updatebom.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ function bom_fixlet {
1414
# shellcheck disable=SC2207
1515
modules=($(modules_for_bom))
1616

17-
if GOFLAGS=-mod=mod run_go_tool "github.com/appscodelabs/license-bill-of-materials" \
17+
# BOM file should be generated for linux. Otherwise running this command on other operating systems such as OSX
18+
# results in certain dependencies being excluded from the BOM file, such as procfs.
19+
# For more info, https://github.com/etcd-io/etcd/issues/19665
20+
if GOOS=linux GOFLAGS=-mod=mod run_go_tool "github.com/appscodelabs/license-bill-of-materials" \
1821
--override-file ./bill-of-materials.override.json \
1922
"${modules[@]}" > ./bill-of-materials.json.tmp; then
2023
cp ./bill-of-materials.json.tmp ./bill-of-materials.json

0 commit comments

Comments
 (0)