blob: 21969cd4465ded2879b5c911b35b852d72dac0a3 [file] [log] [blame]
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing SDK builders."""
from __future__ import print_function
import datetime
from chromite.lib import constants
from chromite.lib import parallel
from import simple_builders
from chromite.cbuildbot.stages import artifact_stages
from chromite.cbuildbot.stages import build_stages
from chromite.cbuildbot.stages import chrome_stages
from chromite.cbuildbot.stages import sdk_stages
class ChrootSdkBuilder(simple_builders.SimpleBuilder):
"""Build the SDK chroot."""
def RunStages(self):
"""Runs through build process."""
# Unlike normal CrOS builds, the SDK has no concept of pinned CrOS manifest
# or specific Chrome version. Use a datestamp instead.
version ='%Y.%m.%d.%H%M%S')
self._RunStage(build_stages.UprevStage, boards=[])
# We don't need the Chrome source until SDKTestStage. Syncing it should
# take less time than BuildSDKBoardStage, so lets run in parallel with it.
parallel_stages = [
lambda: self._RunStage(chrome_stages.SyncChromeStage),
lambda: self._RunStage(build_stages.BuildSDKBoardStage,
self._RunStage(sdk_stages.SDKPackageStage, version=version)
# Note: This produces badly named toolchain tarballs. Before
# we re-enable it, make sure we fix that first. For example:
# gs://chromiumos-sdk/2015/06/...
# .../cros-sdk-overlay-toolchains-aarch64-cros-linux-gnu-$VER.tar.xz
# self._RunStage(sdk_stages.SDKPackageToolchainOverlaysStage,
# version=version)
# manojgupta: The comment in para below is not valid right now. Need to
# test SDK before making artifacts available to users because of
# Move it after UploadPrebuilts again once the bug is fixed.
# Upload artifacts before tests. Testing takes several hours, so during
# that, goma server will find the new archive and stage it. So that,
# goma can be used on bots just after uprev.
# TODO(hidehiko): We may want to run upload prebuilts and test in
# parallel in future, if it becomes performance bottleneck.
constants.CHROOT_BUILDER_BOARD, version=version)
self._RunStage(sdk_stages.SDKUprevStage, version=version)