MCPcopy Create free account
hub / github.com/dolthub/doltgresql / goBuild

Function goBuild

utils/doltgres_builder/run.go:146–166  ·  view source on GitHub ↗

goBuild builds the doltgres parser and doltgres binary and returns the filename for the doltgres binary

(ctx context.Context, parserScriptPath, doltgresCommandPath, source, dest string)

Source from the content-addressed store, hash-verified

144
145// goBuild builds the doltgres parser and doltgres binary and returns the filename for the doltgres binary
146func goBuild(ctx context.Context, parserScriptPath, doltgresCommandPath, source, dest string) (string, error) {
147 buildParser := builder.ExecCommand(ctx, "/bin/bash", "-c", parserScriptPath)
148 err := buildParser.Run()
149 if err != nil {
150 return "", err
151 }
152
153 doltgresFileName := "doltgres"
154 if runtime.GOOS == "windows" {
155 doltgresFileName = "doltgres.exe"
156 }
157 toBuild := filepath.Join(dest, doltgresFileName)
158
159 build := builder.ExecCommand(ctx, "go", "build", "-o", toBuild, doltgresCommandPath)
160 build.Dir = source
161 err = build.Run()
162 if err != nil {
163 return "", err
164 }
165 return toBuild, nil
166}
167
168// doltgresVersion prints doltgres version of binary
169func doltgresVersion(ctx context.Context, dir, command string) error {

Callers 1

buildBinariesFunction · 0.85

Calls 1

RunMethod · 0.80

Tested by

no test coverage detected