Skip to content

Commit

Permalink
Merge pull request #469 from mutagen-io/v018-development
Browse files Browse the repository at this point in the history
all: dependency updates and small changes for v0.18.x
  • Loading branch information
xenoscopic authored Dec 1, 2023
2 parents 3148707 + 23b6d98 commit cd4af6f
Show file tree
Hide file tree
Showing 53 changed files with 192 additions and 188 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.20.6'
go-version: '1.21.4'
- name: "Install sha256sum"
run: brew install coreutils
- run: scripts/ci/setup_go.sh
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
goversion: ['1.19.11', '1.20.6']
goversion: ['1.20.11', '1.21.4']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand All @@ -93,7 +93,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.20.6'
go-version: '1.21.4'
- run: scripts/ci/setup_go.sh
shell: bash
- run: scripts/ci/setup_docker.sh
Expand All @@ -116,7 +116,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.20.6'
go-version: '1.21.4'
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
Expand Down
21 changes: 15 additions & 6 deletions cmd/external/flags.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
package external

// UsePathBasedLookupForDaemonStart tells Mutagen cmd packages that they should
// use PATH-based lookups to identify the Mutagen executable when trying to
// start the Mutagen daemon. This is required for start (and autostart) behavior
// to function correctly if the calling executable is not the Mutagen CLI. This
// variable must be set in an init function.
var UsePathBasedLookupForDaemonStart bool
var (
// DisableDaemonAutostart tells Mutagen cmd packages that they should
// disable daemon autostart behavior. This is the programmatic equivalent to
// MUTAGEN_DISABLE_AUTOSTART=1. The resulting behavior is the logical-OR of
// either condition (i.e. leaving this false does not override the
// environment variable specification). This variable must be set in an init
// function.
DisableDaemonAutostart bool
// UsePathBasedLookupForDaemonStart tells Mutagen cmd packages that they
// should use PATH-based lookups to identify the Mutagen executable when
// trying to start the Mutagen daemon. This is required for start (and
// autostart) behavior to function correctly if the calling executable is
// not the Mutagen CLI. This variable must be set in an init function.
UsePathBasedLookupForDaemonStart bool
)
22 changes: 8 additions & 14 deletions cmd/mutagen/daemon/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"google.golang.org/grpc"

"github.com/mutagen-io/mutagen/cmd"
"github.com/mutagen-io/mutagen/cmd/external"

"github.com/mutagen-io/mutagen/pkg/daemon"
"github.com/mutagen-io/mutagen/pkg/grpcutil"
Expand All @@ -30,16 +31,6 @@ const (
autostartRetryCount = 10
)

// autostartDisabled controls whether or not daemon autostart is disabled for
// Mutagen. It is set automatically based on the MUTAGEN_DISABLE_AUTOSTART
// environment variable.
var autostartDisabled bool

func init() {
// Check whether or not autostart should be disabled.
autostartDisabled = os.Getenv("MUTAGEN_DISABLE_AUTOSTART") == "1"
}

// Connect creates a new daemon client connection and optionally verifies that
// the daemon version matches the current process' version.
func Connect(autostart, enforceVersionMatch bool) (*grpc.ClientConn, error) {
Expand All @@ -49,8 +40,9 @@ func Connect(autostart, enforceVersionMatch bool) (*grpc.ClientConn, error) {
return nil, fmt.Errorf("unable to compute endpoint path: %w", err)
}

// Check if autostart has been disabled by an environment variable.
if autostartDisabled {
// Check if autostart has been disabled programmatically or by an
// environment variable.
if external.DisableDaemonAutostart || os.Getenv("MUTAGEN_DISABLE_AUTOSTART") == "1" {
autostart = false
}

Expand All @@ -72,8 +64,10 @@ func Connect(autostart, enforceVersionMatch bool) (*grpc.ClientConn, error) {
grpc.WithInsecure(),
grpc.WithContextDialer(ipc.DialContext),
grpc.WithBlock(),
grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(grpcutil.MaximumMessageSize)),
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(grpcutil.MaximumMessageSize)),
grpc.WithDefaultCallOptions(
grpc.MaxCallSendMsgSize(grpcutil.MaximumMessageSize),
grpc.MaxCallRecvMsgSize(grpcutil.MaximumMessageSize),
),
)

