Skip to content

feat(workflows): step 7, add shared Makefile.common and drift check - #48

Open
seantronsen wants to merge 9 commits into
seantronsen/feat/runner-selectionfrom
seantronsen/feat/makefile-drift-avoidance
Open

seantronsen wants to merge 9 commits into
seantronsen/feat/runner-selectionfrom
seantronsen/feat/makefile-drift-avoidance

Conversation

@seantronsen

@seantronsen seantronsen commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Important

This is a first draft at deduplicating Makefile recipes across the org's repos. I have notes on possible additions that I'll look at later. In the meantime, if you have questions or think something's missing, let me know.

Adds a shared Makefile.common for OpenCHAMI repos and a reusable workflow that catches drift from it.

  • Makefile.common: common targets (Go build/test/lint/vuln, Fabrica codegen, containers, GoReleaser packages, REUSE, deps, GNU-style install/uninstall, help, clean) and standard variable names. Repos vendor it at their root, set overrides before include Makefile.common, and keep repo-only targets in their own Makefile. all, deps, build, run, install, and uninstall are double-colon rules so repos can extend them. make build embeds build info into <module>/internal/version (Version, Tag, Branch, Commit, Date, GoVersion, GitState, BuildHost, BuildUser); GO_VERSION_PACKAGE or GO_LDFLAGS overrides it. Targets that don't apply skip (no go.mod, no Fabrica, no Containerfile); GoReleaser targets fail without a config. GNU make 3.81 compatible.
  • lint-makefile-common.yml: reusable workflow, no inputs. Resolves this repo's latest release to its commit SHA, fetches Makefile.common at that SHA, and fails with a diff if the caller's copy differs.
  • README: entries for both, plus adoption instructions and a GoReleaser ldflags snippet that sets the same internal/version variables, so release binaries and make build report the same build info.

Stacked on #47.

Downstream adoption is separate work and changes target/variable names in adopting repos (e.g. test-coverage → coverage, rpm-build → build-packages, install (dependencies) → deps, BINARY_NAME → PROJECT/BINARIES, main.version ldflags → internal/version).

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • I have updated the relevant documentation (CLI examples, man pages, README, other docs, etc.)
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Dependency update
  • Build system/CI

🤖 Generated with Claude Code

Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
@seantronsen
seantronsen changed the base branch from main to seantronsen/feat/runner-selection October 14, 2026 14:56
@seantronsen
seantronsen added this pull request to stack #40 October 14, 2026 14:56
@seantronsen seantronsen changed the title draft: makefile drift avoidance. feat: add Makefile.common and lint-makefile-common drift check Oct 14, 2026
@seantronsen seantronsen changed the title feat: add Makefile.common and lint-makefile-common drift check feat(workflows): step 7, add shared Makefile.common and drift check Oct 14, 2026
@seantronsen

seantronsen commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

See OpenCHAMI/github-actions-testbed#11 for test results.

Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
@seantronsen seantronsen self-assigned this Oct 15, 2026
Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
@seantronsen
seantronsen marked this pull request as ready for review October 15, 2026 18:13
@seantronsen
seantronsen requested review from alexlovelltroy and synackd and removed request for alexlovelltroy October 15, 2026 18:13
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.

1 participant