Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Merge a8bcf9d into 5423a4c
Browse files Browse the repository at this point in the history
  • Loading branch information
John Kleinschmidt authored Apr 19, 2018
2 parents 5423a4c + a8bcf9d commit 6d25ac0
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 31 deletions.
26 changes: 16 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Check sccache stats before build
command: script/sccache -s
- run:
name: Build shared library
command: script/build -t $TARGET_ARCH -c $COMPONENT
- run:
name: Build FFmpeg
command: script/build -t $TARGET_ARCH -c ffmpeg
- run:
name: Check sccache stats after build
command: script/sccache -s
- run:
name: Create distribution
command: script/create-dist -t $TARGET_ARCH -c $COMPONENT
Expand Down Expand Up @@ -50,7 +56,7 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Build static library
command: script/build -t $TARGET_ARCH -c $COMPONENT
Expand Down Expand Up @@ -86,7 +92,7 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Build shared library
command: script/build -t $TARGET_ARCH -c $COMPONENT
Expand Down Expand Up @@ -122,7 +128,7 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Build static library
command: script/build -t $TARGET_ARCH -c $COMPONENT
Expand Down Expand Up @@ -158,7 +164,7 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Build mksnapshot
command: script/build -t $TARGET_ARCH -c native_mksnapshot
Expand Down Expand Up @@ -202,7 +208,7 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Build static library
command: script/build -t $TARGET_ARCH -c $COMPONENT
Expand Down Expand Up @@ -238,7 +244,7 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Build mksnapshot
command: script/build -t $TARGET_ARCH -c native_mksnapshot
Expand Down Expand Up @@ -282,7 +288,7 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Build static library
command: script/build -t $TARGET_ARCH -c $COMPONENT
Expand Down Expand Up @@ -318,7 +324,7 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Build shared library
command: script/build -t $TARGET_ARCH -c $COMPONENT
Expand Down Expand Up @@ -354,7 +360,7 @@ jobs:
command: script/bootstrap
- run:
name: Update
command: script/update --clean -t $TARGET_ARCH
command: script/update --clean -t $TARGET_ARCH --use-bundled-sccache
- run:
name: Build static library
command: script/build -t $TARGET_ARCH -c $COMPONENT
Expand Down
8 changes: 6 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ build_script:
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
} else {
script\cibuild.ps1
script\cibuild.ps1 -useSccache
if ($? -ne 'True') {
throw "Build failed with exit code $?"
} else {
"Build succeeded."
}
}
test: off
test_script:
- ps: >-
Write-Output "sccache stats:"
python script\sccache -s
artifacts:
- path: libchromiumcontent.zip
name: libchromiumcontent.zip
Expand Down
26 changes: 16 additions & 10 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ S3_CREDENTIALS_FILE = os.path.join(JENKINS_ROOT, 'config', 's3credentials')
def main():
args = parse_args()
skip_upload = args.skip_upload
use_sccache = args.use_sccache

