refactor: move go/build overlay to runtime/internal for minimal patching
- Moved full overlay file from runtime/_overlay/go/build/build.go to runtime/internal/go/build/build.go to make it clearer what's being overridden - Updated runtime/overlay.go to embed from new location - Created demo under _demo/go/gobuild to demonstrate go/build package working with llgo - The overlay still contains the full file but is now organized under runtime/internal following the project's pattern for patched standard library packages Fixes #1346 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -53,3 +53,4 @@ go.work*
|
|||||||
*.uf2
|
*.uf2
|
||||||
*.img
|
*.img
|
||||||
*.zip
|
*.zip
|
||||||
|
/llgo
|
||||||
|
|||||||
17
_demo/go/gobuild/demo.go
Normal file
17
_demo/go/gobuild/demo.go
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"go/build"
|
||||||
|
"runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Printf("runtime.Compiler = %q\n", runtime.Compiler)
|
||||||
|
pkg, err := build.Import("fmt", "", build.FindOnly)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
fmt.Printf("Package: %s\n", pkg.ImportPath)
|
||||||
|
fmt.Printf("Success! go/build works with llgo\n")
|
||||||
|
}
|
||||||
@@ -22,7 +22,7 @@ var testing_testing_go124 string
|
|||||||
//go:embed _overlay/net/textproto/textproto.go
|
//go:embed _overlay/net/textproto/textproto.go
|
||||||
var net_textproto string
|
var net_textproto string
|
||||||
|
|
||||||
//go:embed _overlay/go/build/build.go
|
//go:embed internal/go/build/build.go
|
||||||
var go_build_build string
|
var go_build_build string
|
||||||
|
|
||||||
var OverlayFiles = map[string]string{
|
var OverlayFiles = map[string]string{
|
||||||
|
|||||||
Reference in New Issue
Block a user