Skip to content

Commit 97da7bb

Browse files
committed
linux support for net.Dial by stubbing out runtime polling
Signed-off-by: leongross <[email protected]>
1 parent 415060d commit 97da7bb

File tree

11 files changed

+146
-616
lines changed

11 files changed

+146
-616
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
[submodule "lib/macos-minimal-sdk"]
3333
path = lib/macos-minimal-sdk
3434
url = https://github.com/aykevl/macos-minimal-sdk.git
35-
[submodule "src/net"]
36-
path = src/net
37-
url = https://github.com/tinygo-org/net.git
38-
branch = dev
3935
[submodule "lib/wasi-cli"]
4036
path = lib/wasi-cli
4137
url = https://github.com/WebAssembly/wasi-cli

loader/goroot.go

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ func needsSyscallPackage(buildTags []string) bool {
229229
// means use the TinyGo version.
230230
func pathsToOverride(goMinor int, needsSyscallPackage bool) map[string]bool {
231231
paths := map[string]bool{
232-
"": true,
233-
"crypto/": true,
234-
"crypto/rand/": false,
235-
"crypto/tls/": false,
232+
"": true,
233+
"crypto/": true,
234+
"crypto/rand/": false,
235+
// "crypto/tls/": false,
236236
"device/": false,
237237
"examples/": false,
238238
"internal/": true,
@@ -245,14 +245,14 @@ func pathsToOverride(goMinor int, needsSyscallPackage bool) map[string]bool {
245245
"internal/task/": false,
246246
"internal/wasi/": false,
247247
"machine/": false,
248-
"net/": true,
249-
"net/http/": false,
250-
"os/": true,
251-
"reflect/": false,
252-
"runtime/": false,
253-
"sync/": true,
254-
"testing/": true,
255-
"unique/": false,
248+
"net/": false,
249+
// "net/http/": false,
250+
"os/": true,
251+
"reflect/": false,
252+
"runtime/": false,
253+
"sync/": true,
254+
"testing/": true,
255+
"unique/": false,
256256
}
257257

258258
if goMinor >= 19 {
@@ -264,6 +264,12 @@ func pathsToOverride(goMinor int, needsSyscallPackage bool) map[string]bool {
264264
if needsSyscallPackage {
265265
paths["syscall/"] = true // include syscall/js
266266
}
267+
268+
// to enable network support for linux systems, reuse the Go version of the net package
269+
// and the according runtime functions
270+
// if runtime.GOOS == "linux" {
271+
// paths["runtime/netpoll/"] = true
272+
// }
267273
return paths
268274
}
269275

0 commit comments

Comments
 (0)