fix: use ~/.git-ai/tmp/ for install script instead of /tmp#644
Open
txf0096 wants to merge 1 commit intogit-ai-project:mainfrom
Open
fix: use ~/.git-ai/tmp/ for install script instead of /tmp#644txf0096 wants to merge 1 commit intogit-ai-project:mainfrom
txf0096 wants to merge 1 commit intogit-ai-project:mainfrom
Conversation
/tmp may be mounted noexec or have restricted write permissions on some systems, causing the background auto-upgrade to silently fail when writing the temporary install script. Use ~/.git-ai/tmp/ which git-ai already has guaranteed write access to. Fall back to std::env::temp_dir() if the home-based path is unavailable. Fixes git-ai-project#643
|
No AI authorship found for these commits. Please install git-ai to start tracking AI generated code in your commits. |
Member
|
Thank you for the contribution! Will make sure to test throughly soon and excited to merge this |
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.
Problem
The background auto-upgrade silently fails on systems where
/tmpis mounted withnoexecor has restricted write permissions (common in corporate/hardened environments).In
run_install_script(Unix path), the install script is written tostd::env::temp_dir()(typically/tmp) before execution. IfFile::createfails, the background process exits with code 1 — but since stdout/stderr are suppressed in the background worker, the user sees nothing and stays on the old version indefinitely.Closes #643
Fix
Use
~/.git-ai/tmp/(viaconfig::git_ai_dir_path()) as the temp dir for the install script. git-ai already has guaranteed write access to this directory (it stores config, internal state, etc. there). The directory is created if it doesn't exist. Falls back tostd::env::temp_dir()if the home path is unavailable.Changes
src/commands/upgrade.rs: replacestd::env::temp_dir()with~/.git-ai/tmp/for the Unix install script temp path