Skip to content

fix(engine): avoid Bad substitution when building Telemt - #165

Closed
rmtshnik wants to merge 1 commit into
SamNet-dev:mainfrom
rmtshnik:codex/telemt-posix
Closed

rmtshnik wants to merge 1 commit into
SamNet-dev:mainfrom
rmtshnik:codex/telemt-posix

Conversation

@rmtshnik

@rmtshnik rmtshnik commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Telemt 3.5.16 (84e5b82) can fail before Cargo starts because both Dockerfiles use the Bash-only ${TELEMT_COMMIT:0:7} expansion in a RUN instruction executed by /bin/sh.

Use POSIX printf '%.7s' in the installer-generated Dockerfile and the engine build workflow. Update the engine image test to check the generated command.

Validation

  • Shell syntax checks and tests/test_engine_image.sh passed.
  • Both extracted RUN commands accepted short and full commit IDs and rejected a mismatched ID with mocked Git in Bash POSIX mode.
  • A full Docker build and direct dash execution were not run.

Related to #162. This PR addresses the source-build shell error described there.

SamNet-dev added a commit that referenced this pull request Nov 8, 2026
…roxy (#162, #165)

- Replace Bash-specific ${TELEMT_COMMIT:0:7} in Dockerfiles with POSIX printf '%.7s'`n  to avoid '/bin/sh: Bad substitution' errors under Debian dash during source builds (#162)
- Safeguard update and rebuild workflows so running proxy containers are never stopped
  or destroyed if image acquisition or compilation fails
- Clarify source build failure message to guide users to docker build logs
- Extend tests/test_engine_image.sh and add tests/test_engine_update_safeguard.sh

Co-authored-by: rmtshnik <iron-chaos-purging@duck.com>
@SamNet-dev

Copy link
Copy Markdown
Owner

Thank you @rmtshnik!

This has been resolved on main via commit 981bb80, which includes:

  • POSIX printf '%.7s' in both Dockerfiles and tests/test_engine_image.sh
  • Non-destructive update safeguards in self_update(), rebuild, engine rebuild, and the TUI menu to prevent stopping or tearing down running proxies if engine image acquisition or build fails
  • Accompanying regression test suite in tests/test_engine_update_safeguard.sh

@SamNet-dev SamNet-dev closed this Nov 8, 2026
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.

2 participants