[enhancement]: Warning / Info if git is missing
No existing issues.
- [X] There is no existing issue for my request.
Description
Adapters need 'git' to be installed if any dependendy points directly to github. 'git' is installed per default on most (all?) Linux systems but is not installed on windows systems. This results in an error message like:
iobroker npm error code ENOENTnpm error syscall spawn gitnpm error path gitnpm error errno -4058npm error enoent An unknown git error occurrednpm error enoent This is related to npm not being able to find a file.npm error enoentnpm error A complete log of this run can be found in: C:\Windows\system32\config\systemprofile\AppData\Local\npm-cache\_logs\2024-06-02T14_06_49_122Z-debug-0.log
This message is not veryintutive for users.
So I would suggest to output an info or warning before the installation startes (or afterwards if it fails) if git is not installed at the system indicating to perfomr an installation of git.
Why?
Help users to understand whats going wrong and to reduce calls at forum :-)
How?
No response
I think modern windows installer installs Git or @Gaspode69?
No. We decided to not install additional software in the GUI Installer.
That has been discussed. But the discussion soon extended to problem to get correct git release (ie 32 bit windows) and that python should be installed to ....
Linux installer installs git and somore more packages as far as I know, not sure if we should maybe restart this discussion or were there good reasons to not do this? @Apollon77
Ok, just checkd an osmc pi installation. git is not installed. Looks like ioBroker installer really installes git. If this is verified, I would suggest to restart the discussion whether to install on windows too.
What other layered products are installed at linux by the ioBroker installer. Maybe we should check this list...
or were there good reasons to not do this
The main reason was that the installer should not get too complex. In the case of GIT, this might still sound manageable, but with Python, it becomes more difficult because, to my knowledge, different adapters require different versions. And with VSS or MS Build Tools, fine-tuning the settings may be necessary.
Ok, the linux installer installs the following packages:
"acl" # To use setfacl
"sudo" # To use sudo (obviously)
"libcap2-bin" # To give nodejs access to protected ports
# These are used by a couple of adapters and should therefore exist:
"build-essential"
"gcc"
"make"
"libavahi-compat-libdnssd-dev"
"libudev-dev"
"libpam0g-dev"
"pkg-config"
"git"
"curl"
"unzip"
# These are required for canvas
"libcairo2-dev"
"libpango1.0-dev"
"libjpeg-dev"
"libgif-dev"
"librsvg2-dev"
"libpixman-1-dev"
"net-tools" # To fix issue #277
"cmake" # https://github.com/ioBroker/ioBroker.js-controller/issues/1604
´´´
As far as I see git and unzip are the only one missing on windows used in a general way. python can be excluded from the discussion as it is notinstalled at linux either. The complete gcc development environment would be far to complicated to install at windows. git should be ruther easy. If unzip is available - I dod not check for now.
So mayb this list could be a base to restrict follow up discusssions and to exclude python (as an example).
gcc is likely to be less helpfull anyway as the code to be compiled must be prepared for windows in most cases - and I doubt that this will be the case if an adapter requires something wich need building at installation.
Contrary to Node.js, it seems to be OK to install the latest GIT package, so I guess there is no need to include this in the GUI part of the installer. I'd suggest including it in the script part using winget: winget install --id Git.Git -e --source winget --silent --force
The advantage would be that even a manual installation would include GIT. However, I am a bit uneasy about introducing a potential source of errors that will likely only help 5% of all users.
Basically as long as we have the install from Git option in admin and CLI, ioBroker assumes that git is installed so I would go for that. If you like to create a PR for windows installer @Gaspode69 that would be great, @Apollon77 and I can also have a look then.
Basically as long as we have the install from Git option in admin and CLI, ioBroker assumes that git is installed so I would go for that
OK, good point. Up to now I thought that only adapters are concerned, which have direct GIT references. But GIT installation using the Admin also works only if GIT is installed.
If you like to create a PR for windows installer @Gaspode69 that would be great
~~Sure, but it might take some time.~~
Earlier than I thought. ;-) https://github.com/ioBroker/ioBroker/pull/527
I suggest to publish it under npm dist-tag @next first to be able to test in detail (if the change is accepted of course).
Thanks to all of you for thinking aboiut this extensiom. Let me know when it makes sense to test. My windows ioBroker kann be deinstalled as often as my ssd allows :-)
ioBroker installation script published on 2024-AUG-10 now installs also git during ioBroker installation. Also the fixer installs git resp. updates it to the most current version. @mcm1957 Please verify and close issue if successful