This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NCS No such file or directory: 'git'

Hello,

I have both an installation of NCS v1.5.0 from Toolchain Manager (TM) and from the Getting Started Assistant (GSA) on Macbook running macOS High Sierra. The TM SDK when building from the terminal is working fine but when I try to open a standard terminal and go to my GSA install I am getting an error "No such file or directory: 'git''. This error does not occur if I include the option to not use the Toolchain that was installed by the TM. Can someone help me understand why this is the case?

Build fails with west build -b nrf9160dk_nrf9160ns -p

Akashs-MacBook-Air:asset_tracker akash$ west build -b nrf9160dk_nrf9160ns -p
-- west build: making build dir /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build pristine
-- west build: generating a build system
Including boilerplate (Zephyr base): /Users/akash/Documents/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: /Users/akash/Documents/ncs/nrf/applications/asset_tracker
-- Using NCS Toolchain 1.5.0 for building. (/opt/nordic/ncs/v1.5.0/toolchain/cmake)
-- Zephyr version: 2.4.99 (/Users/akash/Documents/ncs/zephyr)
-- Found Python3: /opt/nordic/ncs/v1.5.0/toolchain/bin/python3 (found suitable exact version "3.8.2") found components: Interpreter 
-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")
CMake Error at /Users/akash/Documents/ncs/zephyr/cmake/zephyr_module.cmake:61 (message):
  Traceback (most recent call last):

    File "/Users/akash/Documents/ncs/zephyr/scripts/zephyr_module.py", line 378, in <module>
      main()
    File "/Users/akash/Documents/ncs/zephyr/scripts/zephyr_module.py", line 283, in main
      manifest = Manifest.from_file()
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 1084, in from_file
      return Manifest(**kwargs)
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 1273, in __init__
      self._load(source_data['manifest'],
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 1527, in _load
      self._load_projects(manifest, url_bases, defaults, ctx)
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 1859, in _load_projects
      self._import_from_project(project, imp, ctx)
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 2047, in _import_from_project
      self._import_path_from_project(project, imap.file,
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 2059, in _import_path_from_project
      imported = self._import_content_from_project(project, path)
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 2105, in _import_content_from_project
      project.is_cloned():
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 850, in is_cloned
      res = self.git('rev-parse --show-cdup', check=False, cwd=cwd,
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 747, in git
      popen = subprocess.Popen(
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 854, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1702, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)

  FileNotFoundError: [Errno 2] No such file or directory: 'git'

Call Stack (most recent call first):
  /Users/akash/Documents/ncs/zephyr/cmake/app/boilerplate.cmake:183 (include)
  /Users/akash/Documents/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /Users/akash/Documents/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:13 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake -DWEST_PYTHON=/usr/local/opt/[email protected]/bin/python3.9 -B/Users/akash/Documents/ncs/nrf/applications/asset_tracker/build -S/Users/akash/Documents/ncs/nrf/applications/asset_tracker -GNinja -DBOARD=nrf9160dk_nrf9160ns

Build succeeds with west build -b nrf9160dk_nrf9160ns -p -- -DNCS_TOOLCHAIN_VERSION=NONE

Akashs-MacBook-Air:asset_tracker akash$ west build -b nrf9160dk_nrf9160ns -p -- -DNCS_TOOLCHAIN_VERSION=NONE
-- west build: making build dir /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build pristine
-- west build: generating a build system
Including boilerplate (Zephyr base): /Users/akash/Documents/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: /Users/akash/Documents/ncs/nrf/applications/asset_tracker
-- Zephyr version: 2.4.99 (/Users/akash/Documents/ncs/zephyr)
-- Found Python3: /usr/local/bin/python3.9 (found suitable exact version "3.9.1") found components: Interpreter 
-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")
-- Board: nrf9160dk_nrf9160ns, Revision: 0.7.0
-- Cache files will be written to: /Users/akash/Library/Caches/zephyr
-- Found dtc: /usr/local/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/usr/local/opt/gnuarmemb)
-- Found BOARD.dts: /Users/akash/Documents/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns.dts
nrf9160dk_nrf9160ns.dts.pre.tmp:366.32-370.5: Warning (simple_bus_reg): /soc/cryptocell-sw: missing or empty reg/ranges property
nrf9160dk_nrf9160ns.dts.pre.tmp:59.42-71.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@40000000/kmu@39000)
nrf9160dk_nrf9160ns.dts.pre.tmp:311.19-317.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@40000000/power@5000)
-- Generated zephyr.dts: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/zephyr/include/generated/device_extern.h
Parsing /Users/akash/Documents/ncs/nrf/applications/asset_tracker/Kconfig
Loaded configuration '/Users/akash/Documents/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns_defconfig'
Merged configuration '/Users/akash/Documents/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns_0_7_0.conf'
Merged configuration '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/prj.conf'
Configuration saved to '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/zephyr/.config'
Kconfig header saved to '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/local/opt/gnuarmemb/bin/arm-none-eabi-gcc
Changed board to secure nrf9160dk_nrf9160 (NOT NS)

=== child image spm -  begin ===
Including boilerplate (Zephyr base): /Users/akash/Documents/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: /Users/akash/Documents/ncs/nrf/samples/spm
-- Zephyr version: 2.4.99 (/Users/akash/Documents/ncs/zephyr)
-- Found Python3: /usr/local/bin/python3.9 (found suitable exact version "3.9.1") found components: Interpreter 
-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")
-- Board: nrf9160dk_nrf9160, Revision: 0.7.0
-- Cache files will be written to: /Users/akash/Library/Caches/zephyr
-- Found dtc: /usr/local/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/usr/local/opt/gnuarmemb)
-- Found BOARD.dts: /Users/akash/Documents/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Found devicetree overlay: /Users/akash/Documents/ncs/nrf/samples/spm/nrf9160dk_nrf9160.overlay
nrf9160dk_nrf9160.dts.pre.tmp:59.42-71.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
nrf9160dk_nrf9160.dts.pre.tmp:311.19-317.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)
-- Generated zephyr.dts: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/spm/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/spm/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/spm/zephyr/include/generated/device_extern.h
Parsing /Users/akash/Documents/ncs/zephyr/Kconfig
Loaded configuration '/Users/akash/Documents/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
Merged configuration '/Users/akash/Documents/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_0_7_0.conf'
Merged configuration '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/child_image/spm/prj.conf'
Merged configuration '/Users/akash/Documents/ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/spm/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/spm/zephyr/.config'
Kconfig header saved to '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/spm/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/local/opt/gnuarmemb/bin/arm-none-eabi-gcc
CMake Deprecation Warning at /Users/akash/Documents/ncs/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/spm
=== child image spm -  end ===

Changed board to secure nrf9160dk_nrf9160 (NOT NS)

=== child image mcuboot -  begin ===
Including boilerplate (Zephyr base): /Users/akash/Documents/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: /Users/akash/Documents/ncs/bootloader/mcuboot/boot/zephyr
-- Zephyr version: 2.4.99 (/Users/akash/Documents/ncs/zephyr)
-- Found Python3: /usr/local/bin/python3.9 (found suitable exact version "3.9.1") found components: Interpreter 
-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")
-- Board: nrf9160dk_nrf9160, Revision: 0.7.0
-- Cache files will be written to: /Users/akash/Library/Caches/zephyr
-- Found dtc: /usr/local/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/usr/local/opt/gnuarmemb)
-- Found BOARD.dts: /Users/akash/Documents/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Found devicetree overlay: /Users/akash/Documents/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
nrf9160dk_nrf9160.dts.pre.tmp:59.42-71.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
nrf9160dk_nrf9160.dts.pre.tmp:311.19-317.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)
-- Generated zephyr.dts: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/mcuboot/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/mcuboot/zephyr/include/generated/device_extern.h
Parsing /Users/akash/Documents/ncs/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration '/Users/akash/Documents/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
Merged configuration '/Users/akash/Documents/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_0_7_0.conf'
Merged configuration '/Users/akash/Documents/ncs/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration '/Users/akash/Documents/ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/child_image/mcuboot.conf'
Configuration saved to '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/mcuboot/zephyr/.config'
Kconfig header saved to '/Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/mcuboot/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/local/opt/gnuarmemb/bin/arm-none-eabi-gcc
CMake Deprecation Warning at /Users/akash/Documents/ncs/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Warning at /Users/akash/Documents/ncs/zephyr/kernel/CMakeLists.txt:59 (message):
  Single threaded mode (CONFIG_MULTITHREADING=n) is deprecated


MCUBoot bootloader key file: /Users/akash/Documents/ncs/bootloader/mcuboot/root-rsa-2048.pem
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build/mcuboot
=== child image mcuboot -  end ===

CMake Warning at /Users/akash/Documents/ncs/nrf/modules/mcuboot/CMakeLists.txt:151 (message):
  

        ---------------------------------------------------------
        --- WARNING: Using default MCUBoot key, it should not ---
        --- be used for production.                           ---
        ---------------------------------------------------------
        



CMake Deprecation Warning at /Users/akash/Documents/ncs/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Warning at /Users/akash/Documents/ncs/zephyr/CMakeLists.txt:1357 (message):
  __ASSERT() statements are globally ENABLED


Dropping partition 'nrf_modem_lib_trace' since its size is 0.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/akash/Documents/ncs/nrf/applications/asset_tracker/build
-- west build: building application
[1/273] Preparing syscall dependency handling

[11/273] Performing build step for 'spm_subimage'
[1/201] Preparing syscall dependency handling

[196/201] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       32256 B        48 KB     65.62%
            SRAM:        8648 B        64 KB     13.20%
        IDT_LIST:          72 B         2 KB      3.52%
[201/201] Linking C executable zephyr/zephyr.elf
[17/273] Performing build step for 'mcuboot_subimage'
[1/258] Preparing syscall dependency handling

[253/258] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       38092 B        48 KB     77.50%
            SRAM:       24216 B     178968 B     13.53%
        IDT_LIST:          88 B         2 KB      4.30%
[258/258] Linking C executable zephyr/zephyr.elf
[263/273] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:      207320 B     409088 B     50.68%
            SRAM:       74560 B     178968 B     41.66%
        IDT_LIST:         152 B         2 KB      7.42%
[273/273] Generating zephyr/merged.hex

git and env

Akashs-MacBook-Air:asset_tracker akash$ git --version
git version 2.17.2 (Apple Git-113)
Akashs-MacBook-Air:asset_tracker akash$ env
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
NRFJPROG_LIBRARY_PATH=/Applications/nRF Connect.app/Contents/Frameworks/nrfjprog
TERM=xterm-256color
GNUARMEMB_TOOLCHAIN_PATH=/usr/local/opt/gnuarmemb/
TMPDIR=/var/folders/vw/q4pwtsvn5dx8_y5qdyp0jz880000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.EhxEsdEA5U/Render
TERM_PROGRAM_VERSION=404.1
TERM_SESSION_ID=4B4DFE7A-F4B6-4A1A-B6D7-35BD19B06B7E
USER=akash
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.s1YC0WbNzJ/Listeners
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
PWD=/Users/akash/Documents/ncs/nrf/applications/asset_tracker
LANG=en_US.UTF-8
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
HOME=/Users/akash
SHLVL=2
LOGNAME=akash
_=/usr/bin/env
OLDPWD=/Users/akash/Documents/ncs/nrf
Akashs-MacBook-Air:asset_tracker akash$ 

Regards,

Akash

Parents Reply Children
  • Hi Øyvind,

    Thanks. Just to be clear, this is an error that is occurring in my GSA installation when using the Toolchain from TM.

    Regards,

    Akash

  • Hi Akash, 

    Thanks for clarifying. I have not heard anything yet from the TM team.

    Looking at you build output, there seems to be an issue with Python versions:

    Python 3.8.2

     File "/opt/nordic/ncs/v1.5.0/toolchain/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/west/manifest.py", line 1084, in from_file
          return Manifest(**kwargs)

    Python 3.9

    FATAL ERROR: command exited with status 1: /usr/local/bin/cmake -DWEST_PYTHON=/usr/local/opt/[email protected]/bin/python3.9 -B/Users/akash/Documents/ncs/nrf/applications/asset_tracker/build -S/Users/akash/Documents/ncs/nrf/applications/asset_tracker -GNinja -DBOARD=nrf9160dk_nrf9160ns

    Can you please try to downgrade /usr/local/opt/python to 3.8?

    Kind regards,
    Øyvind

  • The TM team informs: 

    Sorry to inform, but High Sierra is not supported. The packages that the toolchain is built from are from Mojave, so none of the included tools are guaranteed to work.

    I also noticed that cmake is called from `/usr/local/bin` instead of `/opt/nordic/ncs/...` which points to incorrect environment. When using a toolchain from the toolchain manager, the Terminal must be invoked from the toolchain manager app in order to set correct PATHs.

Related