Skip to content

Fix tar error in Git Bash on Windows - #61

Merged
ai merged 1 commit into
ai:mainfrom
ymandrikov:ym/fix/issue-53-tar-windows
Jul 18, 2026
Merged

ai merged 1 commit into
ai:mainfrom
ymandrikov:ym/fix/issue-53-tar-windows

Conversation

@ymandrikov

Copy link
Copy Markdown
Contributor

On Windows with Git Bash multiocular crashes when it unpacks a package

tar (child): Cannot connect to C: resolve failed

Fix is to run tar inside the temporary directory and pass the archive as a relative path (package.tgz). This way tar arguments contain no absolute paths. Also use execFile instead of exec, so there is no shell and no quoting issues.

Other options I checked:

  • --force-local flag: only GNU tar has it, breaks BSD tar on macOS.
  • extract tarball in JavaScript: works, but adds a lot of code to maintain.

More at #53

Fixes #53

GNU tar in Git Bash treats C:\... archive path as remote host and
fails with "Cannot connect to C: resolve failed". Run tar via
execFile inside the temporary directory so no absolute path reaches
tar arguments.

Also remove the temporary directory when extraction fails, so failed
downloads do not accumulate orphaned directories in tmpdir.

Fixes ai#53
@ai
ai merged commit 0cf3bd0 into ai:main Jul 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot be launched from git bash for Windows because tar isn't working properly

2 participants