Skip to content

Commit

Permalink
revert go file mod change
Browse files Browse the repository at this point in the history
  • Loading branch information
xhd2015 committed Mar 30, 2024
1 parent 6d745e9 commit b1b2157
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/xgo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func handleBuild(cmd string, args []string) error {
}
}

if isDevelopment && (setupDev || buildCompiler) {
if isDevelopment && setupDev {
logDebug("setup dev dir: %s", instrumentGoroot)
err := setupDevDir(instrumentGoroot, setupDev)
if err != nil {
Expand All @@ -328,7 +328,7 @@ func handleBuild(cmd string, args []string) error {
var compilerChanged bool
var toolExecFlag string
if !noInstrument {
logDebug("setup dev dir: %s", instrumentGoroot)
logDebug("build instrument tools: %s", instrumentGoroot)
compilerChanged, toolExecFlag, err = buildInstrumentTool(instrumentGoroot, realXgoSrc, compilerBin, compilerBuildID, execToolBin, debug, logCompile, noSetup, debugWithDlv)
if err != nil {
return err
Expand Down
7 changes: 6 additions & 1 deletion cmd/xgo/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,14 @@ func syncGoroot(goroot string, dstDir string, forceCopy bool) error {

// need copy, delete target dst dir first
// TODO: use git worktree add if .git exists
return filecopy.NewOptions().
err = filecopy.NewOptions().
Concurrent(10).
CopyReplaceDir(goroot, dstDir)
if err != nil {
return err
}
// change binary executable
return nil
}

func buildInstrumentTool(goroot string, xgoSrc string, compilerBin string, compilerBuildIDFile string, execToolBin string, debugPkg string, logCompile bool, noSetup bool, debugWithDlv bool) (compilerChanged bool, toolExecFlag string, err error) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/xgo/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import "fmt"

const VERSION = "1.0.11"
const REVISION = "fab09bf4d2639a63f487304bd91d4eaa40788dbb+1"
const NUMBER = 141
const REVISION = "6d745e9f6947feaad746282a0b03a87fc335678b+1"
const NUMBER = 142

func getRevision() string {
return fmt.Sprintf("%s %s BUILD_%d", VERSION, REVISION, NUMBER)
Expand Down
4 changes: 2 additions & 2 deletions runtime/core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

const VERSION = "1.0.11"
const REVISION = "fab09bf4d2639a63f487304bd91d4eaa40788dbb+1"
const NUMBER = 141
const REVISION = "6d745e9f6947feaad746282a0b03a87fc335678b+1"
const NUMBER = 142

// these fields will be filled by compiler
const XGO_VERSION = ""
Expand Down
2 changes: 1 addition & 1 deletion support/filecopy/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func copyFile(src string, dst string, mkdirs bool, buf []byte) error {
}
}

writer, err := os.Create(dst)
writer, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755)
if err != nil {
return err
}
Expand Down

0 comments on commit b1b2157

Please sign in to comment.