Skip to content

Release stamping clobbers PackageLoader's "@build.version@" sentinel — wheelsVersion constraint enforcement silently disabled on every released build #3178

Description

@bpamiri

Problem

vendor/wheels/PackageLoader.cfc ($normalizeWheelsVersion(), develop line ~1369) guards against unstamped dev builds with a literal comparison:

if (local.raw == "@build.version@" || local.raw == "0.0.0-dev") {
    return "0.0.0";
}

tools/build/scripts/prepare-core.sh sed-substitutes @build.version@ across every .cfc in the artifact, so the shipped 4.0.3 ForgeBox/release artifact contains:

if (local.raw == "4.0.3" || local.raw == "0.0.0-dev") {
    return "0.0.0";
}

(verified by extracting the published wheels-core 4.0.3 zip). On a released build the real runtime version is exactly 4.0.3, so it normalizes to 0.0.0 and $isCompatibleVersion() then takes the "unstamped dev build → skip enforcement" branch for every package. Net effect: wheelsVersion constraints in package.json manifests are never enforced on any released Wheels build — a package declaring "wheelsVersion": ">=5.0" loads silently on 4.0.3. (The comment line above the guard gets stamped too, which is cosmetic but confirms the blast radius.)

Fix

Use a sed-safe structural check instead of the literal placeholder, mirroring what BuildInfo.cfc already does (its detection is left(v, 7) == "@build." && right(v, 1) == "@" precisely so global stamping can't break it — see the regression-guard spec in tests/specs/buildInfoSpec.cfc). E.g.:

if ((Left(local.raw, 7) == "@build." && Right(local.raw, 1) == "@") || local.raw == "0.0.0-dev") {
    return "0.0.0";
}

Also worth a build-time sanity check in prepare-core.sh (like the existing BuildInfo commitSubject check) asserting PackageLoader.cfc does not contain a stamped self-version sentinel.

Affected artifacts: at minimum 4.0.0–4.0.3 releases (4.0.3 verified directly).

🤖 Generated with Claude Code

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions