Chromium Code Reviews| Index: experimental/webtry/webtry.go |
| diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go |
| index a4fe9e0ef5a12c75a2cbfa655049c8cb05c46e65..539421074932c1f285fe575b01dc897a9937066e 100644 |
| --- a/experimental/webtry/webtry.go |
| +++ b/experimental/webtry/webtry.go |
| @@ -200,7 +200,7 @@ func init() { |
| // |
| // f672cead70404080a991ebfb86c38316a4589b23 2014-04-27 19:21:51 +0000 |
| // |
| - logOutput, err := doCmd(`git log --format=%H%x20%ai HEAD^..HEAD`, true) |
| + logOutput, err := doCmd(`git log --format=%H%x20%ai HEAD^..HEAD`) |
| if err != nil { |
| panic(err) |
| } |
| @@ -394,9 +394,10 @@ type response struct { |
| Hash string `json:"hash"` |
| } |
| -// doCmd executes the given command line string in either the out/Debug |
| -// directory or the inout directory. Returns the stdout and stderr. |
| -func doCmd(commandLine string, moveToDebug bool) (string, error) { |
| +// doCmd executes the given command line string; the command being |
| +// run is expected to not care what its current working directory is. |
| +// Returns the stdout and stderr. |
| +func doCmd(commandLine string) (string, error) { |
| log.Printf("Command: %q\n", commandLine) |
| programAndArgs := strings.SplitN(commandLine, " ", 2) |
| program := programAndArgs[0] |
| @@ -405,20 +406,6 @@ func doCmd(commandLine string, moveToDebug bool) (string, error) { |
| args = strings.Split(programAndArgs[1], " ") |
| } |
| cmd := exec.Command(program, args...) |
| - abs, err := filepath.Abs("../../out/Debug") |
| - if err != nil { |
| - return "", fmt.Errorf("Failed to find absolute path to Debug directory.") |
| - } |
| - if moveToDebug { |
| - cmd.Dir = abs |
| - } else if !*useChroot { // Don't set cmd.Dir when using chroot. |
| - abs, err := filepath.Abs("../../../inout") |
| - if err != nil { |
| - return "", fmt.Errorf("Failed to find absolute path to inout directory.") |
| - } |
| - cmd.Dir = abs |
| - } |
| - log.Printf("Run in directory: %q\n", cmd.Dir) |
| message, err := cmd.CombinedOutput() |
| log.Printf("StdOut + StdErr: %s\n", string(message)) |
| if err != nil { |
| @@ -829,37 +816,18 @@ func mainHandler(w http.ResponseWriter, r *http.Request) { |
| reportTryError(w, r, err, "Failed to write the gyp file.", hash) |
| return |
| } |
| - message, err := doCmd(fmt.Sprintf(RUN_GYP, hash), true) |
| - if err != nil { |
| - message = cleanCompileOutput(message, hash) |
| - reportTryError(w, r, err, message, hash) |
| - return |
| - } |
| - linkMessage, err := doCmd(fmt.Sprintf(RUN_NINJA, hash), true) |
| - if err != nil { |
| - linkMessage = cleanCompileOutput(linkMessage, hash) |
| - reportTryError(w, r, err, linkMessage, hash) |
| - return |
| - } |
| - message += linkMessage |
| - cmd := hash + " --out " + hash + ".png" |
| - if request.Source > 0 { |
| - cmd += fmt.Sprintf(" --source image-%d.png", request.Source) |
| - } |
| + //cmd := hash + " --out " + hash + ".png" |
|
jcgregorio
2014/10/01 16:39:50
commented out code?
humper
2014/10/01 17:02:44
Whoops! jumped the gun and failed to add support
|
| + //if request.Source > 0 { |
| + //cmd += fmt.Sprintf(" --source image-%d.png", request.Source) |
| + //} |
| + cmd := "scripts/fiddle_wrapper " + hash |
| if *useChroot { |
| - cmd = "schroot -c webtry --directory=/inout -- /inout/Release/" + cmd |
| - } else { |
| - abs, err := filepath.Abs("../../../inout/Release") |
| - if err != nil { |
| - reportTryError(w, r, err, "Failed to find executable directory.", hash) |
| - return |
| - } |
| - cmd = abs + "/" + cmd |
| - } |
| + cmd = "schroot -c webtry --directory=/ -- /skia_build/skia/experimental/webtry/" + cmd |
| + } |
| - execMessage, err := doCmd(cmd, false) |
| + message, err := doCmd(cmd) |
| if err != nil { |
| - reportTryError(w, r, err, "Failed to run the code:\n"+execMessage, hash) |
| + reportTryError(w, r, err, "Failed to run the code:\n"+message, hash) |
| return |
| } |
| png, err := ioutil.ReadFile("../../../inout/" + hash + ".png") |
| @@ -870,7 +838,6 @@ func mainHandler(w http.ResponseWriter, r *http.Request) { |
| m := response{ |
| Message: message, |
| - StdOut: execMessage, |
| Img: base64.StdEncoding.EncodeToString([]byte(png)), |
| Hash: hash, |
| } |