Exemplo n.º 1
0
def main(argv):
  robo_configuration = robo_lib.RoboConfiguration()
  robo_configuration.chdir_to_ffmpeg_home();

  parsed, remaining = getopt.getopt(argv, "",
          ["setup", "test", "build", "all"])

  for opt, arg in parsed:
    if opt == "--setup":
      robo_setup.InstallPrereqs(robo_configuration)
      robo_setup.EnsureToolchains(robo_configuration)
      robo_setup.EnsureASANDirWorks(robo_configuration)
    elif opt == "--test":
      robo_build.BuildAndImportFFmpegConfigForHost(robo_configuration)
      robo_build.RunTests(robo_configuration)
    elif opt == "--build":
      robo_build.BuildAndImportAllFFmpegConfigs(robo_configuration)
      # TODO: run check_merge.py
      # TODO: run find_patches.py
    elif opt == "--all":
      robo_build.BuildAndImportFFmpegConfigForHost(robo_configuration)
      robo_build.RunTests(robo_configuration)
      robo_build.BuildAndImportAllFFmpegConfigs(robo_configuration)
      # TODO: run some sanity checks to see if this might be okay to auto-roll.
    else:
      raise Exception("Unknown option '%s'" % opt);
Exemplo n.º 2
0
def main(argv):
  robo_configuration = robo_lib.RoboConfiguration()
  robo_configuration.chdir_to_ffmpeg_home();

  parsed, remaining = getopt.getopt(argv, "",
          ["setup", "test", "build", "auto-merge", "auto-merge-test"])

  for opt, arg in parsed:
    if opt == "--setup":
      robo_setup.InstallPrereqs(robo_configuration)
      robo_setup.EnsureToolchains(robo_configuration)
      robo_setup.EnsureASANDirWorks(robo_configuration)
    elif opt == "--test":
      robo_build.BuildAndImportFFmpegConfigForHost(robo_configuration)
      robo_build.RunTests(robo_configuration)
    elif opt == "--build":
      # Unconditionally build all the configs and import them.
      robo_build.BuildAndImportAllFFmpegConfigs(robo_configuration)
    elif opt == "--auto-merge" or opt == "--auto-merge-test":
      # Start a branch (if needed), merge (if needed), and try to verify it.
      # TODO: Verify that the working directory is clean.
      robo_branch.CreateAndCheckoutDatedSushiBranchIfNeeded(robo_configuration)
      robo_branch.MergeUpstreamToSushiBranchIfNeeded(robo_configuration)
      # We want to push the merge and make the local branch track it, so that
      # future 'git cl upload's don't try to review the merge commit, and spam
      # the ffmpeg committers.
      robo_branch.PushToOriginWithoutReviewAndTrack(robo_configuration)

      # Try to get everything to build.
      # auto-merge-test is just to make this quicker while i'm developing it
      # TODO: Make it skip these if they're already done.
      if opt == "--auto-merge-test":
        robo_build.BuildAndImportFFmpegConfigForHost(robo_configuration)
      else:
        robo_build.BuildAndImportAllFFmpegConfigs(robo_configuration)
      robo_branch.HandleAutorename(robo_configuration)
      robo_branch.AddAndCommit(robo_configuration, "GN Configuration")
      robo_branch.CheckMerge(robo_configuration)
      robo_branch.WritePatchesReadme(robo_configuration)
      robo_branch.AddAndCommit(robo_configuration, "Chromium patches file")
      robo_build.RunTests(robo_configuration)

      # TODO: Start a fake deps roll.  To do this, we would:
      # Create new remote branch from the current remote sushi branch.
      # Create and check out a new local branch at the current local branch.
      # Make the new local branch track the new remote branch.
      # Push to origin/new remote branch.
      # Start a fake deps roll CL that runs the *san bots.
      # Switch back to original local branch.
      # For extra points, include a pointer to the fake deps roll CL in the
      # local branch, so that when it's pushed for review, it'll point the
      # reviewer at it.

      # TODO: git cl upload for review.
    else:
      raise Exception("Unknown option '%s'" % opt);
Exemplo n.º 3
0
def main(argv):
    robo_configuration = robo_lib.RoboConfiguration()
    robo_configuration.chdir_to_ffmpeg_home()

    # TODO(liberato): Add a way to skip |skip_fn|.
    parsed, remaining = getopt.getopt(argv, "", [
        "prompt",
        "setup",
        "test",
        "build",
        "patches",
        "auto-merge",
        "step=",
        "list",
    ])

    for opt, arg in parsed:
        if opt == "--prompt":
            robo_configuration.set_prompt_on_call(True)
        elif opt == "--setup":
            RunSteps(robo_configuration, ["setup"])
        elif opt == "--test":
            robo_build.BuildAndImportFFmpegConfigForHost(robo_configuration)
            robo_build.RunTests(robo_configuration)
        elif opt == "--build-gn":
            # Unconditionally build all the configs and import them.
            robo_build.BuildAndImportAllFFmpegConfigs(robo_configuration)
        elif opt == "--patches":
            # To be run after committing a local change to fix the tests.
            if not robo_branch.IsWorkingDirectoryClean():
                raise UserInstructions(
                    "Working directory must be clean to generate patches file")
            robo_branch.UpdatePatchesFileUnconditionally(robo_configuration)
        elif opt == "--auto-merge":
            # TODO: make sure that any untracked autorename files are removed, or
            # make sure that the autorename git script doesn't try to 'git rm'
            # untracked files, else the script fails.
            RunSteps(robo_configuration, ["auto-merge"])

            # TODO: Start a fake deps roll.  To do this, we would:
            # Create new remote branch from the current remote sushi branch.
            # Create and check out a new local branch at the current local branch.
            # Make the new local branch track the new remote branch.
            # Push to origin/new remote branch.
            # Start a fake deps roll CL that runs the *san bots.
            # Switch back to original local branch.
            # For extra points, include a pointer to the fake deps roll CL in the
            # local branch, so that when it's pushed for review, it'll point the
            # reviewer at it.

            # TODO: git cl upload for review.
        elif opt == "--step":
            RunSteps(robo_configuration, arg.split(","))
        elif opt == "--list":
            ListSteps()
        else:
            raise Exception("Unknown option '%s'" % opt)
Exemplo n.º 4
0
def BuildGnConfigsUnconditionally(robo_configuration):
    robo_build.BuildAndImportAllFFmpegConfigs(robo_configuration)
    # Run sanity checks on the merge before we commit.
    robo_branch.CheckMerge(robo_configuration)
    # Write the config changes to help the reviewer.
    robo_branch.WriteConfigChangesFile(robo_configuration)
    # TODO(liberato): Add the 'autodetect' regex too.
    # Handle autorenames last, so that we don't stage things and then fail.
    # While it's probably okay, it's nicer if we don't.
    robo_branch.HandleAutorename(robo_configuration)
    robo_branch.AddAndCommit(robo_configuration,
                             robo_configuration.gn_commit_title())
def main(argv):
    robo_configuration = robo_lib.RoboConfiguration()
    robo_configuration.chdir_to_ffmpeg_home()

    parsed, remaining = getopt.getopt(argv, "",
                                      ["setup", "test", "build", "auto-merge"])

    for opt, arg in parsed:
        if opt == "--setup":
            robo_setup.InstallPrereqs(robo_configuration)
            robo_setup.EnsureToolchains(robo_configuration)
            robo_setup.EnsureASANDirWorks(robo_configuration)
            robo_setup.EnsureChromiumNasm(robo_configuration)
        elif opt == "--test":
            robo_build.BuildAndImportFFmpegConfigForHost(robo_configuration)
            robo_build.RunTests(robo_configuration)
        elif opt == "--build":
            # Unconditionally build all the configs and import them.
            robo_build.BuildAndImportAllFFmpegConfigs(robo_configuration)
        elif opt == "--auto-merge":
            # Start a branch (if needed), merge (if needed), and try to verify it.
            # TODO: Verify that the working directory is clean.
            robo_branch.CreateAndCheckoutDatedSushiBranchIfNeeded(
                robo_configuration)
            robo_branch.MergeUpstreamToSushiBranchIfNeeded(robo_configuration)
            # We want to push the merge and make the local branch track it, so that
            # future 'git cl upload's don't try to review the merge commit, and spam
            # the ffmpeg committers.
            robo_branch.PushToOriginWithoutReviewAndTrackIfNeeded(
                robo_configuration)

            # Try to get everything to build if we haven't committed the configs yet.
            # Note that the only time we need to do this again is if some change makes
            # different files added / deleted to the build, or if ffmpeg configure
            # changes.  We don't need to do this if you just edit ffmpeg sources;
            # those will be built with the tests if they've changed since last time.
            #
            # So, if you're just editing ffmpeg sources to get tests to pass, then you
            # probably don't need to do this step again.
            #
            # TODO: Add a way to override this.  I guess just edit out the config
            # commit with a rebase for now.
            if robo_branch.IsCommitOnThisBranch(
                    robo_configuration, robo_configuration.gn_commit_title()):
                log("Skipping config build since already committed")
            else:
                robo_build.BuildAndImportAllFFmpegConfigs(robo_configuration)
                # Run sanity checks on the merge before we commit.
                robo_branch.CheckMerge(robo_configuration)
                # Write the config changes to help the reviewer.
                robo_branch.WriteConfigChangesFile(robo_configuration)
                # TODO(liberato): Add the 'autodetect' regex too.
                # Handle autorenames last, so that we don't stage things and then fail.
                # While it's probably okay, it's nicer if we don't.
                robo_branch.HandleAutorename(robo_configuration)
                robo_branch.AddAndCommit(robo_configuration,
                                         robo_configuration.gn_commit_title())

            # Update the patches file.
            if robo_branch.IsCommitOnThisBranch(
                    robo_configuration,
                    robo_configuration.patches_commit_title()):
                log("Skipping patches file since already committed")
            else:
                robo_branch.WritePatchesReadme(robo_configuration)
                robo_branch.AddAndCommit(
                    robo_configuration,
                    robo_configuration.patches_commit_title())

            # Run the tests.  Note that this will re-run ninja from chromium/src,
            # which will rebuild any changed ffmpeg sources as it normally would.
            robo_build.RunTests(robo_configuration)

            # TODO: Start a fake deps roll.  To do this, we would:
            # Create new remote branch from the current remote sushi branch.
            # Create and check out a new local branch at the current local branch.
            # Make the new local branch track the new remote branch.
            # Push to origin/new remote branch.
            # Start a fake deps roll CL that runs the *san bots.
            # Switch back to original local branch.
            # For extra points, include a pointer to the fake deps roll CL in the
            # local branch, so that when it's pushed for review, it'll point the
            # reviewer at it.

            # TODO: git cl upload for review.
        else:
            raise Exception("Unknown option '%s'" % opt)