Skip to content

Commit

Permalink
Update patches to support Go 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
eandre committed Aug 14, 2024
1 parent a3f57e0 commit ee57f66
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions overlay/src/runtime/encore.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ func encoreCallers(skip int, pc []uintptr) (n int, off uintptr) {
n = Callers(skip+1, pc)
return n, firstmoduledata.text
}

// To allow Encore to use go:linkname:

//go:linkname getEncoreG
//go:linkname setEncoreG
//go:linkname encoreCallers
6 changes: 3 additions & 3 deletions patches/net_patch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ This patch modifies the standard libraries roundTrip function on the HTTP interf
instrument the call.

diff --git a/src/net/http/transport.go b/src/net/http/transport.go
index 7561f7f5cb..302425e3b4 100644
index da9163a27a..b2200d5952 100644
--- a/src/net/http/transport.go
+++ b/src/net/http/transport.go
@@ -510,9 +510,17 @@ func (t *Transport) alternateRoundTripper(req *Request) RoundTripper {
@@ -527,9 +527,17 @@ func validateHeaders(hdrs Header) string {
}

// roundTrip implements a RoundTripper over HTTP.
-func (t *Transport) roundTrip(req *Request) (*Response, error) {
-func (t *Transport) roundTrip(req *Request) (_ *Response, err error) {
+func (t *Transport) roundTrip(req *Request) (rr *Response, err error) {
t.nextProtoOnce.Do(t.onceSetNextProtoDefaults)
- ctx := req.Context()
Expand Down
14 changes: 7 additions & 7 deletions patches/runtime_patch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ index aba2e2b27b..588a98ff74 100644
sched.ngsys.Add(1)

diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index 63320d4a8a..f3be797f7d 100644
index 4a78963961..87932dfd73 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -510,6 +510,8 @@ type g struct {

@@ -516,6 +516,8 @@ type g struct {
coroarg *coro // argument during coroutine transfers

+ encore unsafe.Pointer // encore-specific goroutine data
+
// goroutineProfiled indicates the status of this goroutine's stack for the
// current in-progress goroutine profile
goroutineProfiled goroutineProfileStateHolder
// Per-G tracer state.
trace gTraceState

0 comments on commit ee57f66

Please sign in to comment.