Comments (6)
This is intentionally being done by the provider right now:
# Git is installed to Program Files (x86) on 64-bit machines and
# 'Program Files' on 32-bit machines
PROGRAM_FILES = ENV['ProgramFiles(x86)'] || ENV['ProgramFiles']
GIT_PATH = "#{PROGRAM_FILES}\\Git\\Cmd".freeze
What should the path be?
Thanks for helping us debug this!
from git.
There is no single default location. This is determined by the git installer (and the bitness of the package).
If a 32-bit version is installed it’s placed in C:\Program Files (x86)\Git
If a 64-bit version is installed it’s placed in C:\Program Files\Git
Since there is not an easy way to determine the install location (that I’m aware of) under this scenario I have been brain storming and have some suggestions to bounce off you:
- Registry Based
Parse it out of the registry post install. It looks like this might be a possible place to extract it from:
Registry key: HKEY_CLASSES_ROOT\Directory\background\shell\git_shell\command
Value when 32-bit: "C:\Program Files (x86)\Git\git-bash.exe" "--cd=%v."
Value when 64-bit: "C:\Program Files\Git\git-bash.exe" "--cd=%v."
There could possibly be other registry keys that will work as well. Using a tool like Process Monitor https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx during install could provide a list.
- Filename Based: Parse the installer executable filename and attempt to determine the bitness
- Attribute Driven: Create an attribute ‘flag’ that designates bitness and enforces this artificially
With the advent of Windows Core & Nano and the effort to create 64-bit builds of the Chef client we ultimately need to have 64-bit support of the tools we use along-side Chef as well.
Thanks!
from git.
Here are the challenges.. MSI's don't always broadcast changes to path (when reboots are pending on the box for example). Also, not every top level program listens for changes to the path, which is why if we want to find git later in the course of the chef client run, we need to update the path as ruby sees it, so any ruby code or child shell outs will get it.
If the cookbook is picking the installer, it can know which path to put things on more easily. However, it shouldn't be too hard to figure out.. we could test program files x86 and program files and see where the git.exe landed, then put that on the path. I can work up a PR early next week most likely.
from git.
@smurawski any progress on this? :) Thanks!
from git.
@iennae @joshburt I just submitted a PR to add support for installing the 64 bit git client and finding the right path.
from git.
@joshburt Please check out cookbook version 4.4.1. Reopen if this doesn't solve the problem. Again thank you for submitting the original issue and sharing the underlying problems to improve my context with the issue. We really appreciate your help in making community cookbooks awesome!
from git.
Related Issues (20)
- undefined method `provides' for Chef::Provider::GitClient::Osx:Class
- Source recipe fails on subsequent converge if package based install used in between HOT 7
- Provide an option to also install man pages?
- Funky % parsing for attributes breaks basic Windows usage HOT 3
- package_version doesn't install the specified version HOT 2
- NoMethodError-> undefined method `set' for Chef::Platform:Class HOT 6
- References to default versions in README.md need to be modified HOT 1
- git 6.1.0 seems to be broken with latest chef client? HOT 4
- getting issue while installing git on a node from chefdk HOT 1
- Checkout modifies mtimes HOT 1
- not pulling the latest git version HOT 2
- No need to download sources if the installed version is same as expected version. HOT 2
- suggestion: Install from kernel.org and verify GPG signatures HOT 3
- cookbook requires 13.0+ instead of 12.7+ HOT 3
- STDERR: No provider of 'git=2.26.2-27.36.1' found. HOT 3
- MacOS need the option to overwrite the previously installed Git client
- wrong package name on smartos
- Windows PATH bug
- Dependency Dashboard
- ### :speaking_head
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git.