- upgrade.sh: automates backporting upstream Go net package changes
- Downloads Go source tarballs for CUR and UPSTREAM versions
- Copies unmodified files directly from upstream
- Performs 3-way merge (diff3) for TinyGo-modified files
- Detects per-file CUR version from TINYGO headers
- Generates detailed diff reports in .upgrade-report/
- Supports --dry-run mode for previewing changes
- .gitignore: add .upgrade-work/ and .upgrade-report/ directories
This change introduces a CheckRedirect field to the http.Client struct in TinyGo,
mirroring the behavior of Go's standard library http.Client.
The purpose of this addition is to resolve build errors in projects that rely
on packages (such as golang.org/x/oauth2) expecting the Client to have a
CheckRedirect field. The field provides no functional change within TinyGo’s
HTTP client at this time — it is only included for API compatibility and
compilation success. There is no effect on runtime behavior unless explicitly
used by downstream code.
This fixes a problem with https://github.com/tinygo-org/net/pull/36
which causes the Windows TinyGO build to fail. The problem is the
function lookupProtocol was missing for Windows build. This PR adds the
function for Windows.
I can't really test this because I don't have a Windows system, but by
inspection is seems like it's correct.
This is a rework of PR#24 based on review comments. The rework mostly
involved moving changes to the proper files, aligning with upstream Go
src/net file layout.
Initialize netdev to dummy NOP netdev that gracefully errors out all netdev
interface calls. This is to catch cases where useNetdev() was not
called by the app to set netdev.
According to man page accept(2), accept returns new client sockfd and
remote peer ip:port. This patch corrects the Accept() prototype in the
netdever interface to not take in an ip:port arg, but rather return an
ip:port for remote peer.
* stub out more types/funcs to compile against golang.org/x/net/internal/socket
These are changes need to compile github.com/domainr/dnsr/ with TinyGo. See issue tinygo-org/net#14.
These change are mostly to fix missing symbols in src/net. Missing types and functions are cut-and-pasted from go1.21.4. Functions are stubbed out returning errors.New("not implemented").
DNRS is compiled by running tinygo test:
sfeldma@nuc:~/work/dnsr$ tinygo test -target=wasi
With this patch, and a corresponding patch for tinygo/ to fixup crypto/tls, you should get a clean compile.
Need to return the same error structure/content as regular Go for
net.Conn Read/Write operations. Found/fixed when testing deadlines
on Read/Write operations.
This PR adds a network device driver model called netdev. There will be a companion PR for TinyGo drivers to update the netdev drivers and network examples. This PR covers the core "net" package.
An RFC for the work is here: #tinygo-org/drivers#487. Some things have changed from the RFC, but nothing major.
The "net" package is a partial port of Go's "net" package, version 1.19.3. The src/net/README file has details on what is modified from Go's "net" package.
Most "net" features are working as they would in normal Go. TCP/UDP/TLS protocol support is there. As well as HTTP client and server support. Standard Go network packages such as golang.org/x/net/websockets and Paho MQTT client work as-is. Other packages are likely to work as-is.
Testing results are here (https://docs.google.com/spreadsheets/d/e/2PACX-1vT0cCjBvwXf9HJf6aJV2Sw198F2ief02gmbMV0sQocKT4y4RpfKv3dh6Jyew8lQW64FouZ8GwA2yjxI/pubhtml?gid=1013173032&single=true).
Go 1.19 started reformatting code in a way that makes it more obvious
how it will be rendered on pkg.go.dev. It gets it almost right, but not
entirely. Therefore, I had to modify some of the comments so that they
are formatted correctly.
Some source code wasn't part of `FMT_PATHS` so wasn't checked for
correct formatting. This change includes all this source code and
excludes cgo/testdata because it contains files that can't be parsed.
internal/itoa wasn't around back in go 1.12 days when tinygo's syscall/errno.go was written.
It was only added as of go 1.17 ( https://github.com/golang/go/commit/061a6903a232cb868780b )
so we have to have an internal copy for now.
The internal copy should be deleted when tinygo drops support for go 1.16.
FWIW, the new version seems nicer.
It uses no allocations when converting 0,
and although the optimizer might make this moot, uses
a multiplication x 10 instead of a mod operation.