MM-11366: support a plugin bundle with multiple executables (#9121)

This avoids the need to distribute multiple plugins per architecture.
Этот коммит содержится в:
Jesse Hallam
2018-07-17 18:47:05 -04:00
коммит произвёл Christopher Speller
родитель f2c1803905
Коммит e718d2544f
3 изменённых файлов: 218 добавлений и 4 удалений

Просмотреть файл

@@ -7,6 +7,7 @@ import (
"fmt"
"os/exec"
"path/filepath"
"runtime"
"strings"
"time"
@@ -39,7 +40,10 @@ func newSupervisor(pluginInfo *model.BundleInfo, parentLogger *mlog.Logger, apiI
},
}
executable := filepath.Clean(filepath.Join(".", pluginInfo.Manifest.Backend.Executable))
executable := filepath.Clean(filepath.Join(
".",
pluginInfo.Manifest.GetExecutableForRuntime(runtime.GOOS, runtime.GOARCH),
))
if strings.HasPrefix(executable, "..") {
return nil, fmt.Errorf("invalid backend executable")
}