Skip to content

Fix(make): Drop literal quotes from -C argument - #276

Merged
ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:fix/make-path-prefix-quoting
Oct 1, 2026
Merged

ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:fix/make-path-prefix-quoting

Conversation

@ModeSevenIndustrialSolutions

@ModeSevenIndustrialSolutions ModeSevenIndustrialSolutions commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the make + path_prefix regression that has kept main red
since 8 September. Every build with make: true and a path_prefix
fails before any make target runs:

MAKE_ARGS: -C "project" deps-nss env-github-actions
make: *** "project": No such file or directory.  Stop.

Failing run:
https://github.com/lfreleng-actions/python-build-action/actions/runs/36745751407/job/109991397311

Root cause

The Prepare make arguments step wrapped path_prefix in escaped
double quotes (-C "project"). That worked by accident:

  • make-action v0.1.4 interpolated ${{ inputs.make_args }} directly
    into its script source, giving make_args="-C "project" deps-nss ...".
    Bash parsed that line and quote removal stripped the inner quotes.
  • make-action v0.1.5 (bumped in Chore: Bump lfreleng-actions/make-action from 0.1.4 to 0.1.5 #265) fixed a zizmor template-injection
    finding by passing make_args through an environment variable and
    expanding it unquoted ("$make_cmd" $make_args). Word splitting does
    not perform quote removal, so make received "project", quotes
    included.
Run Commit make-action Result
Last green 7a18f03 v0.1.4 ✅ success
First after #265 lands e4e12f3 v0.1.5 ❌ failure

make-action v0.1.5 is behaving as documented: its README example and
its own auto-generated form are both an unquoted -C <path>. The fix
therefore belongs in this action.

Changes

  • action.yaml

    • Prepare make arguments: pass the directory bare (-C ${path_prefix}).
    • Setup action/environment: when make is true, reject a
      path_prefix containing whitespace or glob characters (*, ?, [).
      The unquoted expansion in make-action both word-splits and
      pathname-expands, so whitespace would split the path and a glob could
      rewrite it. For example, with directories literal[1] and literal1,
      -C literal[1] becomes -C literal1 and make runs in the wrong
      project. The check runs before any purge or build work starts.
  • .github/workflows/testing.yaml: self-contained regression tests
    in the tests job.

    • A Makefile in the existing setup.cfg-only fixture, with a target
      that must run inside path_prefix.
    • Strict expected-failure runs for a whitespace prefix and a glob
      prefix. Each directory holds a sentinel that purge_artefact_path
      would delete, so the test passes only if the action failed and
      stopped before doing any work.

    Coverage of the make path previously depended solely on an external
    project in the MULTI_ARCH_TEST_PROJECTS repository variable.

  • README.md: document the -C <path_prefix> behaviour and the
    whitespace/glob restriction.

Validation

  • Replayed the real run: scripts (the Setup action/environment and
    Prepare make arguments steps, fed into make-action v0.1.5's script)
    against temporary projects:
    • upstream/main reproduces make: *** "project": No such file or directory.
    • this branch runs make in the correct directory for project,
      project/ and sub/dir
    • this branch rejects literal[1] (with a literal1 decoy present),
      a*b, a?b and space dir during setup, with the sentinel intact
    • with make: false, whitespace and glob prefixes behave as before
  • prek run --files on all changed files: passed
  • zizmor --persona auditor action.yaml .github/workflows/testing.yaml:
    no findings
  • aislop-gate.sh upstream/main: clean (3 files gated)

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions requested review from a team and a balanced review from Copilot October 1, 2026 07:22
@github-actions github-actions Bot added the bug Something isn't working label Oct 1, 2026

This comment was marked as resolved.

Since make-action v0.1.5 (bumped in lfreleng-actions#265), every build with make: true
and a path_prefix fails before any make target runs:

  make: *** "project": No such file or directory.  Stop.

The prepare step wrapped path_prefix in escaped double quotes. That
only worked because make-action v0.1.4 interpolated make_args into its
script source, where bash quote removal stripped them again. v0.1.5
resolved a zizmor template-injection finding by passing make_args
through an environment variable instead; the unquoted expansion that
follows word-splits but performs no quote removal, so make received
the quotes literally.

Pass the directory bare, matching the unquoted -C form make-action
itself generates. That expansion also performs pathname expansion, so
whitespace would split path_prefix and glob characters could rewrite
it: with directories literal[1] and literal1, -C literal[1] becomes
-C literal1 and make runs in the wrong project. When make is enabled,
reject a path_prefix containing whitespace, *, ? or [ during setup,
before any purge or build work starts.

Add self-contained regression tests to the tests job: a make target
that must run inside path_prefix, and strict expected-failure runs for
whitespace and glob prefixes whose sentinel files prove the rejection
happened up front. Coverage of the make path no longer depends solely
on an external project listed in the MULTI_ARCH_TEST_PROJECTS
repository variable. Document the -C behaviour and the restriction in
the README.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 09:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused fix matches make-action’s argument handling and includes robust regression coverage.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@zxiiro zxiiro 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.

🤖 Auto-approved by agent: reviewed workflow/code change for security and CI/CD impact, found low risk. Drops literal quotes around make -C path_prefix (make-action word-splits unquoted) and rejects whitespace/glob path_prefix when make=true; additive safety, no new permissions/secrets.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 48d2e03 into lfreleng-actions:main Oct 1, 2026
11 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the fix/make-path-prefix-quoting branch October 1, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants