fix: prepend brew bin when sourcing completions to prevent spurious errors on terminal open#22
Open
hanthor wants to merge 1 commit into
Open
fix: prepend brew bin when sourcing completions to prevent spurious errors on terminal open#22hanthor wants to merge 1 commit into
hanthor wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate spurious stderr output at shell startup caused by Homebrew-provided bash completion scripts invoking their own binaries (by name) when system PATH precedence resolves to an incompatible system-installed version.
Changes:
- Temporarily prepends Homebrew
bin/sbintoPATHwhile sourcing bash completion scripts, then restores the originalPATH. - Introduces a
BREW_VERSIONfile and uses it in the build workflow to add an image tag matching the version. - Updates Renovate configuration to track updates to
BREW_VERSIONfromHomebrew/brewGitHub releases.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| system_files/etc/profile.d/brew-bash-completion.sh | Temporarily adjusts PATH during completion sourcing to avoid invoking incompatible system binaries. |
| BREW_VERSION | Adds a single-source version value intended for CI tagging (and Renovate updates). |
| .github/workflows/build.yml | Reads BREW_VERSION and adds it as a docker/metadata-action tag. |
| .github/renovate.json5 | Switches regex manager to update BREW_VERSION based on Homebrew/brew releases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+148
to
+151
| - name: Read Brew Version | ||
| id: brew_version | ||
| run: echo "version=$(cat BREW_VERSION)" >> $GITHUB_OUTPUT | ||
|
|
|
|
||
| - name: Read Brew Version | ||
| id: brew_version | ||
| run: echo "version=$(cat BREW_VERSION)" >> $GITHUB_OUTPUT |
Comment on lines
+9
to
15
| "fileMatch": ["^BREW_VERSION$"], | ||
| "matchStrings": [ | ||
| "https://github\\.com/ublue-os/artwork/releases/download/bluefin-v(?<version>[0-9\\-]+)/bluefin-wallpapers\\.tar\\.zstd" | ||
| "^(?<currentValue>.*)" | ||
| ], | ||
| "datasourceTemplate": "github-releases", | ||
| "depNameTemplate": "ublue-os/artwork" | ||
| "depNameTemplate": "Homebrew/brew" | ||
| } |
| @@ -0,0 +1 @@ | |||
| 5.0.8 | |||
…rrors Brew completion scripts (e.g. just's `eval "$(JUST_COMPLETE=bash just)"`) invoke their own binary by name. Because this script appends brew's bin after system bin in PATH (to protect system binaries), a system-installed version of the same tool is found first. If that system version does not support the same flags as the brew version, it prints errors to stderr on every new terminal open (e.g. `error: No justfile found` from just). Temporarily prepend brew's bin/sbin while sourcing the completion files so that these scripts call the correct brew binary, then restore the original PATH afterwards. The user's runtime PATH is unchanged after setup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26bd03a to
5a45232
Compare
Member
|
I think you are hitting casey/just#3188 here |
Author
|
Its actually a bit dangerous if you open a new terminal in a drop with a justfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brew completion scripts (e.g.
just'seval "$(JUST_COMPLETE=bash just)") invoke their own binary by name. Since brew bin is appended after system bin in PATH, a system-installed version is found first. If it doesn't support the same flags, it spews errors on every terminal open (error: No justfile foundfrom/usr/bin/juston Bluefin).Fix: temporarily prepend brew bin while sourcing completions, restore PATH after.