tstest/integration: generate deps for all platforms in deps generator

We have different deps depending on the platform.
If we pick a privileged platform, we'll miss some deps.
If we use the union of all platforms, the integration test
won't compile on some platforms, because it'll import
packages that don't compile on that platform.

Give in to the madness and give each platform its own deps file.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
pull/2460/head
Josh Bleecher Snyder 3 years ago committed by Josh Bleecher Snyder
parent 41d06bdf86
commit 4b1f2ae382

@ -12,16 +12,25 @@ import (
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
)
func main() {
for _, goos := range []string{"windows", "linux", "darwin", "freebsd", "openbsd"} {
generate(goos)
}
}
func generate(goos string) {
var x struct {
Imports []string
}
j, err := exec.Command("go", "list", "-json", "tailscale.com/cmd/tailscaled").Output()
cmd := exec.Command("go", "list", "-json", "tailscale.com/cmd/tailscaled")
cmd.Env = append(os.Environ(), "GOOS="+goos, "GOARCH=amd64")
j, err := cmd.Output()
if err != nil {
log.Fatal(err)
log.Fatalf("GOOS=%s GOARCH=amd64 %s: %v", goos, cmd, err)
}
if err := json.Unmarshal(j, &x); err != nil {
log.Fatal(err)
@ -46,7 +55,8 @@ import (
}
fmt.Fprintf(&out, ")\n")
err = ioutil.WriteFile("tailscaled_deps_test.go", out.Bytes(), 0644)
filename := fmt.Sprintf("tailscaled_deps_test_%s.go", goos)
err = ioutil.WriteFile(filename, out.Bytes(), 0644)
if err != nil {
log.Fatal(err)
}

@ -0,0 +1,60 @@
// Copyright (c) 2021 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.
// Code generated by gen_deps.go; DO NOT EDIT.
package integration
import (
// And depend on a bunch of tailscaled innards, for Go's test caching.
// Otherwise cmd/go never sees that we depend on these packages'
// transitive deps when we run "go install tailscaled" in a child
// process and can cache a prior success when a dependency changes.
_ "context"
_ "crypto/tls"
_ "encoding/json"
_ "errors"
_ "flag"
_ "fmt"
_ "github.com/go-multierror/multierror"
_ "io"
_ "io/ioutil"
_ "log"
_ "net"
_ "net/http"
_ "net/http/httptrace"
_ "net/http/pprof"
_ "net/url"
_ "os"
_ "os/exec"
_ "os/signal"
_ "path/filepath"
_ "runtime"
_ "runtime/debug"
_ "strconv"
_ "strings"
_ "syscall"
_ "tailscale.com/derp/derphttp"
_ "tailscale.com/ipn"
_ "tailscale.com/ipn/ipnserver"
_ "tailscale.com/logpolicy"
_ "tailscale.com/net/dns"
_ "tailscale.com/net/interfaces"
_ "tailscale.com/net/socks5/tssocks"
_ "tailscale.com/net/tshttpproxy"
_ "tailscale.com/net/tstun"
_ "tailscale.com/paths"
_ "tailscale.com/tailcfg"
_ "tailscale.com/types/flagtype"
_ "tailscale.com/types/key"
_ "tailscale.com/types/logger"
_ "tailscale.com/util/osshare"
_ "tailscale.com/version"
_ "tailscale.com/version/distro"
_ "tailscale.com/wgengine"
_ "tailscale.com/wgengine/monitor"
_ "tailscale.com/wgengine/netstack"
_ "tailscale.com/wgengine/router"
_ "time"
)

@ -0,0 +1,58 @@
// Copyright (c) 2021 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.
// Code generated by gen_deps.go; DO NOT EDIT.
package integration
import (
// And depend on a bunch of tailscaled innards, for Go's test caching.
// Otherwise cmd/go never sees that we depend on these packages'
// transitive deps when we run "go install tailscaled" in a child
// process and can cache a prior success when a dependency changes.
_ "context"
_ "crypto/tls"
_ "encoding/json"
_ "errors"
_ "flag"
_ "fmt"
_ "github.com/go-multierror/multierror"
_ "io"
_ "io/ioutil"
_ "log"
_ "net"
_ "net/http"
_ "net/http/httptrace"
_ "net/http/pprof"
_ "net/url"
_ "os"
_ "os/signal"
_ "runtime"
_ "runtime/debug"
_ "strconv"
_ "strings"
_ "syscall"
_ "tailscale.com/derp/derphttp"
_ "tailscale.com/ipn"
_ "tailscale.com/ipn/ipnserver"
_ "tailscale.com/logpolicy"
_ "tailscale.com/net/dns"
_ "tailscale.com/net/interfaces"
_ "tailscale.com/net/socks5/tssocks"
_ "tailscale.com/net/tshttpproxy"
_ "tailscale.com/net/tstun"
_ "tailscale.com/paths"
_ "tailscale.com/tailcfg"
_ "tailscale.com/types/flagtype"
_ "tailscale.com/types/key"
_ "tailscale.com/types/logger"
_ "tailscale.com/util/osshare"
_ "tailscale.com/version"
_ "tailscale.com/version/distro"
_ "tailscale.com/wgengine"
_ "tailscale.com/wgengine/monitor"
_ "tailscale.com/wgengine/netstack"
_ "tailscale.com/wgengine/router"
_ "time"
)

@ -0,0 +1,58 @@
// Copyright (c) 2021 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.
// Code generated by gen_deps.go; DO NOT EDIT.
package integration
import (
// And depend on a bunch of tailscaled innards, for Go's test caching.
// Otherwise cmd/go never sees that we depend on these packages'
// transitive deps when we run "go install tailscaled" in a child
// process and can cache a prior success when a dependency changes.
_ "context"
_ "crypto/tls"
_ "encoding/json"
_ "errors"
_ "flag"
_ "fmt"
_ "github.com/go-multierror/multierror"
_ "io"
_ "io/ioutil"
_ "log"
_ "net"
_ "net/http"
_ "net/http/httptrace"
_ "net/http/pprof"
_ "net/url"
_ "os"
_ "os/signal"
_ "runtime"
_ "runtime/debug"
_ "strconv"
_ "strings"
_ "syscall"
_ "tailscale.com/derp/derphttp"
_ "tailscale.com/ipn"
_ "tailscale.com/ipn/ipnserver"
_ "tailscale.com/logpolicy"
_ "tailscale.com/net/dns"
_ "tailscale.com/net/interfaces"
_ "tailscale.com/net/socks5/tssocks"
_ "tailscale.com/net/tshttpproxy"
_ "tailscale.com/net/tstun"
_ "tailscale.com/paths"
_ "tailscale.com/tailcfg"
_ "tailscale.com/types/flagtype"
_ "tailscale.com/types/key"
_ "tailscale.com/types/logger"
_ "tailscale.com/util/osshare"
_ "tailscale.com/version"
_ "tailscale.com/version/distro"
_ "tailscale.com/wgengine"
_ "tailscale.com/wgengine/monitor"
_ "tailscale.com/wgengine/netstack"
_ "tailscale.com/wgengine/router"
_ "time"
)

@ -0,0 +1,65 @@
// Copyright (c) 2021 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.
// Code generated by gen_deps.go; DO NOT EDIT.
package integration
import (
// And depend on a bunch of tailscaled innards, for Go's test caching.
// Otherwise cmd/go never sees that we depend on these packages'
// transitive deps when we run "go install tailscaled" in a child
// process and can cache a prior success when a dependency changes.
_ "context"
_ "crypto/tls"
_ "encoding/json"
_ "errors"
_ "flag"
_ "fmt"
_ "github.com/go-multierror/multierror"
_ "golang.org/x/sys/windows"
_ "golang.org/x/sys/windows/svc"
_ "golang.org/x/sys/windows/svc/mgr"
_ "golang.zx2c4.com/wireguard/windows/tunnel/winipcfg"
_ "inet.af/netaddr"
_ "io"
_ "io/ioutil"
_ "log"
_ "net"
_ "net/http"
_ "net/http/httptrace"
_ "net/http/pprof"
_ "net/url"
_ "os"
_ "os/signal"
_ "runtime"
_ "runtime/debug"
_ "strconv"
_ "strings"
_ "syscall"
_ "tailscale.com/derp/derphttp"
_ "tailscale.com/ipn"
_ "tailscale.com/ipn/ipnserver"
_ "tailscale.com/logpolicy"
_ "tailscale.com/logtail/backoff"
_ "tailscale.com/net/dns"
_ "tailscale.com/net/interfaces"
_ "tailscale.com/net/socks5/tssocks"
_ "tailscale.com/net/tshttpproxy"
_ "tailscale.com/net/tstun"
_ "tailscale.com/paths"
_ "tailscale.com/tailcfg"
_ "tailscale.com/types/flagtype"
_ "tailscale.com/types/key"
_ "tailscale.com/types/logger"
_ "tailscale.com/util/osshare"
_ "tailscale.com/version"
_ "tailscale.com/version/distro"
_ "tailscale.com/wf"
_ "tailscale.com/wgengine"
_ "tailscale.com/wgengine/monitor"
_ "tailscale.com/wgengine/netstack"
_ "tailscale.com/wgengine/router"
_ "time"
)
Loading…
Cancel
Save