tailscale / tailscale/tailscale

Document how to reproduce our binaries

Open
#779 4 comments 0 reactions 0 assignees View on GitHub
L2 Few P1 Nuisance packaging T4 Docs
Dominant language
Go
Stars
36.5k
Forks
3.2k
Avg merge
2d 3h
Merged PRs (30d)
123

Description

(Forking off @Foxboron's request at https://github.com/tailscale/tailscale/issues/81#issuecomment-690361781 for instructions on how to reproduce our official Linux binaries)

* we set the `tailscale_go` build tag
* we use the https://github.com/tailscale/go repo built from its CI: https://github.com/tailscale/go/releases (the exact version of Go is printed when tailscaled starts)
* the version file that's auto-generated by our redo-based build system is:

```
$ cat ver.go
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build redo

package version

const LONG = "1.1.425-g3f107922c"
const SHORT = "1.1.425"
```

* Go is run like:

```
redo out/x86_64-linux/oss/cmd/tailscale/tailscale (resumed)
#!/bin/sh -e
# Per-platform settings for the go compiler.
# Auto-generated by go.od. Do not edit!
S='/home/bradfitz/src/tailscale.io'
export GO='/home/bradfitz/.cache/tailscale-go/bin/go'
export CC='cc'
export CFLAGS=''
export GO_LDFLAGS='-extldflags ""'
export GOOS=''
export GOARCH=''
export GOARM=''
export CGO_ENABLED='0'

# Necessary because CI forces GOROOT and we need
# to override it back.
export GOROOT=
redo (../../../../../oss/version/all)
redo (../../../../../oss/version/version.h)
redo oss/version/describe.txt
redo oss/version/describe.txt (done)

redo out/x86_64-linux/oss/cmd/tailscale/tailscale (done)

....

'$GO' build \\
-v -trimpath -tags=redo,tailscale_go \\
-ldflags "\$GO_LDFLAGS" \\
-o "\$t" \\
"\$pkg"
```

To close this issue we should:

1) make sure this is reproducible
2) document it somewhere

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.