nRF Connect Toolchain Installation fails silently because of local .gitconfig

Reproduce issue:

  • Windows 10 21H2
  • Set global git option gpg.format to ssh
    • git config --global gpg.format ssh
  • Install nRF Connect SDK v2.0.2 with Toolchain Manager v1.1.3

This seems to complete successfully as implied by the Toolchain Managers log at the bottom:

But starting a build failes with

west: error: argument <command>: invalid choice: 'build' (choose from 'init', 'update', 'list', 'manifest', 'diff', 'status', 'forall', 'help', 'config', 'topdir', 'selfupdate')

Looking at C:\ncs\v2.0.2 shows there are folders missing:

Reason for issue:

The option ssh for the git config gpg.format was introduced in git 2.34 (Compare https://git-scm.com/docs/git-config/2.33.0 and https://git-scm.com/docs/git-config/2.34.0).

The Toolchain Manager seems to use an old git version (bash/cmd show 2.26). Calling 'git show' with gpg.format set to ssh fails with

$ git show
error: unsupported value for gpg.format: ssh
fatal: bad config variable 'gpg.format' in file 'C:/Users/N/.gitconfig' at line 10

Opening the log file of the Toolchain Manager shows this error causes the installation to fail:

2022-09-09T13:03:34.684Z DEBUG west.manifest: "git show refs/heads/manifest-rev:west.yml" exit code: 128 stdout: b'' stderr: b"error: unsupported value for gpg.format: ssh\nfatal: bad config variable 'gpg.format' in file 'C:/Users/N/.gitconfig' at line 10\n"

Additional Notes

Adding this option to my global git config destroyed my toolchain even without launching nRF Connect for Desktop or the Toolchain Manager. I use VSCode for development. Perhaps the VSCode Plugins update the toolchain in the bachground which can also destroy them?

Questions / Requests

  • How can I keep this git config value without destroying the toolchain?
  • Please show a clear message in the Toolchain Manager if the installation fails. Without opening the log file (the small grey button at the bottom left), everything seems fine, but the toolchain is not working.
  • If possible, please ignore the global git config when installing the toolchain.

Thank you!

Related topic

Parents Reply Children
  • This seems like a solution, but Nordic has to use this option in the Toolchain Manager, not me. git in the Toolchain installer is failing, the git on my system is fine.

    Edit:
    besides GIT_CONFIG_NOSYSTEM you should also set  GIT_CONFIG_GLOBAL in the Toolchain Installer. You are shipping your own git (which is fine), but you should also ship your own config, which can be ensured with these variables. 

  • Hi,

    This option is only given to you to try out for your particular environment. 
    It is not desirable to have this option in the Toolchain Manager for all users as there could be global settings that users may want to apply to every git instance.

    Best regards,
    Dejan

  • I think we are talking past each other here, I try to explain my point.

    This thread is not a question, it is a bug report.
    I do not need help, I have a workaround, but it affects other work on my system until it is fixed.

    The original post is a description of the reason and a manual to reproduce. This was meant for the developers of Toolchain Manger to quickly identify the bug.

    The problem is, that Toolchain Manager failes if a global git config is set on my system, which I need for my other work. So ignoring the global config file in my environment is not what I can do, as I need this config value.
    Toolchain Manager has to ignore my global config in its environment, as Toolchain Manager fails when this option is set, which I need on my system. Toolchain Manager should ship its own config, as it does already with the git binary.
    Toolchain Manager currently fails because of a file (.gitconfig) on my system, which has nothing to do with Toolchain Manager and is needed for my work.

    The only workaround I know at this time is to remove this global config value (or ignore it), which makes Toolchain Manager work again, but my other work is now missing this config value.

    The second problem is that Toolchain Manager fails silently, and even worse, show success although it failed with the installation.

  • Hi,

    I have made internal inquiry. I expect to be able to provide more information at the end of this week or during next week.

    Best regards,
    Dejan

  • Hi,

    We are planning for our new bundler to provide any git version as specified in NCS requirement files.

    Meanwhile, you could try replacing the git from the toolchain with a newer version which supports your config (for example, v2.34). You would need to copy git binary as well as its subcommands. In theory, this should work fine. 

    Best regards,
    Dejan

Related