Skip to content

Python devcontainer snippet: mount path join and mktemp -t portability #1763

Closed

Description

@ptr727

Copilot raised two portability points against catalog/snippets/devcontainer/python/ when it was carried verbatim into ptr727/ESPHome-Config#177. Both were declined there because the fix belongs in the canonical snippet.

  • devcontainer.json mounts: each source joins ${localEnv:HOME}${localEnv:USERPROFILE}. On a Windows host where both are set, for example VS Code launched from Git Bash, the result is an invalid path such as C:\Users\x/c/Users/x/.ssh/..., and the container fails to start.
  • post-create.sh: mktemp -t uv-install.XXXXXX.sh relies on implicit temp-dir selection, and -t behaves differently across mktemp implementations. An explicit template such as "${TMPDIR:-/tmp}/uv-install.XXXXXX.sh" avoids that. It is low risk, since the script only runs inside the Linux container.

The same mount pattern probably appears in the other devcontainer snippets too.

Activity

  1. ptr727 commented on Sep 24, 2026

    @ptr727
    OwnerAuthor

    CodeRabbit raised a third point on the same snippet in ptr727/ESPHome-Config#177:

    • The three bind mounts (~/.ssh/id_ed25519.pub, ~/.config/git/allowed_signers, ~/.config/gh) are required. On a host missing any of them, Docker rejects the mount before onCreateCommand runs, and the container does not start. Make them optional, or document the host paths the container expects.
  2. ptr727 commented on Sep 24, 2026

    @ptr727
    OwnerAuthor

    A third case on the same devcontainer.json mounts, raised by CodeRabbit on ptr727/ESPHome-Config#178: a bind mount fails when its source does not exist on the host, so a contributor with no ~/.ssh/id_ed25519.pub, no ~/.config/git/allowed_signers, or no ~/.config/gh cannot start the container at all.

    Options are to drop the mounts from the default snippet, move them to an opt-in config, or document the host prerequisites beside the snippet.

  3. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Decision triage split the undecided item out of this issue into #3754, which carries the decision label. Everything else here stays as ordinary work an agent can do without the maintainer.

  4. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer to the split decision #3754 (decision triage, 2026-11-01): Option 1: document the three host bind mounts as prerequisites, with a JSONC comment beside mounts in each devcontainer snippet naming the required host paths.

  5. ptr727 commented on Nov 3, 2026

    @ptr727
    OwnerAuthor

    Narrowed: the HOME and USERPROFILE mount join is split into #3852, since only a Windows host can verify it. This issue keeps the mktemp -t template and the host-path comment chosen in #3754, neither of which needs a Windows host.

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