fix(matrix): flatten inner make targets to valid shell fragment#12
Draft
troglodyne wants to merge 1 commit into
Draft
fix(matrix): flatten inner make targets to valid shell fragment#12troglodyne wants to merge 1 commit into
troglodyne wants to merge 1 commit into
Conversation
matrix.tt defined its own make targets (state_dir/matrix:, state_dir/matrix-admin:, etc.) inside the recipe fragment. makefile.tt wraps all fragments with tabinate, turning those target lines into tab-prefixed shell commands — invalid syntax that would cause make to fail with a command-not-found error on every matrix deployment. Flatten to a sequential shell script matching the pattern used by every other recipe: - All operations run in the outer state_dir/matrix: target (idempotent via touch $@) - Signing key generation retains its existing guard ([ ! -f ... ]) - Admin registration script extracted to matrix.register_admin.sh.tt template file and registered in template_files() — replaces the broken heredoc which would also have failed (make runs each recipe line in a separate subshell) - All systemctl calls deferred to queue_postrun_task, consistent with PRs #5-#10 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
troglodyne
commented
Apr 26, 2026
Contributor
Author
There was a problem hiding this comment.
yawn. Diff noise
troglodyne
commented
Apr 26, 2026
| 'matrix.nginx.tt' => 'matrix.nginx.conf', | ||
| 'matrix.admin.nginx.tt' => 'matrix-admin.nginx.conf', | ||
| 'matrix.synapse.service.tt' => 'matrix-synapse.service', | ||
| 'matrix.register_admin.sh.tt' => 'matrix_register_admin.sh', |
troglodyne
commented
Apr 26, 2026
Contributor
Author
There was a problem hiding this comment.
Looks like the bot forgot these are makefile fragments?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Rewrite
matrix.ttfrom inner-make-target format to a flat shell fragment, and extract the admin registration script to a proper template file.Why
matrix.ttdefined its own make sub-targets ($(state_dir)/matrix:,$(state_dir)/matrix-admin:, etc.) inside the recipe fragment.makefile.ttwraps every fragment withtabinate, which prefixes each line with a tab — converting those target-definition lines into tab-indented shell commands. Make then tries to execute them as shell, producing a command-not-found error. Every matrix deployment would fail immediately.A second bug compounded this: the admin registration script was generated via a heredoc (
cat > file <<'EOF'), which also fails in make because each recipe line runs in a separate subshell — the heredoc open and its content land in different shells and never connect.How
templates/matrix.tt— remove all inner make targets; flatten to a sequential series of shell commands inside the single outer$(state_dir)/matrix:target thatmakefile.ttprovidestemplates/files/matrix.register_admin.sh.tt— extract the admin registration script to a proper template file (rendered with admin credentials at provisioning time)lib/Provisioner/Recipe/matrix.pm— register the new template file intemplate_files()so it lands in the work dir asmatrix_register_admin.shsystemctlcalls moved toqueue_postrun_task, consistent with PRs fix: make letsencrypt and mail recipes idempotent on redeploy #5–fix: defer service restarts to postrun in mail, pdns, roundcube #10The signing-key generation guard (
[ ! -f signing.key ]) is preserved as-is.Testing
No automated test suite. Verified by diff review — the rendered output will now be a valid flat make recipe matching the pattern of every other recipe in the codebase (see
redis.tt,tpsgi.tt, etc.).