Repository navigation
Description
Summary
The JCODE_BASE_SEMVER and JCODE_UPDATE_SEMVER environment variables are honored by the
build script, but the pre-release channel segment they carry is dropped by the release
installer. Jcode --version on a channel build (e.g. khostty-v0.1.0) reports the channel
correctly from a source build, but a binary produced by scripts/install_release.sh loses it.
Current state
The env-var precedence is implemented at crates/jcode-build-meta/build.rs:32-37:
JCODE_BASE_SEMVERoverrides the base versionJCODE_UPDATE_SEMVERoverrides the update version- The channel segment (e.g.
-channelin1.5.3-k0.1.2-channel) is preserved when set
The gap is in scripts/install_release.sh:73-83. The version-extraction regex is:
\(\w{9}\)$ # matches only the <git_hash> suffixIt matches <semver>(<hash>) but not <semver>-<channel>(<hash>), so the channel segment is
silently discarded during install. A build that passes --version locally fails to carry the
channel after install.
Reproduction
# 1. Build a channel-flagged binary (passes)
JCODE_BASE_SEMVER=1.5.3-k0.1.2-channel cargo build --release
./target/release/jcode --version
# → khostty-v0.1.0 (channel present)
# 2. Install the same build (channel lost)
./scripts/install_release.sh
jcode --version
# → version without channel segmentProposed fix
Split the single regex in scripts/install_release.sh:73-83 into two, or extend it to tolerate
an optional -<channel> segment before the hash:
# option A — single regex, channel optional
\([a-z0-9.-]*\)\(\w{9}\)$ # matches <semver>[-<channel>](<hash>)
# option B — two regexes (preferred: smaller, lower-risk diff)
version_re='\([0-9][^)]*\)$' # everything inside the parens
channel_re='-[a-z][a-z0-9]*' # optional channel segmentOption B is recommended: it is the less risky of the two and produces the smaller diff.
Scope
- In scope:
scripts/install_release.shregex, plus a regression test that asserts a
channel-flagged build survives install. - Out of scope: changes to
build.rsenv-var precedence (already correct), or to the
version format itself.
Acceptance criteria
- A binary built with
JCODE_BASE_SEMVER=<semver>-<channel>reports<semver>-<channel>
from--versionafterscripts/install_release.sh, not just before. -
scripts/install_release.shstill parses plain<semver>(<hash>)versions with no
channel (no regression). - A new test asserts the channel survives install. Suggested location alongside the
existing build-meta integration test added in this branch
(crates/jcode-build-meta/tests/). -
cargo fmtand the 3 budget gates stay green.
Effort
Estimated 1-2 hours. Needs write access to crates/jcode-build-meta and
scripts/install_release.sh.
Provenance
- Raised from
feature/upstream-0.88-syncat38af5e024(KooshaPari/KCode);
verification measurements taken at94db64687. - Detailed analysis:
docs/sessions/20260924-upstream-0.88-sync/05_KNOWN_ISSUES.md§1. - Design rationale:
04_IMPLEMENTATION_STRATEGY.md§2.3.
tx-task: #24
tx-scope: installer
tx-agent: jcode
Activity
[-]parse_semver_envvar[/-][+]parse_semver installer regex ignores the JCODE_UPDATE_SEMVER env var (channel segment lost)[/+]docs(closure): append post-push verification to issue-closure dossier
fix(build-meta): preserve channel segment in build-time and runtime v…