[Solved] Build PX4 Firmware Without Using Git

Hello,

Is there any way to build the PX4 stack without using Git? This came up because I tried to move my code over to another computer via a flash drive and the code would not compile. I think it has something to do with the Git submodules being checked out on the other computer and not on the destination computer. I would prefer not to use Git if at all possible outside of the initial download.

Thanks,
Jon

Have you tried downloading the archive directly from GitHub (instead of git clone)?

That won’t grab the sub modules iirc.

Yes, that is correct. I ran into similar issues with the UAVCAN GUI where it required Git submodules to be initialized post-download. Is there no way to download the entire repository including all of the submodules?

Sorry to resurrect an old thread, but I thought I would share the solution that I found for my problem.

Unfortunately, the PX4 firmware stack will not compile without cloning from Git. The first line of code in the Makefile checks whether or not the code was sourced from Git and throws an error if it was not.

As I stated in my original post, I had tried copying the entire Firmware directory onto a flash drive or a network drive and then transferring that to my new computer, including the build directory. I’m not sure why, but for some reason that approach did not work. I don’t really know enough about the copying process to say why this did not work; I can only say that it didn’t.

However, I was able to get the code to compile by using SFTP to transfer each sub-directory one by one into a Firmware directory that I created on my new machine. I copied all of the subdirectories of Firmware EXCEPT “build” using get -r <folder name>. It is important to copy the “.git” folder(s) as well. I used get -r .git* to copy over all of the Git files.

After copying everything over in this manner, the code compiles fine. I hope this helps others that may have run into a similar problem.

Jon