-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new: WATM v1 v1: based on v0, we renamed and redesigned tons of interfaces, introduced new working modes, and fixed potential bugs. Signed-off-by: Gaukas Wang <[email protected]> * build: move and update replaced package Move tinygo/v?/examples/replace/x/sys` to `tinygo/replaced/golang.org/x/[email protected]` Signed-off-by: Gaukas Wang <[email protected]> --------- Signed-off-by: Gaukas Wang <[email protected]>
- Loading branch information
Showing
568 changed files
with
7,027 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module github.com/refraction-networking/watm | ||
|
||
go 1.20 | ||
go 1.21 |
10 changes: 10 additions & 0 deletions
10
tinygo/replaced/golang.org/x/[email protected]/.gitattributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Treat all files in this repo as binary, with no git magic updating | ||
# line endings. Windows users contributing to Go will need to use a | ||
# modern version of git and editors capable of LF line endings. | ||
# | ||
# We'll prevent accidental CRLF line endings from entering the repo | ||
# via the git-review gofmt checks. | ||
# | ||
# See golang.org/issue/9281 | ||
|
||
* -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Add no patterns to .gitignore except for files generated by the build. | ||
last-change |
26 changes: 26 additions & 0 deletions
26
tinygo/replaced/golang.org/x/[email protected]/CONTRIBUTING.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Contributing to Go | ||
|
||
Go is an open source project. | ||
|
||
It is the work of hundreds of contributors. We appreciate your help! | ||
|
||
## Filing issues | ||
|
||
When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: | ||
|
||
1. What version of Go are you using (`go version`)? | ||
2. What operating system and processor architecture are you using? | ||
3. What did you do? | ||
4. What did you expect to see? | ||
5. What did you see instead? | ||
|
||
General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. | ||
The gophers there will answer or ask you to file an issue if you've tripped over a bug. | ||
|
||
## Contributing code | ||
|
||
Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) | ||
before sending patches. | ||
|
||
Unless otherwise noted, the Go source files are distributed under | ||
the BSD-style license found in the LICENSE file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) 2009 The Go Authors. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following disclaimer | ||
in the documentation and/or other materials provided with the | ||
distribution. | ||
* Neither the name of Google Inc. nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Additional IP Rights Grant (Patents) | ||
|
||
"This implementation" means the copyrightable works distributed by | ||
Google as part of the Go project. | ||
|
||
Google hereby grants to You a perpetual, worldwide, non-exclusive, | ||
no-charge, royalty-free, irrevocable (except as stated in this section) | ||
patent license to make, have made, use, offer to sell, sell, import, | ||
transfer and otherwise run, modify and propagate the contents of this | ||
implementation of Go, where such license applies only to those patent | ||
claims, both currently owned or controlled by Google and acquired in | ||
the future, licensable by Google that are necessarily infringed by this | ||
implementation of Go. This grant does not include claims that would be | ||
infringed only as a consequence of further modification of this | ||
implementation. If you or your agent or exclusive licensee institute or | ||
order or agree to the institution of patent litigation against any | ||
entity (including a cross-claim or counterclaim in a lawsuit) alleging | ||
that this implementation of Go or any code incorporated within this | ||
implementation of Go constitutes direct or contributory patent | ||
infringement, or inducement of patent infringement, then any patent | ||
rights granted to you under this License for this implementation of Go | ||
shall terminate as of the date such litigation is filed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# sys | ||
|
||
[![Go Reference](https://pkg.go.dev/badge/golang.org/x/sys.svg)](https://pkg.go.dev/golang.org/x/sys) | ||
|
||
This repository holds supplemental Go packages for low-level interactions with | ||
the operating system. | ||
|
||
## Download/Install | ||
|
||
The easiest way to install is to run `go get -u golang.org/x/sys`. You can | ||
also manually git clone the repository to `$GOPATH/src/golang.org/x/sys`. | ||
|
||
## Report Issues / Send Patches | ||
|
||
This repository uses Gerrit for code changes. To learn how to submit changes to | ||
this repository, see https://golang.org/doc/contribute.html. | ||
|
||
The main issue tracker for the sys repository is located at | ||
https://github.com/golang/go/issues. Prefix your issue with "x/sys:" in the | ||
subject line, so it is easy to find. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
issuerepo: golang/go |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
tinygo/replaced/golang.org/x/[email protected]/cpu/runtime_auxv_go121.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2023 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build go1.21 | ||
|
||
package cpu | ||
|
||
import ( | ||
_ "unsafe" // for linkname | ||
) | ||
|
||
// manually disabling the following until TinyGo implements runtime.getAuxv | ||
|
||
// //go:linkname runtime_getAuxv runtime.getAuxv | ||
// func runtime_getAuxv() []uintptr | ||
|
||
// func init() { | ||
// getAuxvFn = runtime_getAuxv | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
102 changes: 102 additions & 0 deletions
102
tinygo/replaced/golang.org/x/[email protected]/execabs/execabs.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// Copyright 2020 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// Package execabs is a drop-in replacement for os/exec | ||
// that requires PATH lookups to find absolute paths. | ||
// That is, execabs.Command("cmd") runs the same PATH lookup | ||
// as exec.Command("cmd"), but if the result is a path | ||
// which is relative, the Run and Start methods will report | ||
// an error instead of running the executable. | ||
// | ||
// See https://blog.golang.org/path-security for more information | ||
// about when it may be necessary or appropriate to use this package. | ||
package execabs | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os/exec" | ||
"path/filepath" | ||
"reflect" | ||
"unsafe" | ||
) | ||
|
||
// ErrNotFound is the error resulting if a path search failed to find an executable file. | ||
// It is an alias for exec.ErrNotFound. | ||
var ErrNotFound = exec.ErrNotFound | ||
|
||
// Cmd represents an external command being prepared or run. | ||
// It is an alias for exec.Cmd. | ||
type Cmd = exec.Cmd | ||
|
||
// Error is returned by LookPath when it fails to classify a file as an executable. | ||
// It is an alias for exec.Error. | ||
type Error = exec.Error | ||
|
||
// An ExitError reports an unsuccessful exit by a command. | ||
// It is an alias for exec.ExitError. | ||
type ExitError = exec.ExitError | ||
|
||
func relError(file, path string) error { | ||
return fmt.Errorf("%s resolves to executable in current directory (.%c%s)", file, filepath.Separator, path) | ||
} | ||
|
||
// LookPath searches for an executable named file in the directories | ||
// named by the PATH environment variable. If file contains a slash, | ||
// it is tried directly and the PATH is not consulted. The result will be | ||
// an absolute path. | ||
// | ||
// LookPath differs from exec.LookPath in its handling of PATH lookups, | ||
// which are used for file names without slashes. If exec.LookPath's | ||
// PATH lookup would have returned an executable from the current directory, | ||
// LookPath instead returns an error. | ||
func LookPath(file string) (string, error) { | ||
path, err := exec.LookPath(file) | ||
if err != nil && !isGo119ErrDot(err) { | ||
return "", err | ||
} | ||
if filepath.Base(file) == file && !filepath.IsAbs(path) { | ||
return "", relError(file, path) | ||
} | ||
return path, nil | ||
} | ||
|
||
func fixCmd(name string, cmd *exec.Cmd) { | ||
if filepath.Base(name) == name && !filepath.IsAbs(cmd.Path) && !isGo119ErrFieldSet(cmd) { | ||
// exec.Command was called with a bare binary name and | ||
// exec.LookPath returned a path which is not absolute. | ||
// Set cmd.lookPathErr and clear cmd.Path so that it | ||
// cannot be run. | ||
lookPathErr := (*error)(unsafe.Pointer(reflect.ValueOf(cmd).Elem().FieldByName("lookPathErr").Addr().Pointer())) | ||
if *lookPathErr == nil { | ||
*lookPathErr = relError(name, cmd.Path) | ||
} | ||
cmd.Path = "" | ||
} | ||
} | ||
|
||
// CommandContext is like Command but includes a context. | ||
// | ||
// The provided context is used to kill the process (by calling os.Process.Kill) | ||
// if the context becomes done before the command completes on its own. | ||
func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd { | ||
cmd := exec.CommandContext(ctx, name, arg...) | ||
fixCmd(name, cmd) | ||
return cmd | ||
|
||
} | ||
|
||
// Command returns the Cmd struct to execute the named program with the given arguments. | ||
// See exec.Command for most details. | ||
// | ||
// Command differs from exec.Command in its handling of PATH lookups, | ||
// which are used when the program name contains no slashes. | ||
// If exec.Command would have returned an exec.Cmd configured to run an | ||
// executable from the current directory, Command instead | ||
// returns an exec.Cmd that will return an error from Start or Run. | ||
func Command(name string, arg ...string) *exec.Cmd { | ||
cmd := exec.Command(name, arg...) | ||
fixCmd(name, cmd) | ||
return cmd | ||
} |
17 changes: 17 additions & 0 deletions
17
tinygo/replaced/golang.org/x/[email protected]/execabs/execabs_go118.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2022 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build !go1.19 | ||
|
||
package execabs | ||
|
||
import "os/exec" | ||
|
||
func isGo119ErrDot(err error) bool { | ||
return false | ||
} | ||
|
||
func isGo119ErrFieldSet(cmd *exec.Cmd) bool { | ||
return false | ||
} |
20 changes: 20 additions & 0 deletions
20
tinygo/replaced/golang.org/x/[email protected]/execabs/execabs_go119.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2022 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build go1.19 | ||
|
||
package execabs | ||
|
||
import ( | ||
"errors" | ||
"os/exec" | ||
) | ||
|
||
func isGo119ErrDot(err error) bool { | ||
return errors.Is(err, exec.ErrDot) | ||
} | ||
|
||
func isGo119ErrFieldSet(cmd *exec.Cmd) bool { | ||
return cmd.Err != nil | ||
} |
Oops, something went wrong.