From f86bbd4e04c11f5d83cc72ed40fc8faa9a6a4b41 Mon Sep 17 00:00:00 2001 From: "Anuraag (Rag) Agrawal" Date: Thu, 28 Nov 2024 11:26:06 +0900 Subject: [PATCH] Migrate to goyek (#158) --- .github/workflows/bench.yaml | 12 +- .github/workflows/ci.yaml | 22 ++-- .github/workflows/wasm.yaml | 10 +- .gitignore | 2 +- .golangci.yml | 10 +- .yamllint.yaml | 5 + CODE_OF_CONDUCT.md | 21 ++-- README.md | 8 +- build/go.mod | 18 +++ build/go.sum | 21 ++++ build/main.go | 173 ++++++++++++++++++++++++++ build/versions.go | 3 + buildtools/re2/Dockerfile | 76 ++++++------ go-re2.code-workspace | 24 ++++ go.work | 3 +- mage/go.mod | 5 - mage/go.sum | 2 - mage/main.go | 13 -- magefiles/go.mod | 5 - magefiles/go.sum | 1 - magefiles/magefile.go | 228 ----------------------------------- magefiles/versions.go | 8 -- wafbench/.ftw.yml | 94 +++++++-------- wafbench/go.sum | 11 ++ 24 files changed, 387 insertions(+), 388 deletions(-) create mode 100644 .yamllint.yaml create mode 100644 build/go.mod create mode 100644 build/go.sum create mode 100644 build/main.go create mode 100644 build/versions.go create mode 100644 go-re2.code-workspace delete mode 100644 mage/go.mod delete mode 100644 mage/go.sum delete mode 100644 mage/main.go delete mode 100644 magefiles/go.mod delete mode 100644 magefiles/go.sum delete mode 100644 magefiles/magefile.go delete mode 100644 magefiles/versions.go diff --git a/.github/workflows/bench.yaml b/.github/workflows/bench.yaml index 2a3eddc..89d86a9 100644 --- a/.github/workflows/bench.yaml +++ b/.github/workflows/bench.yaml @@ -4,9 +4,9 @@ on: branches: - main paths-ignore: - - '**/*.md' - - '**/*.txt' - - '**/*.yaml' + - "**/*.md" + - "**/*.txt" + - "**/*.yaml" workflow_dispatch: jobs: @@ -19,14 +19,14 @@ jobs: go-version-file: go.work cache-dependency-path: | **/go.sum - magefiles/versions.go + build/versions.go - name: setup re2 for cgo run: sudo apt-get update && sudo apt-get install -y libre2-dev - - run: go run mage benchall + - run: go run ./build bench-all - - run: go run mage wafbenchall + - run: go run ./build wafbench-all - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v3 with: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 414b561..e67cd12 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,10 +35,10 @@ jobs: - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 with: # TODO: Split lint step to allow it to have a higher minimum Go requirement. - go-version: '^1.22' + go-version: "^1.22" cache-dependency-path: | **/go.sum - magefiles/versions.go + build/versions.go - name: setup re2 for cgo (linux) if: ${{ startsWith(matrix.os, 'ubuntu-') && matrix.mode == 'cgo' }} @@ -64,7 +64,7 @@ jobs: run: go install github.com/wasilibs/tools/cmd/wasmtime@875fe73f677c58d467ee373a9e00e6cb66b268f3 - name: run checks - run: go run mage check + run: go run ./build ${{ startsWith(matrix.os, 'ubuntu-') && 'check' || 'test' }} if: ${{ !startsWith(matrix.os, 'windows-') || matrix.mode != 'cgo' }} env: RE2_TEST_MODE: ${{ matrix.mode }} @@ -76,11 +76,11 @@ jobs: # Race detector currently fails with Windows TEST_NORACE: ${{ startsWith(matrix.os, 'windows-') && matrix.mode == 'wazero' && 'true' || '' }} - - name: run checks (windows cgo) - run: go run mage check + - name: run tests (windows cgo) + run: go run ./build test if: ${{ startsWith(matrix.os, 'windows-') && matrix.mode == 'cgo' }} # Shell does not support conditional expressions using matrix, so for now we duplicate the steps - shell: 'msys2 {0}' + shell: "msys2 {0}" env: RE2_TEST_MODE: ${{ matrix.mode }} # General coverage should be good enough to not need to slow down development @@ -90,16 +90,16 @@ jobs: GOMEMLIMIT: ${{ github.event_name != 'pull_request' && '1GiB' || '' }} test-bsd: - runs-on: ubuntu-latest + runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 with: go-version-file: go.work cache-dependency-path: | **/go.sum - magefiles/versions.go + build/versions.go - name: Build run: go test -c . @@ -110,7 +110,7 @@ jobs: uses: cross-platform-actions/action@cdc9ee69ef84a5f2e59c9058335d9c57bcb4ac86 # v0.25.0 with: operating_system: freebsd - version: '14.0' + version: "14.0" shell: bash run: ./go-re2.test -test.v -test.short sync_files: runner-to-vm @@ -128,6 +128,6 @@ jobs: - run: if command -v gcc &> /dev/null; then echo "GCC found but not expected"; exit 321; fi - - run: go run mage test + - run: go run ./build test env: TEST_NORACE: "true" diff --git a/.github/workflows/wasm.yaml b/.github/workflows/wasm.yaml index 2e0e179..d3d9445 100644 --- a/.github/workflows/wasm.yaml +++ b/.github/workflows/wasm.yaml @@ -28,7 +28,7 @@ jobs: with: app-id: ${{ vars.WASILIBS_APP_ID }} private-key: ${{ secrets.WASILIBS_APP_PRIVATE_KEY }} - + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: token: ${{ github.event_name != 'pull_request' && steps.app-token.outputs.token || github.token }} @@ -38,20 +38,20 @@ jobs: go-version: ^1.22 cache-dependency-path: | **/go.sum - magefiles/versions.go + build/versions.go - - run: go run mage updateLibs + - run: go run ./build wasm - name: generate memory.wasm run: go run github.com/wasilibs/go-wabt/cmd/wat2wasm@face6b1 --enable-threads -o internal/wasm/memory.wasm internal/wasm/memory.wat - - run: go run mage test + - run: go run ./build test - uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v1 if: github.event_name != 'pull_request' with: subject-path: internal/wasm/* - + - name: push wasm if: github.event_name != 'pull_request' continue-on-error: true # Ignore if there is no change diff --git a/.gitignore b/.gitignore index e99dfee..c41d2ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .idea -build +out go.work.sum diff --git a/.golangci.yml b/.golangci.yml index 964cd69..65a9574 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,13 @@ linters: enable: + - gci - gofumpt - - goimports +linters-settings: + gci: + sections: + - standard + - default + - prefix(github.com/wasilibs/go-re2) issues: exclude-rules: - path: magefiles @@ -10,4 +16,4 @@ issues: - path: _test.go linters: # We have tests for deprecated methods - - staticcheck \ No newline at end of file + - staticcheck diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..9fa3737 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,5 @@ +rules: + document-start: disable + line-length: disable + truthy: + check-keys: false diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index b4d813c..561f3dd 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,3 @@ - # Contributor Covenant Code of Conduct ## Our Pledge @@ -18,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or advances of +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities diff --git a/README.md b/README.md index 3b36976..9e6bdd2 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,9 @@ behavior differences. These are likely corner cases that don't affect typical ap best to confirm them before proceeding. - Invalid utf-8 strings are treated differently. The standard library silently replaces invalid utf-8 -with the unicode replacement character. This library will stop consuming strings when encountering -invalid utf-8. + with the unicode replacement character. This library will stop consuming strings when encountering + invalid utf-8. + - `experimental.CompileLatin1` can be used to match against non-utf8 strings - `reflect.DeepEqual` cannot compare `Regexp` objects. @@ -93,6 +94,7 @@ pacman -S mingw-w64-x86_64-gcc pacman -S mingw-w64-x86_64-re2 pacman -S mingw-w64-x86_64-pkg-config ``` + If you want to run the resulting exe program outside the MINGW64 terminal you need to add a path to the MinGW-w64 libraries to the PATH environmental variable (adjust as needed for your system): ```cmd @@ -105,7 +107,7 @@ On Mac start by installing [homebrew][9] including installation of the command l ```bash brew install re2 -```` +``` ## Performance diff --git a/build/go.mod b/build/go.mod new file mode 100644 index 0000000..67750b2 --- /dev/null +++ b/build/go.mod @@ -0,0 +1,18 @@ +module build + +go 1.21 + +require ( + github.com/curioswitch/go-build v0.0.0-20241128010140-c23617fb13e0 + github.com/goyek/goyek/v2 v2.2.0 + github.com/goyek/x v0.2.0 +) + +require ( + github.com/fatih/color v1.17.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-shellwords v1.0.12 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect +) diff --git a/build/go.sum b/build/go.sum new file mode 100644 index 0000000..9426263 --- /dev/null +++ b/build/go.sum @@ -0,0 +1,21 @@ +github.com/curioswitch/go-build v0.0.0-20241128010140-c23617fb13e0 h1:8vJgbqblea6p+Aej1gU5Zlz1Z2D4tWy/rEYerLmr51A= +github.com/curioswitch/go-build v0.0.0-20241128010140-c23617fb13e0/go.mod h1:N585oVwaSkxE9Iwus9TAHJEkoSQ+1/sSNFxFqLzn4iU= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/goyek/goyek/v2 v2.2.0 h1:FXdta04rwVN/HE33XKcBtYht6iaDkJ9Z5Bdh1TdXjO0= +github.com/goyek/goyek/v2 v2.2.0/go.mod h1:mqU0PSD8q3TRCzhJ1mL79/X7FOrXJcpvOtDEBXi92+E= +github.com/goyek/x v0.2.0 h1:vLTzDTqbUQnWTM3NOnejGAWwWZA+hJHElv/cd/3ybQc= +github.com/goyek/x v0.2.0/go.mod h1:I1yv17Zj0g3Zv5iDC+kB9gh3cqJquJSTEgfognEfe94= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= +github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/build/main.go b/build/main.go new file mode 100644 index 0000000..996a6de --- /dev/null +++ b/build/main.go @@ -0,0 +1,173 @@ +package main + +import ( + "bytes" + "fmt" + "os" + "path/filepath" + "strings" + + "github.com/curioswitch/go-build" + "github.com/goyek/goyek/v2" + "github.com/goyek/x/boot" + "github.com/goyek/x/cmd" +) + +func main() { + tags := buildTags() + + build.DefineTasks( + build.Tags(tags...), + build.ExcludeTasks("test-go"), + ) + + build.RegisterTestTask(goyek.Define(goyek.Task{ + Name: "test-go", + Usage: "Runs Go tests.", + Action: func(a *goyek.A) { + mode := strings.ToLower(os.Getenv("RE2_TEST_MODE")) + if mode != "tinygo" { + race := "-race" + if os.Getenv("TEST_NORACE") != "" { + race = "" + } + cmd.Exec(a, fmt.Sprintf(`go test -v -timeout=20m %s -tags "%s" ./...`, race, strings.Join(tags, ","))) + if mode == "" { + cmd.Exec(a, fmt.Sprintf("go build -o %s ./internal/e2e", filepath.Join("out", "test.wasm")), cmd.Env("GOOS", "wasip1"), cmd.Env("GOARCH", "wasm")) + // Could invoke wazero directly but the CLI has a simpler entry point. + cmd.Exec(a, fmt.Sprintf("go run github.com/tetratelabs/wazero/cmd/wazero@v1.7.1 run %s", filepath.Join("out", "test.wasm"))) + } + return + } + + cmd.Exec(a, fmt.Sprintf(`tinygo test -scheduler=none -gc=custom -target=wasip1 -v -tags "%s" ./...`, strings.Join(tags, ","))) + }, + })) + + goyek.Define(goyek.Task{ + Name: "wasm", + Usage: "Builds the WebAssembly module.", + Action: func(a *goyek.A) { + buildWasm(a) + }, + }) + + defineBenchTasks("bench", "./...") + defineBenchTasks("wafbench", "./wafbench") + + boot.Main() +} + +func buildTags() []string { + mode := strings.ToLower(os.Getenv("RE2_TEST_MODE")) + exhaustive := os.Getenv("RE2_TEST_EXHAUSTIVE") == "1" + + var tags []string + switch mode { + case "cgo": + tags = append(tags, "re2_cgo") + case "tinygo": + tags = append(tags, "custommalloc") + } + if exhaustive { + tags = append(tags, "re2_test_exhaustive") + } + + return tags +} + +func buildWasm(a *goyek.A) { + if !cmd.Exec(a, fmt.Sprintf("docker build -t wasilibs-build -f %s .", filepath.Join("buildtools", "re2", "Dockerfile"))) { + return + } + wd, err := os.Getwd() + if err != nil { + a.Fatal(err) + } + wasmDir := filepath.Join(wd, "internal", "wasm") + if err := os.MkdirAll(wasmDir, 0o755); err != nil { + a.Fatal(err) + } + cmd.Exec(a, fmt.Sprintf("docker run --rm -v %s:/out wasilibs-build", wasmDir)) +} + +type benchMode int + +const ( + benchModeWazero benchMode = iota + benchModeCGO + benchModeSTDLib +) + +func benchArgs(pkg string, count int, mode benchMode) string { + args := []string{"test", "-bench=.", "-run=^$", "-v", "-timeout=60m"} + if count > 0 { + args = append(args, fmt.Sprintf("-count=%d", count)) + } + switch mode { + case benchModeCGO: + args = append(args, "-tags=re2_cgo") + case benchModeSTDLib: + args = append(args, "-tags=re2_bench_stdlib") + } + args = append(args, pkg) + + return strings.Join(args, " ") +} + +func defineBenchTasks(name string, pkg string) { + goyek.Define(goyek.Task{ + Name: name, + Usage: "Runs benchmarks in the default configuration for a Go app, using wazero.", + Action: func(a *goyek.A) { + cmd.Exec(a, "go "+benchArgs(pkg, 1, benchModeWazero)) + }, + }) + + goyek.Define(goyek.Task{ + Name: name + "-cgo", + Usage: "Runs benchmarks with re2 accessed using cgo. A C++ toolchain and libre2 must be installed to run.", + Action: func(a *goyek.A) { + cmd.Exec(a, "go "+benchArgs(pkg, 1, benchModeCGO)) + }, + }) + + goyek.Define(goyek.Task{ + Name: name + "-stdlib", + Usage: "Runs benchmarks using the regexp library in the standard library for comparison.", + Action: func(a *goyek.A) { + cmd.Exec(a, "go "+benchArgs(pkg, 1, benchModeSTDLib)) + }, + }) + + goyek.Define(goyek.Task{ + Name: name + "-all", + Usage: "Runs all benchmark types and outputs with benchstat. A C++ toolchain and libre2 must be installed to run.", + Action: func(a *goyek.A) { + if err := os.MkdirAll("out", 0o755); err != nil { + a.Errorf("create out directory: %v", err) + } + + var stdout bytes.Buffer + cmd.Exec(a, "go "+benchArgs(pkg, 5, benchModeWazero), cmd.Stdout(&stdout)) + if err := os.WriteFile(filepath.Join("out", name+".txt"), stdout.Bytes(), 0o644); err != nil { + a.Errorf("write bench.txt: %v", err) + } + + stdout.Reset() + cmd.Exec(a, "go "+benchArgs(pkg, 5, benchModeCGO), cmd.Stdout(&stdout)) + if err := os.WriteFile(filepath.Join("out", name+"-cgo.txt"), stdout.Bytes(), 0o644); err != nil { + a.Errorf("write bench-cgo.txt: %v", err) + } + + stdout.Reset() + cmd.Exec(a, "go "+benchArgs(pkg, 5, benchModeSTDLib), cmd.Stdout(&stdout)) + if err := os.WriteFile(filepath.Join("out", name+"-stdlib.txt"), stdout.Bytes(), 0o644); err != nil { + a.Errorf("write bench-stdlib.txt: %v", err) + } + + cmd.Exec(a, fmt.Sprintf("go run golang.org/x/perf/cmd/benchstat@%s %s %s %s", verBenchstat, + filepath.Join("out", name+"-stdlib.txt"), filepath.Join("out", name+".txt"), filepath.Join("out", name+"-cgo.txt"))) + }, + }) +} diff --git a/build/versions.go b/build/versions.go new file mode 100644 index 0000000..b947c81 --- /dev/null +++ b/build/versions.go @@ -0,0 +1,3 @@ +package main + +var verBenchstat = "v0.0.0-20230221235046-aebcfb61e84c" diff --git a/buildtools/re2/Dockerfile b/buildtools/re2/Dockerfile index 3a40aee..da983b6 100644 --- a/buildtools/re2/Dockerfile +++ b/buildtools/re2/Dockerfile @@ -22,9 +22,9 @@ WORKDIR /cre2 ADD internal/cre2/cre2.cpp /cre2 ADD internal/cre2/cre2.h /cre2 # Just one source file so not worth running make -RUN $CXX -c cre2.cpp -o cre2.o -I. -I/re2 $CXXFLAGS && \ - $AR cru libcre2.a cre2.o && \ - $RANLIB libcre2.a +RUN $CXX -c cre2.cpp -o cre2.o -I. -I/re2 $CXXFLAGS \ + && $AR cru libcre2.a cre2.o \ + && $RANLIB libcre2.a FROM base AS wazero @@ -38,39 +38,39 @@ WORKDIR /cre2 ADD internal/cre2/cre2.cpp /cre2 ADD internal/cre2/cre2.h /cre2 # Just one source file so not worth running make -RUN $CXX -c cre2.cpp -o cre2.o -I. -I/re2 $CXXFLAGS && \ - $AR cru libcre2.a cre2.o && \ - $RANLIB libcre2.a +RUN $CXX -c cre2.cpp -o cre2.o -I. -I/re2 $CXXFLAGS \ + && $AR cru libcre2.a cre2.o \ + && $RANLIB libcre2.a # Separate step so exports can be updated without recompiling. # Number of layers isn't really a concern for this image. # global-base=1024 same as emcc and allows further wasm-opt optimizations RUN $CXX -o libcre2-noopt.so -Wl,--global-base=1024 $LDFLAGS \ - /re2/obj/libre2.a \ - /cre2/libcre2.a \ - -Wl,--import-memory -Wl,--export-memory -Wl,--max-memory=4294967296 \ - -Wl,--export=malloc \ - -Wl,--export=free \ - -Wl,--export=cre2_new \ - -Wl,--export=cre2_delete \ - -Wl,--export=cre2_opt_new \ - -Wl,--export=cre2_opt_delete \ - -Wl,--export=cre2_opt_set_max_mem \ - -Wl,--export=cre2_opt_set_log_errors \ - -Wl,--export=cre2_opt_set_longest_match \ - -Wl,--export=cre2_opt_set_posix_syntax \ - -Wl,--export=cre2_opt_set_case_sensitive \ - -Wl,--export=cre2_opt_set_latin1_encoding \ - -Wl,--export=cre2_error_code \ - -Wl,--export=cre2_error_arg \ - -Wl,--export=cre2_num_capturing_groups \ - -Wl,--export=cre2_match \ - -Wl,--export=cre2_named_groups_iter_new \ - -Wl,--export=cre2_named_groups_iter_next \ - -Wl,--export=cre2_named_groups_iter_delete \ - -Wl,--export=__wasm_init_tls \ - -Wl,--export=__stack_pointer \ - -Wl,--export=__tls_base + /re2/obj/libre2.a \ + /cre2/libcre2.a \ + -Wl,--import-memory -Wl,--export-memory -Wl,--max-memory=4294967296 \ + -Wl,--export=malloc \ + -Wl,--export=free \ + -Wl,--export=cre2_new \ + -Wl,--export=cre2_delete \ + -Wl,--export=cre2_opt_new \ + -Wl,--export=cre2_opt_delete \ + -Wl,--export=cre2_opt_set_max_mem \ + -Wl,--export=cre2_opt_set_log_errors \ + -Wl,--export=cre2_opt_set_longest_match \ + -Wl,--export=cre2_opt_set_posix_syntax \ + -Wl,--export=cre2_opt_set_case_sensitive \ + -Wl,--export=cre2_opt_set_latin1_encoding \ + -Wl,--export=cre2_error_code \ + -Wl,--export=cre2_error_arg \ + -Wl,--export=cre2_num_capturing_groups \ + -Wl,--export=cre2_match \ + -Wl,--export=cre2_named_groups_iter_new \ + -Wl,--export=cre2_named_groups_iter_next \ + -Wl,--export=cre2_named_groups_iter_delete \ + -Wl,--export=__wasm_init_tls \ + -Wl,--export=__stack_pointer \ + -Wl,--export=__tls_base RUN wasm-opt -o libcre2.so --low-memory-unused --flatten --rereloop --converge -O3 libcre2-noopt.so @@ -81,10 +81,10 @@ COPY --from=tinygo /cre2/libcre2.a libcre2.a COPY --from=wazero /cre2/libcre2.so libcre2.so CMD ["cp", \ - "libre2.a", \ - "libcre2.a", \ - "libcre2.so", \ - "/wasi-sysroot/lib/wasm32-wasi/libc++.a", \ - "/wasi-sysroot/lib/wasm32-wasi/libc++abi.a", \ - "/usr/lib/llvm-17/lib/clang/17/lib/wasi/libclang_rt.builtins-wasm32.a", \ - "/out/"] + "libre2.a", \ + "libcre2.a", \ + "libcre2.so", \ + "/wasi-sysroot/lib/wasm32-wasi/libc++.a", \ + "/wasi-sysroot/lib/wasm32-wasi/libc++abi.a", \ + "/usr/lib/llvm-17/lib/clang/17/lib/wasi/libclang_rt.builtins-wasm32.a", \ + "/out/"] diff --git a/go-re2.code-workspace b/go-re2.code-workspace new file mode 100644 index 0000000..7e006f3 --- /dev/null +++ b/go-re2.code-workspace @@ -0,0 +1,24 @@ +{ + "folders": [ + { + "name": "/", + "path": "." + } + ], + "extensions": { + "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] + }, + "settings": { + "editor.formatOnSave": true, + "editor.tabSize": 2, + "eslint.workingDirectories": [{ "mode": "auto" }], + "go.lintFlags": ["--fix"], + "go.lintTool": "golangci-lint", + "gopls": { + "formatting.gofumpt": true + }, + "[yaml]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + } + } +} diff --git a/go.work b/go.work index 4ff9563..f9224fc 100644 --- a/go.work +++ b/go.work @@ -2,8 +2,7 @@ go 1.21 use ( . + ./build ./internal/e2e - ./mage - ./magefiles ./wafbench ) diff --git a/mage/go.mod b/mage/go.mod deleted file mode 100644 index 360101d..0000000 --- a/mage/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module mage - -go 1.20 - -require github.com/magefile/mage v1.15.1-0.20230912152418-9f54e0f83e2a diff --git a/mage/go.sum b/mage/go.sum deleted file mode 100644 index 49ab18d..0000000 --- a/mage/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/magefile/mage v1.15.1-0.20230912152418-9f54e0f83e2a h1:tdPcGgyiH0K+SbsJBBm2oPyEIOTAvLBwD9TuUwVtZho= -github.com/magefile/mage v1.15.1-0.20230912152418-9f54e0f83e2a/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= diff --git a/mage/main.go b/mage/main.go deleted file mode 100644 index 298f01a..0000000 --- a/mage/main.go +++ /dev/null @@ -1,13 +0,0 @@ -// Entrypoint to mage for running without needing to install the command. -// https://magefile.org/zeroinstall/ -package main - -import ( - "os" - - "github.com/magefile/mage/mage" -) - -func main() { - os.Exit(mage.Main()) -} diff --git a/magefiles/go.mod b/magefiles/go.mod deleted file mode 100644 index 09ea71e..0000000 --- a/magefiles/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/wasilibs/go-re2/magefiles - -go 1.21 - -require github.com/magefile/mage v1.15.1-0.20230912152418-9f54e0f83e2a diff --git a/magefiles/go.sum b/magefiles/go.sum deleted file mode 100644 index caf7676..0000000 --- a/magefiles/go.sum +++ /dev/null @@ -1 +0,0 @@ -github.com/magefile/mage v1.15.1-0.20230912152418-9f54e0f83e2a h1:tdPcGgyiH0K+SbsJBBm2oPyEIOTAvLBwD9TuUwVtZho= diff --git a/magefiles/magefile.go b/magefiles/magefile.go deleted file mode 100644 index a0f50ca..0000000 --- a/magefiles/magefile.go +++ /dev/null @@ -1,228 +0,0 @@ -package main - -import ( - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/magefile/mage/mg" - "github.com/magefile/mage/sh" -) - -func buildTags() string { - mode := strings.ToLower(os.Getenv("RE2_TEST_MODE")) - exhaustive := os.Getenv("RE2_TEST_EXHAUSTIVE") == "1" - - var tags []string - switch mode { - case "cgo": - tags = append(tags, "re2_cgo") - case "tinygo": - tags = append(tags, "custommalloc") - } - if exhaustive { - tags = append(tags, "re2_test_exhaustive") - } - - if mode == "tinygo" { - return fmt.Sprintf("'%s'", strings.Join(tags, " ")) - } - return strings.Join(tags, ",") -} - -// Test runs unit tests - by default, it uses wazero; set RE2_TEST_MODE=cgo or RE2_TEST_MODE=tinygo to use either, or -// RE2_TEST_EXHAUSTIVE=1 to enable exhaustive tests that may take a long time. -func Test() error { - mode := strings.ToLower(os.Getenv("RE2_TEST_MODE")) - - if mode != "tinygo" { - race := "-race" - if os.Getenv("TEST_NORACE") != "" { - race = "" - } - if err := sh.RunV("go", "test", "-v", "-timeout=20m", race, "-tags", buildTags(), "./..."); err != nil { - return err - } - - if mode == "" { - if err := sh.RunWithV(map[string]string{"GOOS": "wasip1", "GOARCH": "wasm"}, "go", "build", "-o", filepath.Join("build", "test.wasm"), "./internal/e2e"); err != nil { - return err - } - // Could invoke wazero directly but the CLI has a simpler entry point. - if err := sh.RunV("go", "run", "github.com/tetratelabs/wazero/cmd/wazero@v1.7.1", "run", filepath.Join("build", "test.wasm")); err != nil { - return err - } - } - - return nil - } - - return sh.RunV("tinygo", "test", "-scheduler=none", "-gc=custom", "-target=wasip1", "-v", "-tags", buildTags(), "./...") -} - -func Format() error { - if err := sh.RunV("go", "run", fmt.Sprintf("mvdan.cc/gofumpt@%s", verGoFumpt), "-l", "-w", "."); err != nil { - return err - } - if err := sh.RunV("go", "run", fmt.Sprintf("github.com/rinchsan/gosimports/cmd/gosimports@%s", verGosImports), "-w", - "-local", "github.com/wasilibs/go-re2", - "."); err != nil { - return nil - } - return nil -} - -func Lint() error { - return sh.RunV("go", "run", fmt.Sprintf("github.com/golangci/golangci-lint/cmd/golangci-lint@%s", verGolangCILint), "run", "--build-tags", buildTags(), "--timeout", "5m") -} - -// Check runs lint and tests. -func Check() { - mg.SerialDeps(Lint, Test) -} - -// UpdateLibs updates the precompiled wasm libraries. -func UpdateLibs() error { - if err := sh.RunV("docker", "build", "-t", "ghcr.io/wasilibs/go-re2/buildtools-re2", "-f", filepath.Join("buildtools", "re2", "Dockerfile"), "."); err != nil { - return err - } - wd, err := os.Getwd() - if err != nil { - return err - } - return sh.RunV("docker", "run", "--rm", "-v", fmt.Sprintf("%s:/out", filepath.Join(wd, "internal", "wasm")), "ghcr.io/wasilibs/go-re2/buildtools-re2") -} - -// Bench runs benchmarks in the default configuration for a Go app, using wazero. -func Bench() error { - return sh.RunV("go", benchArgs("./...", 1, benchModeWazero)...) -} - -// BenchCGO runs benchmarks with re2 accessed using cgo. A C++ toolchain and libre2 must be installed to run. -func BenchCGO() error { - return sh.RunV("go", benchArgs("./...", 1, benchModeCGO)...) -} - -// BenchSTDLib runs benchmarks using the regexp library in the standard library for comparison. -func BenchSTDLib() error { - return sh.RunV("go", benchArgs("./...", 1, benchModeSTDLib)...) -} - -// BenchAll runs all benchmark types and outputs with benchstat. A C++ toolchain and libre2 must be installed to run. -func BenchAll() error { - if err := os.MkdirAll("build", 0o755); err != nil { - return err - } - - fmt.Println("Executing wazero benchmarks") - wazero, err := sh.Output("go", benchArgs("./...", 5, benchModeWazero)...) - if err != nil { - fmt.Printf("Error running wazero benchmarks:\n%s", wazero) - return err - } - if err := os.WriteFile(filepath.Join("build", "bench.txt"), []byte(wazero), 0o644); err != nil { - return err - } - - fmt.Println("Executing cgo benchmarks") - cgo, err := sh.Output("go", benchArgs("./...", 5, benchModeCGO)...) - if err != nil { - fmt.Printf("Error running cgo benchmarks:\n%s", cgo) - return err - } - if err := os.WriteFile(filepath.Join("build", "bench_cgo.txt"), []byte(cgo), 0o644); err != nil { - return err - } - - fmt.Println("Executing stdlib benchmarks") - stdlib, err := sh.Output("go", benchArgs("./...", 5, benchModeSTDLib)...) - if err != nil { - fmt.Printf("Error running stdlib benchmarks:\n%s", stdlib) - return err - } - if err := os.WriteFile(filepath.Join("build", "bench_stdlib.txt"), []byte(stdlib), 0o644); err != nil { - return err - } - - return sh.RunV("go", "run", fmt.Sprintf("golang.org/x/perf/cmd/benchstat@%s", verBenchstat), - "build/bench_stdlib.txt", "build/bench.txt", "build/bench_cgo.txt") -} - -// WAFBench runs benchmarks in the default configuration for a Go app, using wazero. -func WAFBench() error { - return sh.RunV("go", benchArgs("./wafbench", 1, benchModeWazero)...) -} - -// WAFBenchCGO runs benchmarks with re2 accessed using cgo. A C++ toolchain and libre2 must be installed to run. -func WAFBenchCGO() error { - return sh.RunV("go", benchArgs("./wafbench", 1, benchModeCGO)...) -} - -// WAFBenchSTDLib runs benchmarks using the regexp library in the standard library for comparison. -func WAFBenchSTDLib() error { - return sh.RunV("go", benchArgs("./wafbench", 1, benchModeSTDLib)...) -} - -// WAFBenchAll runs all benchmark types and outputs with benchstat. A C++ toolchain and libre2 must be installed to run. -func WAFBenchAll() error { - if err := os.MkdirAll("build", 0o755); err != nil { - return err - } - - fmt.Println("Executing wazero benchmarks") - wazero, err := sh.Output("go", benchArgs("./wafbench", 5, benchModeWazero)...) - if err != nil { - return err - } - if err := os.WriteFile(filepath.Join("build", "wafbench.txt"), []byte(wazero), 0o644); err != nil { - return err - } - - fmt.Println("Executing cgo benchmarks") - cgo, err := sh.Output("go", benchArgs("./wafbench", 5, benchModeCGO)...) - if err != nil { - return err - } - if err := os.WriteFile(filepath.Join("build", "wafbench_cgo.txt"), []byte(cgo), 0o644); err != nil { - return err - } - - fmt.Println("Executing stdlib benchmarks") - stdlib, err := sh.Output("go", benchArgs("./wafbench", 5, benchModeSTDLib)...) - if err != nil { - return err - } - if err := os.WriteFile(filepath.Join("build", "wafbench_stdlib.txt"), []byte(stdlib), 0o644); err != nil { - return err - } - - return sh.RunV("go", "run", fmt.Sprintf("golang.org/x/perf/cmd/benchstat@%s", verBenchstat), - "build/wafbench_stdlib.txt", "build/wafbench.txt", "build/wafbench_cgo.txt") -} - -var Default = Test - -type benchMode int - -const ( - benchModeWazero benchMode = iota - benchModeCGO - benchModeSTDLib -) - -func benchArgs(pkg string, count int, mode benchMode) []string { - args := []string{"test", "-bench=.", "-run=^$", "-v", "-timeout=60m"} - if count > 0 { - args = append(args, fmt.Sprintf("-count=%d", count)) - } - switch mode { - case benchModeCGO: - args = append(args, "-tags=re2_cgo") - case benchModeSTDLib: - args = append(args, "-tags=re2_bench_stdlib") - } - args = append(args, pkg) - - return args -} diff --git a/magefiles/versions.go b/magefiles/versions.go deleted file mode 100644 index c76d948..0000000 --- a/magefiles/versions.go +++ /dev/null @@ -1,8 +0,0 @@ -package main - -var ( - verBenchstat = "v0.0.0-20230221235046-aebcfb61e84c" - verGolangCILint = "v1.60.3" - verGoFumpt = "v0.6.0" - verGosImports = "v0.3.8" -) diff --git a/wafbench/.ftw.yml b/wafbench/.ftw.yml index 72d5b29..0eb7a7c 100644 --- a/wafbench/.ftw.yml +++ b/wafbench/.ftw.yml @@ -1,50 +1,50 @@ --- testoverride: ignore: - 920100-4: '' - 920100-5: '' - 920100-8: '' - 920170-3: '' - 920171-2: '' - 920171-3: '' - 920270-4: '' - 920272-5: '' - 920280-1: '' - 920280-3: '' - 920290-1: '' - 920420-8: '' - 920430-3: '' - 920430-5: '' - 920430-8: '' - 920430-9: '' - 921180-2: '' - 921180-4: '' - 921180-5: '' - 921180-6: '' - 932130-12: '' - 932130-13: '' - 932130-14: '' - 932130-15: '' - 932130-16: '' - 934120-23: '' - 934120-24: '' - 934120-25: '' - 934120-26: '' - 934120-39: '' - 934130-7: '' - 934130-8: '' - 934130-9: '' - 934130-10: '' - 934130-11: '' - 934131-1: '' - 941310-1: '' - 941310-3: '' - 942190-42: '' - 942440-16: '' - 942440-17: '' - 942440-18: '' - 942522-7: '' - 944200-1: '' - 954100-0: '' - 980170-0: '' - 980170-1: '' \ No newline at end of file + 920100-4: "" + 920100-5: "" + 920100-8: "" + 920170-3: "" + 920171-2: "" + 920171-3: "" + 920270-4: "" + 920272-5: "" + 920280-1: "" + 920280-3: "" + 920290-1: "" + 920420-8: "" + 920430-3: "" + 920430-5: "" + 920430-8: "" + 920430-9: "" + 921180-2: "" + 921180-4: "" + 921180-5: "" + 921180-6: "" + 932130-12: "" + 932130-13: "" + 932130-14: "" + 932130-15: "" + 932130-16: "" + 934120-23: "" + 934120-24: "" + 934120-25: "" + 934120-26: "" + 934120-39: "" + 934130-7: "" + 934130-8: "" + 934130-9: "" + 934130-10: "" + 934130-11: "" + 934131-1: "" + 941310-1: "" + 941310-3: "" + 942190-42: "" + 942440-16: "" + 942440-17: "" + 942440-18: "" + 942522-7: "" + 944200-1: "" + 954100-0: "" + 980170-0: "" + 980170-1: "" diff --git a/wafbench/go.sum b/wafbench/go.sum index 9e44116..6df4bf7 100644 --- a/wafbench/go.sum +++ b/wafbench/go.sum @@ -63,6 +63,7 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6FI= +github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= @@ -193,6 +194,7 @@ github.com/kyokomi/emoji v2.2.4+incompatible/go.mod h1:mZ6aGCD7yk8j6QY6KICwnZ2px github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/magefile/mage v1.15.1-0.20230912152418-9f54e0f83e2a h1:tdPcGgyiH0K+SbsJBBm2oPyEIOTAvLBwD9TuUwVtZho= +github.com/magefile/mage v1.15.1-0.20230912152418-9f54e0f83e2a/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -213,6 +215,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= +github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -241,6 +244,7 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.9.1 h1:a6qW1EVNZWH9WGI6CsYdD8WAylkoXBS5yv0XHlh17Tc= +github.com/pelletier/go-toml v1.9.1/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/petar-dambovaliev/aho-corasick v0.0.0-20211021192214-5ab2d9280aa9 h1:lL+y4Xv20pVlCGyLzNHRC0I0rIHhIL1lTvHizoS/dU8= github.com/petar-dambovaliev/aho-corasick v0.0.0-20211021192214-5ab2d9280aa9/go.mod h1:EHPiTAKtiFmrMldLUNswFwfZ2eJIYBHktdaUTZxYWRw= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -288,7 +292,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tetratelabs/wazero v1.8.0 h1:iEKu0d4c2Pd+QSRieYbnQC9yiFlMS9D+Jr0LsRmcF4g= +github.com/tetratelabs/wazero v1.8.0/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs= github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw= github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= @@ -297,7 +303,9 @@ github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/wasilibs/nottinygc v0.4.0 h1:h1TJMihMC4neN6Zq+WKpLxgd9xCFMw7O9ETLwY2exJQ= +github.com/wasilibs/nottinygc v0.4.0/go.mod h1:oDcIotskuYNMpqMF23l7Z8uzD4TC0WXHK8jetlB3HIo= github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52 h1:OvLBa8SqJnZ6P+mjlzc2K7PM22rRUPE1x32G9DTPrC4= +github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52/go.mod h1:jMeV4Vpbi8osrE/pKUxRZkVaA0EX7NZN0A9/oRzgpgY= github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc= github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -326,6 +334,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -392,6 +401,7 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -412,6 +422,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=