Skip to content

stack fails on Windows with git package in stack.yaml and no git binary on path #712

Closed
@conklech

Description

@conklech

On a Windows system with no git on the system/user %PATH% and a git repository package in stack.yaml, stack (sometimes?) completely fails within the project folder.

$ cat stack.yaml
[...]
- location:
    git: https://github.com/conklech/threepenny-gui.git
    commit: b426b55bc34704b66da35b256c3e7505b044b636
$ stack build
Executable named git not found on path: ["C:\\ProgramData\\Oracle\\Java\\javapath","C:\\Windows\\system32","C:\\Windows","C:\\Windows\\System32\\Wbem","C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\","C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common","%SystemRoot%\\system32","%SystemRoot%","%SystemRoot%\\System32\\Wbem","%SYSTEMROOT%\\System32\\WindowsPowerShell\\v1.0\\","C:\\Users\\chris\\AppData\\Roaming\\local\\bin"]
$ stack exec -- echo "nothing"
Executable named git not found on path: ["C:\\ProgramData\\Oracle\\Java\\javapath","C:\\Windows\\system32","C:\\Windows","C:\\Windows\\System32\\Wbem","C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\","C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common","%SystemRoot%\\system32","%SystemRoot%","%SystemRoot%\\System32\\Wbem","%SYSTEMROOT%\\System32\\WindowsPowerShell\\v1.0\\","C:\\Users\\chris\\AppData\\Roaming\\local\\bin"]
$ cd ..
$ stack exec -- where git
Run from outside a project, using implicit global config
Using resolver: lts-2.20 from global config file: C:\Users\chris\AppData\Roaming\stack\global\stack.yaml
C:\Users\chris\AppData\Local\Programs\stack\i386-windows\git-2.4.5.1\cmd\git.exe

This condition is fragile. After adding git.exe to the %PATH% and running stack build (which succeeds), and then opening a new shell with the original %PATH%, stack functions normally again, even after stack clean. I don't know what the exact preconditions for the buggy behavior are.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions