@@ -3,19 +3,20 @@ package doltgres_builder
3
3
import (
4
4
"context"
5
5
"fmt"
6
- builder "github.com/dolthub/dolt/go/performance/utils/dolt_builder"
7
- "golang.org/x/sync/errgroup"
8
6
"os"
9
7
"os/signal"
10
8
"path/filepath"
11
9
"runtime"
12
10
"sync"
13
11
"syscall"
12
+
13
+ builder "github.com/dolthub/dolt/go/performance/utils/dolt_builder"
14
+ "golang.org/x/sync/errgroup"
14
15
)
15
16
16
17
const envDoltgresBin = "DOLTGRES_BIN"
17
18
18
- func Run (parentCtx context.Context , parserScriptPath string , commitList []string ) error {
19
+ func Run (parentCtx context.Context , commitList []string ) error {
19
20
doltgresBin , err := getDoltgresBin ()
20
21
if err != nil {
21
22
return err
@@ -65,7 +66,7 @@ func Run(parentCtx context.Context, parserScriptPath string, commitList []string
65
66
for _ , commit := range commitList {
66
67
commit := commit // https://golang.org/doc/faq#closures_and_goroutines
67
68
g .Go (func () error {
68
- return buildBinaries (ctx , parserScriptPath , tempDir , repoDir , doltgresBin , commit )
69
+ return buildBinaries (ctx , tempDir , repoDir , doltgresBin , commit )
69
70
})
70
71
}
71
72
@@ -113,8 +114,8 @@ func getDoltgresBin() (string, error) {
113
114
return doltgresBin , nil
114
115
}
115
116
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 {
118
119
checkoutDir := filepath .Join (tempDir , commit )
119
120
if err := os .MkdirAll (checkoutDir , os .ModePerm ); err != nil {
120
121
return err
@@ -125,11 +126,13 @@ func buildBinaries(ctx context.Context, parserScriptPath, tempDir, repoDir, dolt
125
126
return err
126
127
}
127
128
128
- commitDir := filepath .Join (doltBinDir , commit )
129
+ commitDir := filepath .Join (doltgresBinDir , commit )
129
130
if err := os .MkdirAll (commitDir , os .ModePerm ); err != nil {
130
131
return err
131
132
}
132
133
134
+ parserScriptPath := filepath .Join (checkoutDir , "postgres" , "parser" , "build.sh" )
135
+
133
136
command , err := goBuild (ctx , parserScriptPath , checkoutDir , commitDir )
134
137
if err != nil {
135
138
return err
@@ -162,9 +165,9 @@ func goBuild(ctx context.Context, parserScriptPath, source, dest string) (string
162
165
163
166
// doltgresVersion prints doltgres version of binary
164
167
func 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 ()
170
173
}
0 commit comments