if (not skip_upload and
not 'LIBCHROMIUMCONTENT_S3_ACCESS_KEY' in os.environ and
Expand All @@ -34,23 +35,25 @@ def main():

if 'TARGET_ARCH' in os.environ:
args = ['-t', os.environ['TARGET_ARCH']]
return run_ci(args, skip_upload, os.environ['COMPONENT'])
return run_ci(args, skip_upload, use_sccache, os.environ['COMPONENT'])

if sys.platform in ['win32', 'cygwin']:
return (run_ci(['-t', 'x64'], skip_upload) or
run_ci(['-t', 'ia32'], skip_upload))
return (run_ci(['-t', 'x64'], skip_upload, use_sccache) or
run_ci(['-t', 'ia32'], skip_upload, use_sccache))
elif sys.platform == 'linux2':
return (run_ci(['-t', 'x64'], skip_upload) or
run_ci(['-t', 'ia32'], skip_upload) or
run_ci(['-t', 'arm'], skip_upload) or
run_ci(['-t', 'arm64'], skip_upload))
return (run_ci(['-t', 'x64'], skip_upload, use_sccache) or
run_ci(['-t', 'ia32'], skip_upload, use_sccache) or
run_ci(['-t', 'arm'], skip_upload, use_sccache) or
run_ci(['-t', 'arm64'], skip_upload, use_sccache))
else:
return run_ci([], skip_upload)
return run_ci([], skip_upload, use_sccache)

def parse_args():
parser = argparse.ArgumentParser(description='Run CI build')
parser.add_argument('-s', '--skip_upload', action='store_true',
help='Skip uploading to S3')
parser.add_argument('--use_sccache', action='store_true',
help='Use sccache binary stored in with the libcc repo.')
return parser.parse_args()

def copy_to_environment(credentials_file):
Expand All @@ -72,9 +75,12 @@ def os_version():
return platform.platform()


def run_ci(args, skip_upload, component=None):
def run_ci(args, skip_upload, use_sccache, component=None):
build_args = []
component_args = []
update_args = ['--clean'] + args
if use_sccache:
update_args += ['--use-bundled-sccache']
if component is not None:
component_args = ['-c', component]
build_args += component_args + ['ffmpeg']
Expand All @@ -88,7 +94,7 @@ def run_ci(args, skip_upload, component=None):
os.environ.update(vs_env)

return (run_script('bootstrap') or
run_script('update', ['--clean'] + args) or
run_script('update', update_args) or
run_script('build', args + build_args) or
run_script('create-dist', args + component_args) or
run_script('upload', args, skip_upload))
Expand Down
13 changes: 9 additions & 4 deletions script/cibuild.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
param([switch]$skipUpload)
param([switch]$skipUpload, [switch]$useSccache)
function Run-Command([scriptblock]$Command, [switch]$Fatal, [switch]$Quiet) {
$output = ""
try {
Expand Down Expand Up @@ -33,8 +33,13 @@ function Run-Command([scriptblock]$Command, [switch]$Fatal, [switch]$Quiet) {
}

Write-Output ""
$CommandLine = "python .\script\cibuild"
if ($skipUpload) {
Run-Command -Fatal { python .\script\cibuild --skip_upload }
} else {
Run-Command -Fatal { python .\script\cibuild }
$CommandLine += " --skip_upload"
}

if ($useSccache) {
$CommandLine += " --use_sccache"
}
$CICommand = [ScriptBlock]::Create($CommandLine)
Run-Command -Fatal $CICommand
Binary file modified tools/sccache/0.2.6/linux/sccache
Binary file not shown.
Binary file modified tools/sccache/0.2.6/mac/sccache
Binary file not shown.
Binary file modified tools/sccache/0.2.6/windows/sccache.exe
Binary file not shown.
12 changes: 7 additions & 5 deletions vsts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,19 @@ phases:
- bash: |
echo "===Updating for $TARGET_ARCH===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/update --clean -t $TARGET_ARCH > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/update --clean -t $TARGET_ARCH --use-bundled-sccache > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
name: Update
- bash: |
export SCCACHE_AZURE_BLOB_CONTAINER=$(SCCACHE_BLOB_CONTAINER)
export SCCACHE_AZURE_CONNECTION_STRING=$(SCCACHE_AZURE_CONNECTION)
script/sccache -s > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
echo "===Building $COMPONENT for $TARGET_ARCH===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/build -t $TARGET_ARCH -c $COMPONENT > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
name: Build_library
- bash: |
echo "===Building ffmpeg for $TARGET_ARCH===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/build -t $TARGET_ARCH -c ffmpeg > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
name: Build_ffmpeg
script/sccache -s > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
name: Build
- bash: |
echo "===Create $COMPONENT distribution for $TARGET_ARCH===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
Expand Down Expand Up @@ -98,3 +99,4 @@ phases:
fi
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
condition: always()

0 comments on commit 6d25ac0

Please sign in to comment.