Commit 07b216e3 authored by Scott Graham's avatar Scott Graham Committed by Commit Bot

fuchsia: Move sdk hash into update script instead of DEPS

Per discussion on https://chromium-review.googlesource.com/884822, this
is easier to work with for V8.

Bug: 707030
Change-Id: Ida09715f35280652408e209a408c2012a5648479
Reviewed-on: https://chromium-review.googlesource.com/894042
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: default avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533081}
parent 99c730c6
...@@ -1354,7 +1354,6 @@ hooks = [ ...@@ -1354,7 +1354,6 @@ hooks = [
'action': [ 'action': [
'python', 'python',
'src/build/fuchsia/update_sdk.py', 'src/build/fuchsia/update_sdk.py',
'893404234442cf13abbc4e22ed996839ff5b1338',
], ],
}, },
......
...@@ -13,6 +13,8 @@ import sys ...@@ -13,6 +13,8 @@ import sys
import tarfile import tarfile
import tempfile import tempfile
SDK_HASH = '893404234442cf13abbc4e22ed996839ff5b1338'
REPOSITORY_ROOT = os.path.abspath(os.path.join( REPOSITORY_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..')) os.path.dirname(__file__), '..', '..'))
sys.path.append(os.path.join(REPOSITORY_ROOT, 'build')) sys.path.append(os.path.join(REPOSITORY_ROOT, 'build'))
...@@ -27,21 +29,20 @@ def EnsureDirExists(path): ...@@ -27,21 +29,20 @@ def EnsureDirExists(path):
def main(): def main():
if len(sys.argv) != 2: if len(sys.argv) != 1:
print >>sys.stderr, 'usage: %s <sdk_hash>' % sys.argv[0] print >>sys.stderr, 'usage: %s' % sys.argv[0]
return 1 return 1
sdk_hash = sys.argv[1]
output_dir = os.path.join(REPOSITORY_ROOT, 'third_party', 'fuchsia-sdk') output_dir = os.path.join(REPOSITORY_ROOT, 'third_party', 'fuchsia-sdk')
hash_filename = os.path.join(output_dir, '.hash') hash_filename = os.path.join(output_dir, '.hash')
if os.path.exists(hash_filename): if os.path.exists(hash_filename):
with open(hash_filename, 'r') as f: with open(hash_filename, 'r') as f:
if f.read().strip() == sdk_hash: if f.read().strip() == SDK_HASH:
# Nothing to do. # Nothing to do.
return 0 return 0
print 'Downloading SDK %s...' % sdk_hash print 'Downloading SDK %s...' % SDK_HASH
if os.path.isdir(output_dir): if os.path.isdir(output_dir):
shutil.rmtree(output_dir) shutil.rmtree(output_dir)
...@@ -52,7 +53,7 @@ def main(): ...@@ -52,7 +53,7 @@ def main():
try: try:
bucket = 'gs://fuchsia/sdk/linux-amd64/' bucket = 'gs://fuchsia/sdk/linux-amd64/'
cmd = [os.path.join(find_depot_tools.DEPOT_TOOLS_PATH, 'gsutil.py'), cmd = [os.path.join(find_depot_tools.DEPOT_TOOLS_PATH, 'gsutil.py'),
'cp', bucket + sdk_hash, tmp] 'cp', bucket + SDK_HASH, tmp]
subprocess.check_call(cmd) subprocess.check_call(cmd)
with open(tmp, 'rb') as f: with open(tmp, 'rb') as f:
EnsureDirExists(output_dir) EnsureDirExists(output_dir)
...@@ -61,7 +62,7 @@ def main(): ...@@ -61,7 +62,7 @@ def main():
os.remove(tmp) os.remove(tmp)
with open(hash_filename, 'w') as f: with open(hash_filename, 'w') as f:
f.write(sdk_hash) f.write(SDK_HASH)
return 0 return 0
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
job](https://luci-scheduler.appspot.com/jobs/fuchsia/sdk-x86_64-linux) for a job](https://luci-scheduler.appspot.com/jobs/fuchsia/sdk-x86_64-linux) for a
recent green archive. On the "SUCCEEDED" link, copy the SHA-1 from the recent green archive. On the "SUCCEEDED" link, copy the SHA-1 from the
`gsutil.upload` link of the `upload fuchsia-sdk` step. `gsutil.upload` link of the `upload fuchsia-sdk` step.
0. Put that into Chromium's src.git DEPS in the `fuchsia_sdk` step. 0. Put that into Chromium's src.git `build/fuchsia/update_sdk.py` as `SDK_HASH`.
0. `gclient sync && ninja ...` and make sure things go OK locally. 0. `gclient sync && ninja ...` and make sure things go OK locally.
0. Upload the roll CL, making sure to include the `fuchsia` trybot. Tag the roll 0. Upload the roll CL, making sure to include the `fuchsia` trybot. Tag the roll
with `Bug: 707030`. with `Bug: 707030`.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment