]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: revert "remove -installsuffix flag"
authorMatthew Dempsky <mdempsky@google.com>
Mon, 18 Jul 2022 17:03:30 +0000 (17:03 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 18 Jul 2022 18:00:52 +0000 (18:00 +0000)
This reverts CL 415236 (commit 558785a0a9df5fbb7e9617c05059cf2892884620).

Reason for revert: Google's internal build system uses -installsuffix.
Restoring -installsuffix for Go 1.19, and will try again for Go 1.20.

Change-Id: Id6571f34f99f01bcf55e8e949e6fe7b6c1896134
Reviewed-on: https://go-review.googlesource.com/c/go/+/418036
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/doc.go
src/cmd/compile/internal/base/flag.go
src/cmd/compile/internal/noder/import.go
src/cmd/go/internal/work/gc.go

index f4cfcda8076def8fb8f2013985f364a57e4fad28..60e12630c5580eb217d4f51c71fb5a7c5a7fd346 100644 (file)
@@ -68,6 +68,9 @@ Flags:
        -importcfg file
                Read import configuration from file.
                In the file, set importmap, packagefile to specify import resolution.
+       -installsuffix suffix
+               Look for packages in $GOROOT/pkg/$GOOS_$GOARCH_suffix
+               instead of $GOROOT/pkg/$GOOS_$GOARCH.
        -l
                Disable inlining.
        -lang version
index e8b3f55ba4977788532db0b6c29da692a34c3ff3..a363b83984785496504b2f4c8b4fd9a85035187d 100644 (file)
@@ -100,6 +100,7 @@ type CmdFlags struct {
        GenDwarfInl        int          "help:\"generate DWARF inline info records\"" // 0=disabled, 1=funcs, 2=funcs+formals/locals
        GoVersion          string       "help:\"required version of the runtime\""
        ImportCfg          func(string) "help:\"read import configuration from `file`\""
+       InstallSuffix      string       "help:\"set pkg directory `suffix`\""
        JSON               string       "help:\"version,file for JSON compiler/optimizer detail output\""
        Lang               string       "help:\"Go language version source code expects\""
        LinkObj            string       "help:\"write linker-specific object to `file`\""
index f718c8db5d066b043945b3d97e5e8aa638034ff0..2cef9f75e80e9db0e9c408b241ebca8abd57ecdb 100644 (file)
@@ -102,7 +102,9 @@ func openPackage(path string) (*os.File, error) {
 
        if buildcfg.GOROOT != "" {
                suffix := ""
-               if base.Flag.Race {
+               if base.Flag.InstallSuffix != "" {
+                       suffix = "_" + base.Flag.InstallSuffix
+               } else if base.Flag.Race {
                        suffix = "_race"
                } else if base.Flag.MSan {
                        suffix = "_msan"
index 4fa1126adeae01f185cf18e266b1a70be62c143a..842952911554efeec715b189436e46f44dcc4803 100644 (file)
@@ -128,6 +128,9 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg, embedcfg
        if extFiles == 0 {
                defaultGcFlags = append(defaultGcFlags, "-complete")
        }
+       if cfg.BuildContext.InstallSuffix != "" {
+               defaultGcFlags = append(defaultGcFlags, "-installsuffix", cfg.BuildContext.InstallSuffix)
+       }
        if a.buildID != "" {
                defaultGcFlags = append(defaultGcFlags, "-buildid", a.buildID)
        }