MCPcopy Create free account
hub / github.com/apecloud/myduckserver / initializeDevBuild

Function initializeDevBuild

testutil/testutil.go:186–215  ·  view source on GitHub ↗
(dir string, goDirPath string)

Source from the content-addressed store, hash-verified

184 }
185
186 return database.Ping()
187}
188
189var cachedDevBuildPath = ""
190
191func initializeDevBuild(dir string, goDirPath string) string {
192 if cachedDevBuildPath != "" {
193 return cachedDevBuildPath
194 }
195
196 // If we're not in a CI environment, don't worry about building a dev build
197 if os.Getenv("CI") != "true" {
198 return ""
199 }
200
201 basedir := filepath.Dir(filepath.Dir(dir))
202 fullpath := filepath.Join(basedir, fmt.Sprintf("dev-build-%d", os.Getpid()))
203
204 _, err := os.Stat(fullpath)
205 if err == nil {
206 return fullpath
207 }
208
209 fmt.Printf("building dev build at: %s \n", fullpath)
210 cmd := exec.Command("go", "build", "-tags=duckdb_arrow", "-o", fullpath)
211 cmd.Dir = goDirPath
212
213 output, err := cmd.CombinedOutput()
214 if err != nil {
215 panic("unable to build dolt for binlog integration tests: " + err.Error() + "\nFull output: " + string(output) + "\n")
216 }
217 cachedDevBuildPath = fullpath
218

Callers 1

StartDuckSqlServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected