Skip to content

Commit

Permalink
Merge pull request #8 from carapace-sh/fix-patching
Browse files Browse the repository at this point in the history
fix patching
  • Loading branch information
rsteube authored May 5, 2024
2 parents 705bd7c + 4eb2055 commit 6c256f8
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 28 deletions.
29 changes: 23 additions & 6 deletions 1-plugin-patch/patch.diff
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
diff --git a/go-src b/go-src
--- a/go-src
+++ b/go-src
@@ -1 +1 @@
-Subproject commit 619b419a4b1506bde1aa7e833898f2f67fd0e83e
+Subproject commit 619b419a4b1506bde1aa7e833898f2f67fd0e83e-dirty
diff --git a/src/runtime/plugin.go b/src/runtime/plugin.go
index 4b6821b..40d1158 100644
--- a/src/runtime/plugin.go
+++ b/src/runtime/plugin.go
@@ -51,12 +51,12 @@ func plugin_lastmoduleinit() (path string, syms map[string]any, initTasks []*ini
throw("plugin: new module data overlaps with previous moduledata")
}
}
- for _, pkghash := range md.pkghashes {
- if pkghash.linktimehash != *pkghash.runtimehash {
- md.bad = true
- return "", nil, nil, "plugin was built with a different version of package " + pkghash.modulename
- }
- }
+ // for _, pkghash := range md.pkghashes {
+ // if pkghash.linktimehash != *pkghash.runtimehash {
+ // md.bad = true
+ // return "", nil, nil, "plugin was built with a different version of package " + pkghash.modulename
+ // }
+ // }

// Initialize the freshly loaded module.
modulesinit()
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define apply
@echo "Patching Runtime with ./$1/patch.diff..."
@git apply ./$1/patch.diff
@git -C go-src apply ../$1/patch.diff
endef

default:
Expand Down Expand Up @@ -31,4 +31,4 @@ build-termux: clean

patch:
@echo "Creating patch..."
@git diff go-src > patch.diff
@git -C go-src diff > patch.diff
16 changes: 8 additions & 8 deletions termux/1-hardcoded-etc-resolv-conf/patch.diff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- a/go-src/src/net/conf.go 2024-02-02 23:39:55.000000000 +0530
+++ b/go-src/src/net/conf.go 2024-02-18 22:34:10.016000996 +0530
--- a/src/net/conf.go 2024-02-02 23:39:55.000000000 +0530
+++ b/src/net/conf.go 2024-02-18 22:34:10.016000996 +0530
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand All @@ -9,8 +9,8 @@
package net

import (
--- a/go-src/src/net/conf_android.go 2024-02-18 22:31:59.680000988 +0530
+++ b/go-src/src/net/conf_android.go 2024-02-18 22:41:52.060001024 +0530
--- a/src/net/conf_android.go 2024-02-18 22:31:59.680000988 +0530
+++ b/src/net/conf_android.go 2024-02-18 22:41:52.060001024 +0530
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand All @@ -29,8 +29,8 @@
if err != nil && !errors.Is(err, fs.ErrNotExist) {
// Let libc figure out what is going on.
return hostLookupCgo, dnsConf
--- a/go-src/src/net/dnsclient_unix.go 2024-02-02 23:39:55.000000000 +0530
+++ b/go-src/src/net/dnsclient_unix.go 2024-02-18 22:36:17.948001004 +0530
--- a/src/net/dnsclient_unix.go 2024-02-02 23:39:55.000000000 +0530
+++ b/src/net/dnsclient_unix.go 2024-02-18 22:36:17.948001004 +0530
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand All @@ -40,8 +40,8 @@
// DNS client: see RFC 1035.
// Has to be linked into package net for Dial.

--- a/go-src/src/net/dnsclient_android.go 2024-02-18 22:32:31.136000990 +0530
+++ b/go-src/src/net/dnsclient_android.go 2024-02-18 22:43:13.612001028 +0530
--- a/src/net/dnsclient_android.go 2024-02-18 22:32:31.136000990 +0530
+++ b/src/net/dnsclient_android.go 2024-02-18 22:43:13.612001028 +0530
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
21 changes: 15 additions & 6 deletions termux/2-fix-GOPROXY-and-GOSUMDB-default-is-empty/patch.diff
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
diff --git a/go-src b/go-src
--- a/go-src
+++ b/go-src
@@ -1 +1 @@
-Subproject commit 619b419a4b1506bde1aa7e833898f2f67fd0e83e
+Subproject commit 619b419a4b1506bde1aa7e833898f2f67fd0e83e-dirty
diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
index afb595a..f74f980 100644
--- a/src/cmd/go/internal/cfg/cfg.go
+++ b/src/cmd/go/internal/cfg/cfg.go
@@ -411,8 +411,8 @@ var (
GORISCV64 = envOr("GORISCV64", fmt.Sprintf("rva%du64", buildcfg.GORISCV64))
GOWASM = envOr("GOWASM", fmt.Sprint(buildcfg.GOWASM))

- GOPROXY = envOr("GOPROXY", "")
- GOSUMDB = envOr("GOSUMDB", "")
+ GOPROXY = envOr("GOPROXY", "https://proxy.golang.org,direct")
+ GOSUMDB = envOr("GOSUMDB", "sum.golang.org")
GOPRIVATE = Getenv("GOPRIVATE")
GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
6 changes: 3 additions & 3 deletions termux/3-src-crypto-x509-root_linux.go/patch.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/go-src/src/crypto/x509/root_linux.go b/go-src/src/crypto/x509/root_linux.go
diff --git a/src/crypto/x509/root_linux.go b/src/crypto/x509/root_linux.go
index 8e79ccb..1176471 100644
--- a/go-src/src/crypto/x509/root_linux.go
+++ b/go-src/src/crypto/x509/root_linux.go
--- a/src/crypto/x509/root_linux.go
+++ b/src/crypto/x509/root_linux.go
@@ -8,6 +8,7 @@ import "internal/goos"

// Possible certificate files; stop after finding one.
Expand Down
6 changes: 3 additions & 3 deletions termux/4-src-os-file_unix.go.patch/patch.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/go-src/src/os/file_unix.go b/go-src/src/os/file_unix.go
diff --git a/src/os/file_unix.go b/src/os/file_unix.go
index a527b23..3a302f9 100644
--- a/go-src/src/os/file_unix.go
+++ b/go-src/src/os/file_unix.go
--- a/src/os/file_unix.go
+++ b/src/os/file_unix.go
@@ -392,7 +392,7 @@ func tempDir() string {
dir := Getenv("TMPDIR")
if dir == "" {
Expand Down

0 comments on commit 6c256f8

Please sign in to comment.