File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,6 @@ You may need to use the flags --cpu=x64_windows --compiler=mingw-gcc.`)
81
81
os .Setenv ("GO111MODULE" , "off" )
82
82
83
83
// Make sure we have an absolute path to the C compiler.
84
- // TODO(#1357): also take absolute paths of includes and other paths in flags.
85
84
os .Setenv ("CC" , quotePathIfNeeded (abs (os .Getenv ("CC" ))))
86
85
87
86
// Ensure paths are absolute.
@@ -159,7 +158,7 @@ You may need to use the flags --cpu=x64_windows --compiler=mingw-gcc.`)
159
158
installArgs = append (installArgs , "-ldflags=" + allSlug + strings .Join (ldflags , " " ))
160
159
installArgs = append (installArgs , "-asmflags=" + allSlug + strings .Join (asmflags , " " ))
161
160
162
- // Modifying CGO flags to use only absolute path
161
+ // Modify CGO flags to use only absolute path
163
162
// because go is having its own sandbox, all CGO flags must use absolute path
164
163
if err := absEnv (cgoEnvVars , cgoAbsEnvFlags ); err != nil {
165
164
return fmt .Errorf ("error modifying cgo environment to absolute path: %v" , err )
Original file line number Diff line number Diff line change @@ -251,13 +251,18 @@ func stdliblist(args []string) error {
251
251
252
252
cgoEnabled := os .Getenv ("CGO_ENABLED" ) == "1"
253
253
// Make sure we have an absolute path to the C compiler.
254
- // TODO(#1357): also take absolute paths of includes and other paths in flags.
255
254
ccEnv , ok := os .LookupEnv ("CC" )
256
255
if cgoEnabled && ! ok {
257
256
return fmt .Errorf ("CC must be set" )
258
257
}
259
258
os .Setenv ("CC" , quotePathIfNeeded (abs (ccEnv )))
260
259
260
+ // Modify CGO flags to use only absolute path
261
+ // because go is having its own sandbox, all CGO flags must use absolute path
262
+ if err := absEnv (cgoEnvVars , cgoAbsEnvFlags ); err != nil {
263
+ return fmt .Errorf ("error modifying cgo environment to absolute path: %v" , err )
264
+ }
265
+
261
266
// We want to keep the cache around so that the processed files can be used by other tools.
262
267
absCachePath := abs (* cachePath )
263
268
os .Setenv ("GOCACHE" , absCachePath )
You can’t perform that action at this time.
0 commit comments