Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2637)

Unified Diff: ct/go/util/chromium_builds.go

Issue 1988073002: Add ability to only upload a single Chromium build and check for patch existence (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Initial upload Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ct/go/util/chromium_builds.go
diff --git a/ct/go/util/chromium_builds.go b/ct/go/util/chromium_builds.go
index 709bac0c597f4e2a8688dd8747b6def8a5180c13..552fc03c6e8c84f401702f4609ec58995663ac07 100644
--- a/ct/go/util/chromium_builds.go
+++ b/ct/go/util/chromium_builds.go
@@ -41,7 +41,8 @@ func ChromiumBuildDir(chromiumHash, skiaHash, runID string) string {
// Skia's LKGR hash is used (the hash in Chromium's DEPS file).
// applyPatches if true looks for Chromium/Skia patches in the temp dir and
// runs once with the patch applied and once without the patch applied.
-func CreateChromiumBuild(runID, targetPlatform, chromiumHash, skiaHash string, applyPatches bool) (string, string, error) {
+// uploadSingleBuild if true does not upload a 2nd build of Chromium.
+func CreateChromiumBuild(runID, targetPlatform, chromiumHash, skiaHash string, applyPatches, uploadSingleBuild bool) (string, string, error) {
// Determine which build dir and fetch target to use.
var chromiumBuildDir, fetchTarget string
if targetPlatform == "Android" {
@@ -125,7 +126,7 @@ func CreateChromiumBuild(runID, targetPlatform, chromiumHash, skiaHash string, a
// Check for the applypatch flag and reset and then build again and copy to
// google storage.
- if applyPatches {
+ if applyPatches && !uploadSingleBuild {
// Now build chromium without the patches and upload it to Google Storage.
// Make sure we are starting from a clean slate.
@@ -248,23 +249,27 @@ func resetChromiumCheckout(chromiumSrcDir string) error {
}
func applyRepoPatches(chromiumSrcDir, runID string) error {
- // Apply Skia patch.
+ // Apply Skia patch if it exists.
skiaDir := filepath.Join(chromiumSrcDir, "third_party", "skia")
skiaPatch := filepath.Join(os.TempDir(), runID+".skia.patch")
- skiaPatchFile, _ := os.Open(skiaPatch)
- skiaPatchFileInfo, _ := skiaPatchFile.Stat()
- if skiaPatchFileInfo.Size() > 10 {
- if err := ApplyPatch(skiaPatch, skiaDir); err != nil {
- return fmt.Errorf("Could not apply Skia's patch in %s: %s", skiaDir, err)
+ if _, err := os.Stat(skiaPatch); err == nil {
+ skiaPatchFile, _ := os.Open(skiaPatch)
+ skiaPatchFileInfo, _ := skiaPatchFile.Stat()
+ if skiaPatchFileInfo.Size() > 10 {
+ if err := ApplyPatch(skiaPatch, skiaDir); err != nil {
+ return fmt.Errorf("Could not apply Skia's patch in %s: %s", skiaDir, err)
+ }
}
}
- // Apply Chromium patch.
+ // Apply Chromium patch if it exists.
chromiumPatch := filepath.Join(os.TempDir(), runID+".chromium.patch")
- chromiumPatchFile, _ := os.Open(chromiumPatch)
- chromiumPatchFileInfo, _ := chromiumPatchFile.Stat()
- if chromiumPatchFileInfo.Size() > 10 {
- if err := ApplyPatch(chromiumPatch, chromiumSrcDir); err != nil {
- return fmt.Errorf("Could not apply Chromium's patch in %s: %s", chromiumSrcDir, err)
+ if _, err := os.Stat(chromiumPatch); err == nil {
+ chromiumPatchFile, _ := os.Open(chromiumPatch)
+ chromiumPatchFileInfo, _ := chromiumPatchFile.Stat()
+ if chromiumPatchFileInfo.Size() > 10 {
+ if err := ApplyPatch(chromiumPatch, chromiumSrcDir); err != nil {
+ return fmt.Errorf("Could not apply Chromium's patch in %s: %s", chromiumSrcDir, err)
+ }
}
}
return nil

Powered by Google App Engine
This is Rietveld 408576698