// Cancel the dialing context. If the dialing operation has already
Expand Down
16 changes: 16 additions & 0 deletions cmd/mutagen/daemon/protocols.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build mutagencli

package daemon

// We only register protocol handlers when building the Mutagen CLI, that way
// Mutagen command line code can be embedded into other tools that might want to
// register their own handlers.

import (
_ "github.com/mutagen-io/mutagen/pkg/forwarding/protocols/docker"
_ "github.com/mutagen-io/mutagen/pkg/forwarding/protocols/local"
_ "github.com/mutagen-io/mutagen/pkg/forwarding/protocols/ssh"
_ "github.com/mutagen-io/mutagen/pkg/synchronization/protocols/docker"
_ "github.com/mutagen-io/mutagen/pkg/synchronization/protocols/local"
_ "github.com/mutagen-io/mutagen/pkg/synchronization/protocols/ssh"
)
7 changes: 0 additions & 7 deletions cmd/mutagen/daemon/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ import (
promptingsvc "github.com/mutagen-io/mutagen/pkg/service/prompting"
synchronizationsvc "github.com/mutagen-io/mutagen/pkg/service/synchronization"
"github.com/mutagen-io/mutagen/pkg/synchronization"

_ "github.com/mutagen-io/mutagen/pkg/forwarding/protocols/docker"
_ "github.com/mutagen-io/mutagen/pkg/forwarding/protocols/local"
_ "github.com/mutagen-io/mutagen/pkg/forwarding/protocols/ssh"
_ "github.com/mutagen-io/mutagen/pkg/synchronization/protocols/docker"
_ "github.com/mutagen-io/mutagen/pkg/synchronization/protocols/local"
_ "github.com/mutagen-io/mutagen/pkg/synchronization/protocols/ssh"
)

// runMain is the entry point for the run command.
Expand Down
42 changes: 21 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
module github.com/mutagen-io/mutagen

go 1.19
go 1.20

require (
github.com/Microsoft/go-winio v0.6.0
github.com/bmatcuk/doublestar/v4 v4.6.0
github.com/Microsoft/go-winio v0.6.1
github.com/bmatcuk/doublestar/v4 v4.6.1
github.com/dustin/go-humanize v1.0.1
github.com/eknkc/basex v1.0.1
github.com/fatih/color v1.13.0
github.com/golang-jwt/jwt/v4 v4.4.3
github.com/fatih/color v1.16.0
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/google/uuid v1.3.0
github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95
github.com/klauspost/compress v1.15.14
github.com/mattn/go-isatty v0.0.16
github.com/google/uuid v1.4.0
github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb
github.com/klauspost/compress v1.17.3
github.com/mattn/go-isatty v0.0.20
github.com/mutagen-io/extstat v0.0.0-20210224131814-32fa3f057fa8
github.com/mutagen-io/fsevents v0.0.0-20230629001834-f53e17b91ebc
github.com/mutagen-io/gopass v0.0.0-20230214181532-d4b7cdfe054c
github.com/spf13/cobra v1.6.1
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/zeebo/xxh3 v1.0.2
golang.org/x/net v0.7.0
golang.org/x/sys v0.5.0
golang.org/x/text v0.7.0
google.golang.org/grpc v1.53.0
golang.org/x/net v0.19.0
golang.org/x/sys v0.15.0
golang.org/x/text v0.14.0
google.golang.org/grpc v1.59.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
google.golang.org/protobuf v1.28.1
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/apimachinery v0.21.3
)

require (
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/tools v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect
)

replace k8s.io/apimachinery v0.21.3 => github.com/mutagen-io/apimachinery v0.21.3-mutagen1
Loading

0 comments on commit cd4af6f

Please sign in to comment.