Building tele` and `gravity` binaries

I’ve been trying to get a build of Gravity from source, but am running into some difficulties. To be clear, the build itself works - it generates functional tele and gravity binaries. The problem is that if I do a tele build using the generated binary, it will still embed a “release” version of the gravity binary inside the tarball, as it seems to download it from s3://hub.gravitational.com (I can see it referenced in the download gravity.db and present in the blobs folder).

How can I create a tele binary that will use the custom gravity binary I built? To be specific, this binary fixes the port checking problem I referenced in the other topic I opened.

Sorry, we don’t have great docs around this. I believe you need to pass the --state-dir flag to tele to switch it from downloading the runtime from s3 to using the locally built packages.

See how we build the telekube base tar for reference:

Thanks @knisbet, that’s helpful. It begs the next question of how to build the packages target, since by default it doesn’t build out of the box:

[root@ip-10-1-10-68 gravity]# make packages
if [ -z "" ]; then \
 make planet-packages; \
else \
 make dev-planet-packages; \
fi;
make[1]: Entering directory `/home/ec2-user/work/gravity'
/home/ec2-user/work/gravity//build/5.5.7/gravity --state-dir=/var/lib/gravity/opscenter/read  package delete gravitational.io/planet:5.5.16-11305 --force --ops-url= && \
/home/ec2-user/work/gravity//build/5.5.7/gravity --state-dir=/var/lib/gravity/opscenter/read  package import /home/ec2-user/work/gravity//build/planet/5.5.16-11305/bin/planet.tar.gz gravitational.io/planet:5.5.16-11305 \
   --labels=purpose:runtime \
   --ops-url=
[ERROR]: path '/home/ec2-user/work/gravity//build/planet/5.5.16-11305/bin/planet.tar.gz' does not exist
make[1]: *** [planet-packages] Error 255
make[1]: Leaving directory `/home/ec2-user/work/gravity'
make: *** [packages] Error 2

I couldn’t see any target there to download/build the planet package.

I believe all dependencies should be built my make production. So when doing a test buid, we do make production telekube.