Turris Omnia 4.0 SDK location

I’ve been looking for an SDK for the Turris Omnia 4.0

I’ve found several on https://repo.turris.cz/ but in the feeds.conf.default file, the first line is hard-coded to a local directory:

src-git base /home/beast/turris-build/git_mirror/openwrt

and other files (include/host-build.mk & include/package.mk) also have /home/beast hardcoded paths in them.
And the second line of feeds.conf.defauilt contains:

src-git turrispackages https://gitlab.labs.nic.cz/turris/turris-os-packages.git^origin/cleanup

which refers to a non-existant branch

Is there an SDK 4.0 available that can be used to compile packages?

What’s the correct repository/branch to use?

You probably downloaded some SDK that was build some times early during our development process toward TOS 4.0. We later disabled SDKs because of problems they have and because compared to TOS 3.x they are pretty much useless. SDK in TOS 4.0+ based on OpenWRT 18.06+ contain only toolchain but no libraries. This saves only small amount of work and in reality that is bough out by problems with feeds. If you use SDK from TOS 4.0+ then you are not possibly compiling against versions of packages that are in that build. You are compiling against latest versions in given branch.

Because of problems with OpenWRT SDK we instead introduced different approach. You have to pull following repository: https://gitlab.labs.nic.cz/turris/turris-build
This repository contains script compile_pkgs and that script can be run with target repo_prepare. This prepares OpenWRT tree with same commits as they were used on our build server so same version of all packages. You can use command compile_pkgs -t omnia repo_prepare compile_tools compile_target to get effectively SDK with precompiled toolchain.

Note that you have to checkout to specific branch in git repository to target specific release. You can read more about it in readme and in workflow document in linked repository.

To answer your question about correct repository/branch, we have few branches for TOS 4.0. We have HBK that contains periodic builds. Then we have HBT and HBS. Those are binary copies of HBK. When we decide to do a release we push it to HBT(esting) and later to HBS(table). Then we have HBD that contains future TOS 5.0 and also master (for far future TOS versions). It depends on what you are running on router. You always want to build your stuff against same packages versions.
Also note that releases in HBS are tagged in git and checking out that tag allows you to build that exact version. Tagged commit in such case contains fixed hashes in feeds.conf file so you don’t have to bother with repo_prepare and you can use just plain prepare target for compile_pkgs.