Skip to content

Resolve every code lookup from one lib dir so the code tree can be read-only #781

Done

Description

@pithead-developer

What's the problem

util/.sh are found by the real script location while unit templates, VERSION, proposed-grub.sh and util/.py use SCRIPT_DIR. Pointing RIGFORGE_HOME at a state dir breaks template and util lookups, so code and state cannot be split.

What it impacts

The .deb and the formula, and the tests that source rigforge.sh directly.

How I found it

Tracing script-relative lookups in rigforge.sh (lines 66-73, 148-154, 1051, 2588-2590, 4852 against the template, VERSION and util/*.py reads) and the unit templates' ExecStart and LoadCredential paths.

How important is it

Blocker for #784 and #787. Small once #780 exists.

Acceptance criteria

  • A RIGFORGE_LIB variable (default the real script directory) is the only source of code paths: util scripts, templates, VERSION, proposed-grub.sh.
  • With the lib dir a read-only copy of the release bundle and RIGFORGE_STATE writable, a test runs setup (fake bench), upgrade, doctor and support-bundle and asserts nothing was written under the lib dir (before/after tree hash).
  • Rendered units reference the lib path for ExecStart and util scripts and the state path for config.
  • With variables unset, the existing suite passes unchanged.
  • docs/operations.md lists which files live under which directory.

Possible solutions

Keep SCRIPT_DIR as an alias of the lib dir and rename uses by role. Leaving two lookup mechanisms in place is the failure mode to avoid.

Activity

  1. added this to the v1.20.0 milestone on Nov 20, 2026
  2. added
    enhancement
    infra
    size:M
    on Nov 20, 2026
  3. pithead-developer commented on Nov 24, 2026

    @pithead-developer
    ContributorAuthor

    Grouped with #780, but PR #826 does not close it: the worker left it out. Released for its own pick.

  4. added a commit that references this issue on Nov 27, 2026
  5. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    Release regroom (owner request, 2026-11-27): moved from v1.20.0 to v1.21.0. Stays with the packaging chain start; it has an open draft PR and blocks #784.

  6. added a commit that references this issue on Nov 28, 2026
    069c359
  7. pithead-developer commented on Nov 28, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #869.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementinfrasize:M

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions