Ejemplo n.º 1
0
def getOneBuild(isJsShell, url, buildType):
    """Try to get a complete working build."""
    idNum = getIdFromTboxUrl(url)
    tboxCacheFolder = sps.normExpUserPath(
        os.path.join(compileShell.ensureCacheDir(),
                     'tboxjs-' + buildType + '-' + idNum))
    createTboxCacheFolder(tboxCacheFolder)

    incompleteBuildTxtFile = sps.normExpUserPath(
        os.path.join(tboxCacheFolder, INCOMPLETE_NOTE))

    if os.path.isfile(getTboxJsBinPath(tboxCacheFolder)):
        return True, idNum, tboxCacheFolder  # Cached, complete

    if os.path.isfile(incompleteBuildTxtFile):
        assert os.listdir(tboxCacheFolder) == [INCOMPLETE_NOTE], 'Only ' + \
            'incompleteBuild.txt should be present in ' + tboxCacheFolder
        readIncompleteBuildTxtFile(incompleteBuildTxtFile, idNum)
        return False, None, None  # Cached, incomplete

    if downloadBuild.downloadBuild(url, tboxCacheFolder, jsShell=isJsShell):
        assert os.listdir(tboxCacheFolder) == ['build'], 'Only ' + \
            'the build subdirectory should be present in ' + tboxCacheFolder
        return True, idNum, tboxCacheFolder  # Downloaded, complete
    else:
        writeIncompleteBuildTxtFile(url, tboxCacheFolder,
                                    incompleteBuildTxtFile, idNum)
        return False, None, None  # Downloaded, incomplete
Ejemplo n.º 2
0
def getOneBuild(isJsShell, url, buildType):
    '''
    Try to get a complete working build.
    '''
    idNum = getIdFromTboxUrl(url)
    tboxCacheFolder = sps.normExpUserPath(os.path.join(compileShell.ensureCacheDir(),
                                                       'tboxjs-' + buildType + '-' + idNum))
    createTboxCacheFolder(tboxCacheFolder)

    incompleteBuildTxtFile = sps.normExpUserPath(os.path.join(tboxCacheFolder, INCOMPLETE_NOTE))

    if os.path.isfile(getTboxJsBinPath(tboxCacheFolder)):
        return True, idNum, tboxCacheFolder  # Cached, complete

    if os.path.isfile(incompleteBuildTxtFile):
        assert os.listdir(tboxCacheFolder) == [INCOMPLETE_NOTE], 'Only ' + \
            'incompleteBuild.txt should be present in ' + tboxCacheFolder
        readIncompleteBuildTxtFile(incompleteBuildTxtFile, idNum)
        return False, None, None  # Cached, incomplete

    if downloadBuild.downloadBuild(url, tboxCacheFolder, jsShell=isJsShell):
        assert os.listdir(tboxCacheFolder) == ['build'], 'Only ' + \
            'the build subdirectory should be present in ' + tboxCacheFolder
        return True, idNum, tboxCacheFolder  # Downloaded, complete
    else:
        writeIncompleteBuildTxtFile(url, tboxCacheFolder, incompleteBuildTxtFile, idNum)
        return False, None, None  # Downloaded, incomplete
Ejemplo n.º 3
0
def main():
    """Prevent running two instances of autoBisectJs concurrently - we don't want to confuse hg."""
    options = parseOpts()

    repoDir = options.buildOptions.repoDir if options.buildOptions else options.browserOptions.repoDir

    with LockDir.LockDir(
            compileShell.getLockDirPath(options.nameOfTreeherderBranch,
                                        tboxIdentifier='Tbox') if options.
            useTreeherderBinaries else compileShell.getLockDirPath(repoDir)):
        if options.useTreeherderBinaries:
            bisectUsingTboxBins(options)
        elif not options.browserOptions:  # Bisect using local builds
            findBlamedCset(options, repoDir, compileShell.makeTestRev(options))

        # Last thing we do while we have a lock.
        # Note that this only clears old *local* cached directories, not remote ones.
        rmOldLocalCachedDirs(compileShell.ensureCacheDir())
Ejemplo n.º 4
0
def main():
    '''Prevent running two instances of autoBisectJs concurrently - we don't want to confuse hg.'''
    options = parseOpts()

    repoDir = options.buildOptions.repoDir if options.buildOptions else options.browserOptions.repoDir

    with LockDir.LockDir(compileShell.getLockDirPath(options.nameOfTreeherderBranch, tboxIdentifier='Tbox')
                         if options.useTreeherderBinaries else compileShell.getLockDirPath(repoDir)):
        if options.useTreeherderBinaries:
            bisectUsingTboxBins(options)
        else:
            # Bisect using local builds
            if options.browserOptions:
                findBlamedCset(options, repoDir,
                               buildBrowser.makeTestRev(options))
            else:
                findBlamedCset(options, repoDir,
                               compileShell.makeTestRev(options))

        # Last thing we do while we have a lock.
        # Note that this only clears old *local* cached directories, not remote ones.
        rmOldLocalCachedDirs(compileShell.ensureCacheDir())