webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Functions | Variables
bootstrap Namespace Reference

Classes

class  Failure
 

Functions

def get_toolset_url ()
 
def read_file (path)
 
def write_file (path, data)
 
def remove_directory (path)
 
def install_toolset (toolset_root, url)
 
def download_file (url, path)
 
def temp_dir (path)
 
def check_hello_world (toolset_root)
 
def ensure_toolset_installed (toolset_root)
 
def get_go_environ (toolset_root, workspace=None)
 
def get_go_exe (toolset_root)
 
def bootstrap (logging_level)
 
def prepare_go_environ ()
 
def find_executable (name, workspaces)
 
def main (args)
 

Variables

 LOGGER = logging.getLogger(__name__)
 
 ROOT = os.path.dirname(os.path.abspath(__file__))
 
 TOOLSET_ROOT = os.path.join(os.path.dirname(ROOT), 'golang')
 
 WORKSPACE = os.path.join(ROOT, 'go')
 
string EXE_SFX = 'win32' else ''
 
string TOOLSET_VERSION = 'go1.7'
 
dictionary TOOLSET_VARIANTS
 
string DOWNLOAD_URL_PREFIX = 'https://storage.googleapis.com/golang'
 

Function Documentation

◆ bootstrap()

def bootstrap.bootstrap (   logging_level)
Installs all dependencies in default locations.

Supposed to be called at the beginning of some script (it modifies logger).

Args:
  logging_level: logging level of bootstrap process.

◆ check_hello_world()

def bootstrap.check_hello_world (   toolset_root)
Compiles and runs 'hello world' program to verify that toolset works.

◆ download_file()

def bootstrap.download_file (   url,
  path 
)
Fetches |url| to |path|.

◆ ensure_toolset_installed()

def bootstrap.ensure_toolset_installed (   toolset_root)
Installs or updates Go toolset if necessary.

Returns True if new toolset was installed.

◆ find_executable()

def bootstrap.find_executable (   name,
  workspaces 
)
Returns full path to an executable in some bin/ (in GOROOT or GOBIN).

◆ get_go_environ()

def bootstrap.get_go_environ (   toolset_root,
  workspace = None 
)
Returns a copy of os.environ with added GO* environment variables.

Overrides GOROOT, GOPATH and GOBIN. Keeps everything else. Idempotent.

Args:
  toolset_root: GOROOT would be <toolset_root>/go.
  workspace: main workspace directory or None if compiling in GOROOT.

◆ get_go_exe()

def bootstrap.get_go_exe (   toolset_root)
Returns path to go executable.

◆ get_toolset_url()

def bootstrap.get_toolset_url ( )
URL of a platform specific Go toolset archive.

◆ install_toolset()

def bootstrap.install_toolset (   toolset_root,
  url 
)
Downloads and installs Go toolset.

GOROOT would be <toolset_root>/go/.

◆ main()

def bootstrap.main (   args)

◆ prepare_go_environ()

def bootstrap.prepare_go_environ ( )
Returns dict with environment variables to set to use Go toolset.

Installs or updates the toolset if necessary.

◆ read_file()

def bootstrap.read_file (   path)
Returns contents of a given file or None if not readable.

◆ remove_directory()

def bootstrap.remove_directory (   path)
Recursively removes a directory.

◆ temp_dir()

def bootstrap.temp_dir (   path)
Creates a temporary directory, then deletes it.

◆ write_file()

def bootstrap.write_file (   path,
  data 
)
Writes |data| to a file.

Variable Documentation

◆ DOWNLOAD_URL_PREFIX

string bootstrap.DOWNLOAD_URL_PREFIX = 'https://storage.googleapis.com/golang'

◆ EXE_SFX

string bootstrap.EXE_SFX = 'win32' else ''

◆ LOGGER

bootstrap.LOGGER = logging.getLogger(__name__)

◆ ROOT

bootstrap.ROOT = os.path.dirname(os.path.abspath(__file__))

◆ TOOLSET_ROOT

bootstrap.TOOLSET_ROOT = os.path.join(os.path.dirname(ROOT), 'golang')

◆ TOOLSET_VARIANTS

dictionary bootstrap.TOOLSET_VARIANTS
Initial value:
1 = {
2  ('darwin', 'x86-64'): 'darwin-amd64.tar.gz',
3  ('linux2', 'x86-32'): 'linux-386.tar.gz',
4  ('linux2', 'x86-64'): 'linux-amd64.tar.gz',
5  ('win32', 'x86-32'): 'windows-386.zip',
6  ('win32', 'x86-64'): 'windows-amd64.zip',
7 }

◆ TOOLSET_VERSION

string bootstrap.TOOLSET_VERSION = 'go1.7'

◆ WORKSPACE

bootstrap.WORKSPACE = os.path.join(ROOT, 'go')