Skip to content

build: customizable install PREFIX#11706

Closed
scarf005 wants to merge 1 commit intocli:trunkfrom
scarf005:build/customize-prefix
Closed

build: customizable install PREFIX#11706
scarf005 wants to merge 1 commit intocli:trunkfrom
scarf005:build/customize-prefix

Conversation

@scarf005
Copy link
Contributor

@scarf005 scarf005 commented Sep 10, 2025

Summary

Allows overriding install PREFIX.

PREFIX=~/.local/share make install

# gh is installed in ~/.local/share
/bin/ls -al ~/.local/share/bin/gh
-rwxr-xr-x. 1 scarf scarf 78800383 Sep 11 01:24 /home/scarf/.local/share/bin/gh

Rationale

currently github CLI can only be installed on /usr/local which is too inflexible and requires sudo permission when building and installing locally, when it shouldn't really.

This makes installing github cli easier in restricted environment, such as inside distrobox.
Copilot AI review requested due to automatic review settings September 10, 2025 16:29
@scarf005 scarf005 requested a review from a team as a code owner September 10, 2025 16:29
@scarf005 scarf005 requested a review from babakks September 10, 2025 16:29
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Sep 10, 2025
@cliAutomation
Copy link
Collaborator

Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR makes the installation prefix customizable by replacing the hardcoded /usr/local prefix with a configurable PREFIX variable. This allows users to install the GitHub CLI to alternative locations, particularly useful in restricted environments like distrobox.

  • Replaces hardcoded prefix variable with configurable PREFIX variable
  • Uses make's ?= operator to allow overriding the default value

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@BagToad
Copy link
Member

BagToad commented Sep 10, 2025

👋 Hi @scarf005 - thank you for improving the GitHub CLI ❤️ ✨

Could you please open an issue for this and provide some more information why this improves things? Doing so would align with our contribution guidelines.

I'll close this PR out in the meantime. Thank you again for your efforts!

@BagToad BagToad closed this Sep 10, 2025
@scarf005
Copy link
Contributor Author

scarf005 commented Sep 10, 2025

@BagToad hi, i've read https://github.com/cli/cli/blob/6b19a854710ff2c81070f109f35434cd20e40115/.github/CONTRIBUTING.md and looks like none of the criteria for opening an issue matches.

  • Open an issue if things aren't working as expected (technically not)
  • Open an issue to propose a significant change (which isn't)
  • Open an issue to propose a design (it isn't)
  • Open an issue to propose a new community supported gh package with details about support and redistribution (which also isn't).

I've updated the PR body to better describe what and whys of the PR.

@BagToad
Copy link
Member

BagToad commented Sep 10, 2025

@scarf005, the key point from our guidelines is:

We accept pull requests for bug fixes and features where we’ve discussed the approach in an issue and given the go-ahead for a community member to work on it.

While exceptions can be made for small things like typos, I don't consider changes to our build process small in impact or risk, even if the change itself is small. I checked with the rest of the maintainers, and we all would appreciate if you could open an issue for this so we can discuss the approach more before accepting the work 🙏 As a brief example, we're not sure if this PREFIX is a convention, or if there are other options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants