Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
infra.api.InfraApi Class Reference
Inheritance diagram for infra.api.InfraApi:

Public Member Functions

 goroot (self)
 
 go_bin (self)
 
 go_env (self)
 
 gopath (self)
 

Public Attributes

 goroot
 
 gopath
 
 go_bin
 

Detailed Description

Definition at line 14 of file api.py.

Member Function Documentation

◆ go_bin()

infra.api.InfraApi.go_bin (   self)

Definition at line 47 of file api.py.

47 def go_bin(self):
48 return self.m.path.join(self.goroot, 'bin')
49

◆ go_env()

infra.api.InfraApi.go_env (   self)

Definition at line 51 of file api.py.

51 def go_env(self):
52 return {
53 'GOCACHE': self.m.vars.cache_dir.join('go_cache'),
54 'GOPATH': self.gopath,
55 'GOROOT': self.goroot,
56 'PATH': self.m.path.pathsep.join([
57 str(self.go_bin), str(self.gopath.join('bin')), '%(PATH)s']),
58 }
59

◆ gopath()

infra.api.InfraApi.gopath (   self)

Definition at line 61 of file api.py.

61 def gopath(self):
62 return self.m.vars.cache_dir.join('gopath')

◆ goroot()

infra.api.InfraApi.goroot (   self)

Definition at line 16 of file api.py.

16 def goroot(self):
17 go_root = self.m.vars.workdir.join('go', 'go')
18 # Starting with Go 1.18, the standard library includes "//go:embed"
19 # directives that point to other files in the standard library. For
20 # security reasons, the "embed" package does not support symbolic links
21 # (discussion at
22 # https://github.com/golang/go/issues/35950#issuecomment-561725322), and it
23 # produces "cannot embed irregular file" errors when it encounters one.
24 #
25 # To prevent the above error, we ensure our GOROOT environment variable
26 # points to a path without symbolic links.
27 #
28 # For some reason step.m.path.realpath returns the path unchanged, so we
29 # invoke realpath instead.
30 symlink_version_file = go_root.join('VERSION') # Arbitrary symlink.
31 step_result = self.m.step('realpath go/go/VERSION',
32 cmd=['realpath', str(symlink_version_file)],
33 stdout=self.m.raw_io.output_text())
34 step_result = self.m.step('dirname',
35 cmd=['dirname', step_result.stdout],
36 stdout=self.m.raw_io.output_text())
37 go_root_nosymlinks = step_result.stdout.strip()
38 if go_root_nosymlinks != "":
39 return go_root_nosymlinks # pragma: nocover
40 else:
41 # This branch exists solely to appease recipe tests, under which the
42 # workdir variable is unset. Returning an empty string causes tests to
43 # fail, so we return the original GOROOT instead.
44 return go_root
45
static int step(int x, SkScalar min, SkScalar max)
Definition BlurTest.cpp:215

Member Data Documentation

◆ go_bin

infra.api.InfraApi.go_bin

Definition at line 57 of file api.py.

◆ gopath

infra.api.InfraApi.gopath

Definition at line 54 of file api.py.

◆ goroot

infra.api.InfraApi.goroot

Definition at line 48 of file api.py.


The documentation for this class was generated from the following file: