@@ -127,7 +127,7 @@ func runBuild(mode bind.BuildMode, cfg *BuildCfg) error {
127127 cmd = exec .Command (cfg .VM , "build.py" )
128128 cmd .Run () // will fail, we don't care about errors
129129
130- args := []string {"build" , "-buildmode=c-shared" , "-o" , buildname + libExt , "." }
130+ args := []string {"build" , "-mod=mod" , "- buildmode=c-shared" , "-o" , buildname + libExt , "." }
131131 fmt .Printf ("go %v\n " , strings .Join (args , " " ))
132132 cmd = exec .Command ("go" , args ... )
133133 cmdout , err = cmd .CombinedOutput ()
@@ -147,7 +147,7 @@ func runBuild(mode bind.BuildMode, cfg *BuildCfg) error {
147147 err = os .Remove (cfg .Name + "_go" + libExt )
148148
149149 fmt .Printf ("go build -o py%s\n " , cfg .Name )
150- cmd = exec .Command ("go" , "build" , "-o" , "py" + cfg .Name )
150+ cmd = exec .Command ("go" , "build" , "-mod=mod" , "- o" , "py" + cfg .Name )
151151 cmdout , err = cmd .CombinedOutput ()
152152 if err != nil {
153153 fmt .Printf ("cmd had error: %v output:\n %v\n " , err , string (cmdout ))
@@ -167,7 +167,7 @@ func runBuild(mode bind.BuildMode, cfg *BuildCfg) error {
167167
168168 // build the go shared library upfront to generate the header
169169 // needed by our generated cpython code
170- args := []string {"build" , "-buildmode=c-shared" }
170+ args := []string {"build" , "-mod=mod" , "- buildmode=c-shared" }
171171 if ! cfg .Symbols {
172172 // These flags will omit the various symbol tables, thereby
173173 // reducing the final size of the binary. From https://golang.org/cmd/link/
0 commit comments