Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go/tools/builders/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ func simpleName(name string, names map[string]struct{}) (string, error) {
}

func appendFiles(goenv *env, archive string, files []string) error {
archive = abs(archive) // required for long filenames on Windows.

// Create an empty archive if one doesn't already exist.
// In Go 1.16, 'go tool pack r' reports an error if the archive doesn't exist.
// 'go tool pack c' copies export data in addition to creating the archive,
Expand Down
6 changes: 6 additions & 0 deletions go/tools/builders/protoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
)

Expand Down Expand Up @@ -77,6 +78,11 @@ func run(args []string) error {
for _, m := range imports {
options = append(options, fmt.Sprintf("M%v", m))
}
if runtime.GOOS == "windows" {
// Turn the plugin path into raw form, since we're handing it off to a non-go binary.
// This is required to work with long paths on Windows.
*plugin = "\\\\?\\" + abs(*plugin)
}
protoc_args := []string{
fmt.Sprintf("--%v_out=%v:%v", pluginName, strings.Join(options, ","), tmpDir),
"--plugin", fmt.Sprintf("%v=%v", strings.TrimSuffix(pluginBase, ".exe"), *plugin),
Expand Down