Skip to content

fix(sbom.mk): start recipe lines without a literal tab - #52

Merged
Frauschi merged 2 commits into
masterfrom
fix/sbom-mk-no-hard-tabs
Nov 2, 2026
Merged

Frauschi merged 2 commits into
masterfrom
fix/sbom-mk-no-hard-tabs

Conversation

@sameehj

@sameehj sameehj commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Problem

The wolfSSL Jenkins source-text check rejects hard tabs in *.mk files. wolfSSL PR wolfSSL/wolfssl#11701 vendors share/ into tools/sbom/, and the check fails on tools/sbom/build/sbom.mk. Other wolfSSL .mk files are in folders that the check skips (for example IDE/), so sbom.mk is the first .mk file that the check examines.

Change

  • Each recipe line in wolfssl_compliance_tooling_sbom_rule starts with $(SBOM_TAB), not a literal tab.
  • SBOM_TAB := $(shell printf '\t'). $(call) expands it before $(eval) parses the rule, so make reads the same recipe.
  • Continuation lines start with spaces.

The file has no tab characters now. It does not use .RECIPEPREFIX, so it still works with GNU make 3.81 (the macOS make).

Test

I ran the old and new sbom.mk with a stub driver that prints its arguments, with GNU make 3.81, in these cases:

  • the default target, with SBOM_SRCS, $$(( )) in SBOM_CFLAGS, SBOM_DEP_VERSION, and wolfssl/wolfcrypt version detection
  • a second target made with $(eval $(call ...,sbom-hal,SBOM_HAL_)), with SBOM_HAL_LIB and with SBOM_HAL_NO_ARTIFACT_HASH=1
  • the error checks for a missing name, a missing composition, and NO_ARTIFACT_HASH combined with SRCS or LIB

The driver arguments, the error messages, and the exit codes were the same in all cases. I did not test with GNU make 4.x.

Follow-up

After this PR merges, wolfSSL/wolfssl#11701 must re-pin tools/sbom/.wolfssl-compliance-tooling-rev to the commit on master.

The wolfSSL source-text check rejects hard tabs in *.mk files. A product
that vendors share/ (wolfSSL PR 11701) fails that check on
tools/sbom/build/sbom.mk.

Start each recipe line in wolfssl_compliance_tooling_sbom_rule with
$(SBOM_TAB). $(call) expands it to a tab before $(eval) parses the rule,
so make reads the same recipe. Indent the continuation lines with spaces.
The driver arguments and the error checks do not change (checked with
GNU make 3.81).
Copilot AI balanced review requested due to automatic review settings October 28, 2026 14:04

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.

🟢 Approval recommended

There are no active review issues for the SBOM makefile’s literal-tab removal.

No open issues 🎉

What changed in this PR

Removes literal tabs from the shared SBOM makefile so it can pass wolfSSL’s Jenkins source-text check when vendored, while preserving recipe behavior and GNU make 3.81 compatibility.

Changes:

  • Introduces SBOM_TAB to generate recipe-leading tabs during macro expansion.
  • Replaces literal tabs with $(SBOM_TAB) at recipe starts and spaces on continuation lines, without using .RECIPEPREFIX.
File Description
share/​build/​sbom.mk Removes literal tabs while preserving SBOM recipe commands and arguments.

Review effort: Balanced

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I ran the old and new sbom.mk against a stub driver on make 3.81 and 4.4.1. Driver arguments, error messages and exit codes match, so the 4.x gap from the description is covered. A few small things inline.

Comment thread share/build/sbom.mk Resolved
Comment thread share/build/sbom.mk Resolved
Comment thread share/build/sbom.mk Resolved
Nothing in this repo kept sbom.mk free of tabs, and no test ran it. A new
recipe line with a tab passed CI here and failed only in the wolfSSL
source-text check after a re-sync.

tests/test_sbom_mk.py fails on any tab in sbom.mk. When make is on PATH,
it runs the default target and a second $(call) target against a stub
driver. It checks the driver arguments, the shell arithmetic in
SBOM_CFLAGS, and the three error messages.

SBOM_TAB is now an override, and sbom.mk stops with an error when
$(shell printf '\t') is empty. Before, a shell without printf or
SBOM_TAB=x on the command line gave "missing separator" for every make
that includes the file. The comment now says why the file has no tabs.
@sameehj
sameehj force-pushed the fix/sbom-mk-no-hard-tabs branch from be440f9 to 9a2dd6e Compare November 2, 2026 07:31

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Frauschi
Frauschi merged commit 0c5037b into master Nov 2, 2026
3 checks passed
@Frauschi
Frauschi deleted the fix/sbom-mk-no-hard-tabs branch November 2, 2026 13:03
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