Skip to content

Commit

Permalink
split load dep and add blank import
Browse files Browse the repository at this point in the history
  • Loading branch information
xhd2015 committed Apr 21, 2024
1 parent c1e173c commit ee13987
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 105 deletions.
12 changes: 9 additions & 3 deletions cmd/xgo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ func handleBuild(cmd string, args []string) error {
execCmdEnv := os.Environ()
var execCmd *exec.Cmd
if !cmdExec {
if modfile != "" {
// make modfile absolute
modfile, err = filepath.Abs(modfile)
if err != nil {
return nil
}
}
instrumentGo := filepath.Join(instrumentGoroot, "bin", "go")
subPaths, mainModule, err := goinfo.ResolveMainModule(projectDir, remainArgs)
if err != nil {
Expand All @@ -373,9 +380,8 @@ func handleBuild(cmd string, args []string) error {
impResult, impRuntimeErr := importRuntimeDep(cmdTest, instrumentGoroot, instrumentGo, goVersion, modfile, realXgoSrc, projectDir, subPaths, mainModule, mod, remainArgs)
if impRuntimeErr != nil {
// can be silently ignored
fmt.Fprintf(os.Stderr, "WARNING: --strace requires: import _ %q\n failed to auto import %s: %v\n", TRACE_PKG, TRACE_PKG, impRuntimeErr)
}
if impResult != nil {
fmt.Fprintf(os.Stderr, "WARNING: --strace requires: import _ %q\n failed to auto import %s: %v\n", RUNTIME_TRACE_PKG, RUNTIME_TRACE_PKG, impRuntimeErr)
} else if impResult != nil {
overlay = impResult.overlayFile
if impResult.mod != "" {
mod = impResult.mod
Expand Down
4 changes: 2 additions & 2 deletions cmd/xgo/runtime_gen/core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

const VERSION = "1.0.25"
const REVISION = "4e07bbae9c2c6c3dc7acf471b763a7fed0fcd66d+1"
const NUMBER = 196
const REVISION = "6a13d77b507fde52f56e8fa8db12e89b2a325a5e+1"
const NUMBER = 197

// these fields will be filled by compiler
const XGO_VERSION = ""
Expand Down
Loading

0 comments on commit ee13987

Please sign in to comment.