@@ -3,19 +3,20 @@ package doltgres_builder
33import (
44 "context"
55 "fmt"
6- builder "github.com/dolthub/dolt/go/performance/utils/dolt_builder"
7- "golang.org/x/sync/errgroup"
86 "os"
97 "os/signal"
108 "path/filepath"
119 "runtime"
1210 "sync"
1311 "syscall"
12+
13+ builder "github.com/dolthub/dolt/go/performance/utils/dolt_builder"
14+ "golang.org/x/sync/errgroup"
1415)
1516
1617const envDoltgresBin = "DOLTGRES_BIN"
1718
18- func Run (parentCtx context.Context , parserScriptPath string , commitList []string ) error {
19+ func Run (parentCtx context.Context , commitList []string ) error {
1920 doltgresBin , err := getDoltgresBin ()
2021 if err != nil {
2122 return err
@@ -65,7 +66,7 @@ func Run(parentCtx context.Context, parserScriptPath string, commitList []string
6566 for _ , commit := range commitList {
6667 commit := commit // https://golang.org/doc/faq#closures_and_goroutines
6768 g .Go (func () error {
68- return buildBinaries (ctx , parserScriptPath , tempDir , repoDir , doltgresBin , commit )
69+ return buildBinaries (ctx , tempDir , repoDir , doltgresBin , commit )
6970 })
7071 }
7172
@@ -113,8 +114,8 @@ func getDoltgresBin() (string, error) {
113114 return doltgresBin , nil
114115}
115116
116- // buildBinaries builds a dolt binary at the given commit and stores it in the doltBin
117- func buildBinaries (ctx context.Context , parserScriptPath , tempDir , repoDir , doltBinDir , commit string ) error {
117+ // buildBinaries builds a doltgres binary at the given commit and stores it in the doltgresBin
118+ func buildBinaries (ctx context.Context , tempDir , repoDir , doltgresBinDir , commit string ) error {
118119 checkoutDir := filepath .Join (tempDir , commit )
119120 if err := os .MkdirAll (checkoutDir , os .ModePerm ); err != nil {
120121 return err
@@ -125,11 +126,13 @@ func buildBinaries(ctx context.Context, parserScriptPath, tempDir, repoDir, dolt
125126 return err
126127 }
127128
128- commitDir := filepath .Join (doltBinDir , commit )
129+ commitDir := filepath .Join (doltgresBinDir , commit )
129130 if err := os .MkdirAll (commitDir , os .ModePerm ); err != nil {
130131 return err
131132 }
132133
134+ parserScriptPath := filepath .Join (checkoutDir , "postgres" , "parser" , "build.sh" )
135+
133136 command , err := goBuild (ctx , parserScriptPath , checkoutDir , commitDir )
134137 if err != nil {
135138 return err
@@ -162,9 +165,9 @@ func goBuild(ctx context.Context, parserScriptPath, source, dest string) (string
162165
163166// doltgresVersion prints doltgres version of binary
164167func doltgresVersion (ctx context.Context , dir , command string ) error {
165- doltVersion := builder .ExecCommand (ctx , command , "version" )
166- doltVersion .Stderr = os .Stderr
167- doltVersion .Stdout = os .Stdout
168- doltVersion .Dir = dir
169- return doltVersion .Run ()
168+ doltgresVersion := builder .ExecCommand (ctx , command , "version" )
169+ doltgresVersion .Stderr = os .Stderr
170+ doltgresVersion .Stdout = os .Stdout
171+ doltgresVersion .Dir = dir
172+ return doltgresVersion .Run ()
170173}
0 commit comments