Skip to content

Make install-tools.sh --install Either Move an Unmanaged gh or Stop Saying It Does #2596

Description

@ptr727

Problem

host-setup/linux/install-tools.sh --install logs "gh: installed from the distro, moving it to cli.github.com" for a gh installed from the distribution while GitHub's repository is unconfigured. The move does not happen. gh_install writes the sources file and then calls apt_install gh. In install mode, apt_install skips any package that already has an installed version, so gh stays at the distribution's version until an --upgrade.

node is not affected, because apt_install_displacing installs regardless of mode.

Constructed Reproduction

Run apply_tool gh with the script's functions sourced and these host reads stubbed:

  • MODE=install
  • tool_configured returning 1 for gh
  • apt_installed_version printing 2.0.0-1

It logs the "moving it" line and never runs apt-get install.

Suggested Shape

Do one of the following:

  • Have --install install an unmanaged tool's package even when a distro copy is present, since configuring the repository is the move the log names.
  • Keep --install leaving the version alone and change the log line to say that --upgrade moves it.

The Linux README on feature/wsl-2299 (#2299) already describes the current --install behavior.

Raised by the pre-push review of feature/wsl-2299.

Activity

  1. added
    bug
    script
    on Oct 8, 2026
  2. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Decision needed (decision triage, 2026-11-01)

    Question: When gh came from the distro and the cli.github.com repository is not configured (status unmanaged), should host-setup/linux/install-tools.sh --install install gh from cli.github.com, or keep the installed version and change its "moving it to cli.github.com" log line to say --upgrade moves it?

    Options, recommended first:

    1. Keep the version, reword the log line (recommended): apt_install states the policy: install mode leaves an installed package at its version so an unrequested upgrade cannot ride along, and the outdated branch already logs "--upgrade moves it". The fix is a log line saying the repository is now configured and --upgrade moves gh, plus a test. No work in flight.
    2. Have --install move the unmanaged gh: Makes the existing log line true and matches node's apt_install_displacing, but carves a one-tool exception into the install/upgrade split and needs a separate install path for gh. No work in flight.

    Evidence: install-tools.sh:302-319 apt_install skips an installed package in install mode ("Installing leaves an installed package at its version"). gh_install (:501-518) writes the sources file then calls apt_install gh. :1349-1356 logs "--upgrade moves it", while the unmanaged branch (:1361-1363) logs "moving it to ...", which does not happen. tool_configured (:1019-1026) limits unmanaged to gh and node. Unchanged since filing (latest touch 75ba77d, #3650).

    Blocks: none

  3. added
    decision
    on Nov 1, 2026
  4. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (decision triage, 2026-11-01): Option 1: keep the installed version in --install mode, and change the unmanaged branch's log line to say the cli.github.com repository is now configured and --upgrade moves gh. Add a test. This is now work for the next burndown round.

  5. removed
    decision
    on Nov 1, 2026
  6. ptr727 commented on Nov 22, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-22): the branch merged as #4352 and was cleaned up, so this claim holds no files.

    Backlog burndown claim (round 4, group 7, 2026-11-22): branch burndown/r4-install-tools-defects, issues #4172, #4124, #2596.

    Predicted files: host-setup/linux/install-tools.sh, tests/test_install_tools.py, host-setup/linux/README.md.

    The stale branch feature/wsl-2299 also edits these files. The maintainer ruled on 2026-11-22 that its claim is released and that he deletes that branch himself, so this group does not wait on it.

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

    bugscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions