Cannot build Crazyflie firmware, error in versionTemplate.py

Post here to get support
Post Reply
leafj
Beginner
Posts: 1
Joined: Tue Jun 16, 2020 6:07 am

Cannot build Crazyflie firmware, error in versionTemplate.py

Post by leafj »

I'm trying to build the latest version of the Crazyflie 2.x firmware from Github. I'm building using the toolbelt on an Ubuntu 16.04 OS. For context, I had downloaded and built the firmware about a year ago, but hadn't updated anything on my machine in the meantime.

I ran:

Code: Select all

tb update
git clone --recursive https://github.com/bitcraze/crazyflie-firmware.git
cd crazyflie-firmware
tb make PLATFORM=cf2
Here's the output:

Code: Select all

(base) leafj@leafj-linux:~/crazyflie/crazyflie-firmware$ tb make PLATFORM=cf2
Running build script tools/build/make in a container based on the bitcraze/builder:23 docker image as uid 1000
make: Entering directory '/module'
  CLEAN_VERSION
  VTMPL version.c
fatal: not a git repository: /home/leafj/crazyflie/crazyflie-firmware/.git/modules/vendor/CMSIS
Traceback (most recent call last):
  File ".//tools/make/versionTemplate.py", line 124, in <module>
    extract_information_from_git(args.crazyflie_base)
  File ".//tools/make/versionTemplate.py", line 68, in extract_information_from_git
    ["git", "-C", base, "diff-index", "--name-only", "HEAD", "--"]).strip()
  File ".//tools/make/versionTemplate.py", line 22, in check_output
    result = subprocess.check_output(*args)
  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['git', '-C', './', 'diff-index', '--name-only', 'HEAD', '--']' returned non-zero exit status 128
make[1]: *** [tools/make/targets.mk:21: version.c] Error 1
make: *** [Makefile:365: build] Error 2
make: Leaving directory '/module'
Error: The call 'docker run --rm -u 1000 -v /var/run/docker.sock:/var/run/docker.sock -it -v /home/leafj/crazyflie/crazyflie-firmware:/module bitcraze/builder:23 tools/build/make PLATFORM=cf2' failed with error code 2

I then tried to run the offending git command from the error directly from the command-line, which was successful:

Code: Select all

(base) leafj@leafj-linux:~/crazyflie/crazyflie-firmware$ git -C ./ diff-index --name-only HEAD --
(base) leafj@leafj-linux:~/crazyflie/crazyflie-firmware$ python .//tools/make/versionTemplate.py --crazyflie-base ./ --print-version
Build 1:f741bfbd5208 (2020.06 +1) CLEAN
Version extracted from git
(base) leafj@leafj-linux:~/crazyflie/crazyflie-firmware$ python --version
Python 3.7.6
I also tried running git submodule init and git submodule update for good measure, which did not change the outcome.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Cannot build Crazyflie firmware, error in versionTemplate.py

Post by kristoffer »

Hi!

I don't know what the problem might be, but it looks like your repo is corrupt for some reason.
Have you tried to make another clone?

Since you are building with the toolbelt, the full build environment is contained in a docker container and should not have any other dependencies on your machine.

Another possible explanation could be that there is a version missmatch in git applications. The version script is using the git application that is bundled in the builder container, while you have cloned the repo using git on your machine. I have never seen this before, but maybe it is possible?

The version in the builder is 2.20.1

Code: Select all

Kristoffers-MBP:crazyflie-firmware kristoffer$ docker run --rm -it bitcraze/builder:23 git --version
git version 2.20.1
Post Reply