Build the launcher from source
Build the launcher yourself when your platform has no release archive, or to try a change to the launcher or its recipes. The launcher is plain Go with one dependency, and builds into a static binary.
What you need
Section titled “What you need”- Go 1.23 or newer.
git, to build from a checkout.
Install with go install
Section titled “Install with go install”go install github.com/iammrduncan/tensorless/cmd/tensorless@v0.1.0Go puts the binary in $(go env GOPATH)/bin, or in $GOBIN if you set it. @latest installs the newest release, and @main the newest commit of main.
A binary built this way has no version stamped in:
tensorless versiontensorless dev, linux/amd64Build from a checkout
Section titled “Build from a checkout”-
Get the source:
Terminal window git clone https://github.com/iammrduncan/tensorlesscd tensorless -
Build it, with the version and commit stamped in:
Terminal window go build -ldflags "-X main.version=$(git describe --tags --always --match 'v*') -X main.commit=$(git rev-parse --short HEAD)" ./cmd/tensorless--match 'v*'names the launcher’s own tags (v0.1.0). The repository also has engine tags (engine-v0.1.0), whichgit describewould otherwise pick. -
Check it:
Terminal window ./tensorless versionAt the tag
v0.1.0this printstensorless v0.1.0 (commitand the short commit. After the tag,git describeadds the number of commits since it, such asv0.1.0-3-g147bf17.
To build the way the release does, static and with the full commit, for any platform Go supports:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath \ -ldflags "-s -w -X main.version=0.1.0 -X main.commit=$(git rev-parse HEAD)" \ -o tensorless ./cmd/tensorlessRecipes are built in
Section titled “Recipes are built in”The launcher embeds the recipes/ directory when it is built (recipes_embed.go). A recipe you add or change in your checkout is part of the binary you build next.
To try recipes without rebuilding, point the launcher at a directory with --recipes DIR. See Try a recipe of your own.
Run the checks
Section titled “Run the checks”The project’s CI runs these on every change. Run them before you send a pull request:
gofmt -l cmd internal *.gogo vet ./...go test ./...gofmt -l prints nothing when every file is formatted.
How to tell it worked
Section titled “How to tell it worked”./tensorless version prints your version and commit, and ./tensorless models lists the recipes from your checkout’s recipes/ directory.