Skip to content

Commit 5abda4d

Browse files
authored
Upgrade x/sys and quantile to work with Go 1.18 (#1164)
Builds with 1.18 are currently failing with numerous errors like: ``` > make bins go build -o .build/dummy internal/cmd/dummy/dummy.go # golang.org/x/sys/unix ../../../pkg/mod/golang.org/x/[email protected]/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable ../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable ``` This is pretty easily addressed with `go get -u go.lang.org/x/sys`, which (plus `make build` to verify) is all this commit _would_ contain... ... but github.com/streadway/quantile was using a `import "."`, which apparently Go 1.18 disallows for modules. Which breaks `go mod tidy` rather awkwardly. TIL. Now that streadway/quantile#8 is merged though, the new `master` works, so that has been updated as well.
1 parent 473aaac commit 5abda4d

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require (
1212
github.com/opentracing/opentracing-go v1.1.0
1313
github.com/pborman/uuid v0.0.0-20160209185913-a97ce2ca70fa
1414
github.com/robfig/cron v1.2.0
15+
github.com/streadway/quantile v0.0.0-20220407130108-4246515d968d // indirect
1516
github.com/stretchr/testify v1.4.0
1617
github.com/uber-go/tally v3.3.15+incompatible
1718
github.com/uber/cadence-idl v0.0.0-20220223020740-f2f5b7fc2bbd
@@ -26,6 +27,7 @@ require (
2627
go.uber.org/zap v1.13.0
2728
golang.org/x/lint v0.0.0-20200130185559-910be7a94367
2829
golang.org/x/net v0.0.0-20201021035429-f5854403a974
30+
golang.org/x/sys v0.0.0-20220403205710-6acee93ad0eb // indirect
2931
golang.org/x/time v0.0.0-20170927054726-6dc17368e09b
3032
honnef.co/go/tools v0.0.1-2019.2.3
3133
)

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ github.com/samuel/go-thrift v0.0.0-20191111193933-5165175b40af h1:EiWVfh8mr40yFZ
144144
github.com/samuel/go-thrift v0.0.0-20191111193933-5165175b40af/go.mod h1:Vrkh1pnjV9Bl8c3P9zH0/D4NlOHWP5d4/hF4YTULaec=
145145
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
146146
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
147-
github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25 h1:7z3LSn867ex6VSaahyKadf4WtSsJIgne6A1WLOAGM8A=
148147
github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25/go.mod h1:lbP8tGiBjZ5YWIc2fzuRpTaz0b/53vT6PEs3QuAWzuU=
148+
github.com/streadway/quantile v0.0.0-20220407130108-4246515d968d h1:X4+kt6zM/OVO6gbJdAfJR60MGPsqCzbtXNnjoGqdfAs=
149+
github.com/streadway/quantile v0.0.0-20220407130108-4246515d968d/go.mod h1:lbP8tGiBjZ5YWIc2fzuRpTaz0b/53vT6PEs3QuAWzuU=
149150
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
150151
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
151152
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
@@ -249,8 +250,9 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7w
249250
golang.org/x/sys v0.0.0-20200117145432-59e60aa80a0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
250251
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
251252
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
252-
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
253253
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
254+
golang.org/x/sys v0.0.0-20220403205710-6acee93ad0eb h1:PVGECzEo9Y3uOidtkHGdd347NjLtITfJFO9BxFpmRoo=
255+
golang.org/x/sys v0.0.0-20220403205710-6acee93ad0eb/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
254256
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
255257
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
256258
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=

internal/common/auth/service_wrapper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,14 @@ func (w *workflowServiceAuthWrapper) GetTaskListsByDomain(ctx context.Context, r
455455
return nil, err
456456
}
457457
opts = append(opts, *tokenHeader)
458-
result, err := w.service.GetTaskListsByDomain(ctx,request, opts...)
458+
result, err := w.service.GetTaskListsByDomain(ctx, request, opts...)
459459
return result, err
460460
}
461461

462462
func (w *workflowServiceAuthWrapper) RefreshWorkflowTasks(ctx context.Context, request *shared.RefreshWorkflowTasksRequest, opts ...yarpc.CallOption) error {
463463
tokenHeader, err := w.getYarpcJWTHeader()
464464
if err != nil {
465-
return err
465+
return err
466466
}
467467
opts = append(opts, *tokenHeader)
468468
err = w.service.RefreshWorkflowTasks(ctx, request, opts...)

internal/compatibility/adapter.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ type thrift2protoAdapter struct {
3838
visibility apiv1.VisibilityAPIYARPCClient
3939
}
4040

41-
42-
4341
func NewThrift2ProtoAdapter(
4442
domain apiv1.DomainAPIYARPCClient,
4543
workflow apiv1.WorkflowAPIYARPCClient,
@@ -245,7 +243,7 @@ func (a thrift2protoAdapter) GetTaskListsByDomain(ctx context.Context, Request *
245243

246244
func (a thrift2protoAdapter) RefreshWorkflowTasks(ctx context.Context, request *shared.RefreshWorkflowTasksRequest, opts ...yarpc.CallOption) error {
247245
_, err := a.workflow.RefreshWorkflowTasks(ctx, proto.RefreshWorkflowTasksRequest(request), opts...)
248-
return thrift.Error(err)
246+
return thrift.Error(err)
249247
}
250248

251249
type domainAPIthriftAdapter struct {
@@ -435,4 +433,3 @@ func (a visibilityAPIthriftAdapter) GetSearchAttributes(ctx context.Context, req
435433
response, err := a.service.GetSearchAttributes(ctx, opts...)
436434
return proto.GetSearchAttributesResponse(response), proto.Error(err)
437435
}
438-

internal/compatibility/proto/request.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,8 @@ func RefreshWorkflowTasksRequest(r *shared.RefreshWorkflowTasksRequest) *apiv1.R
616616
return nil
617617
}
618618
request := apiv1.RefreshWorkflowTasksRequest{
619-
Domain: r.GetDomain(),
620-
WorkflowExecution: WorkflowExecution(r.Execution),
619+
Domain: r.GetDomain(),
620+
WorkflowExecution: WorkflowExecution(r.Execution),
621621
}
622622
return &request
623623
}

0 commit comments

Comments
 (0)