Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: go/bootstrap.py

Issue 2071243002: infra/go: Adding setup instructions and quick setup script. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Review fixes. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Prepares a local hermetic Go installation. 6 """Prepares a local hermetic Go installation.
7 7
8 - Downloads and unpacks the Go toolset in ../../golang. 8 - Downloads and unpacks the Go toolset in ../../golang.
9 - Downloads and installs Glide (used by deps.py). 9 - Downloads and installs Glide (used by deps.py).
10 - Fetches code dependencies via deps.py. 10 - Fetches code dependencies via deps.py.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 # APPENGINE_DEV_APPSERVER is used by "appengine/aetest" package. If it's 424 # APPENGINE_DEV_APPSERVER is used by "appengine/aetest" package. If it's
425 # missing, aetest will scan PATH looking for dev_appserver.py, possibly 425 # missing, aetest will scan PATH looking for dev_appserver.py, possibly
426 # finding it in some other place. 426 # finding it in some other place.
427 if go_appengine_path: 427 if go_appengine_path:
428 env['APPENGINE_DEV_APPSERVER'] = os.path.join( 428 env['APPENGINE_DEV_APPSERVER'] = os.path.join(
429 go_appengine_path, 'dev_appserver.py') 429 go_appengine_path, 'dev_appserver.py')
430 else: 430 else:
431 env.pop('APPENGINE_DEV_APPSERVER', None) 431 env.pop('APPENGINE_DEV_APPSERVER', None)
432 432
433 # Add a tag to the prompt
434 prompt = env.get('PS1')
435 if prompt:
436 if not prompt.startswith('[cr-infra-go-area] '):
Vadim Sh. 2016/06/18 16:12:09 nit: '[cr-infra-go-area]' not in prompt (I can im
mithro 2016/06/20 14:19:26 Done.
437 env['PS1'] = '[cr-infra-go-area] ' + prompt
Vadim Sh. 2016/06/18 16:12:09 good enough, though I'm very tempted to bikeshed a
mithro 2016/06/20 14:19:26 I'd like the prompt to match the script you run...
Eric Burnett 2016/06/20 14:32:09 Command line flag sounds hard - users don't genera
mithro 2016/06/21 06:55:05 If I make it a command line argument I can set it
M-A Ruel 2016/06/21 12:21:44 My bikeshed color would be '\033[33;1mcit\033[0m '
mithro 2016/06/22 04:39:20 Adding a command line flag turned out to be a bigg
438
433 return env 439 return env
434 440
435 441
436 def get_go_exe(toolset_root): 442 def get_go_exe(toolset_root):
437 """Returns path to go executable.""" 443 """Returns path to go executable."""
438 return os.path.join(toolset_root, 'go', 'bin', 'go' + EXE_SFX) 444 return os.path.join(toolset_root, 'go', 'bin', 'go' + EXE_SFX)
439 445
440 446
441 def bootstrap(go_paths, logging_level, toolset=None): 447 def bootstrap(go_paths, logging_level, toolset=None):
442 """Installs all dependencies in default locations. 448 """Installs all dependencies in default locations.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 'Linux') 575 'Linux')
570 576
571 bootstrap([WORKSPACE], logging.DEBUG, toolset=opts.toolset) 577 bootstrap([WORKSPACE], logging.DEBUG, toolset=opts.toolset)
572 if opts.build_cross: 578 if opts.build_cross:
573 build_cross_toolset(opts.toolset) 579 build_cross_toolset(opts.toolset)
574 return 0 580 return 0
575 581
576 582
577 if __name__ == '__main__': 583 if __name__ == '__main__':
578 sys.exit(main(sys.argv[1:])) 584 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698