Lines Matching +full:go +full:- +full:version
3 # Use of this source code is governed by a BSD-style license that can be
18 "--config",
23 "--use_ccache", required=True, choices=["true", "false"]
26 "--use_llvm_next", required=True, choices=["true", "false"]
28 parser.add_argument("--output_file", required=True, type=str)
30 "--static",
38 "--version",
40 A string to pass to `go` that instructs the compiler wrapper about what
41 version to print. Automatically selects the current git commit SHA if
46 "--version_suffix",
48 A string appended to the **computed** version of the wrapper. This is
50 `--version`.
63 def calc_go_args(args, version, build_dir, output_file): argument
64 # These seem unnecessary, and might lead to breakages with Go's ldflag
66 if "'" in version:
67 raise ValueError("`version` should not contain single quotes")
70 "-X",
72 "-X",
74 "-X",
76 "-X",
77 # Quote this, as `version` may have spaces in it.
78 "'main.Version=" + version + "'",
84 extra_args += ["-tags", "libc_exec"]
87 # If android_llvm_next_flags.go DNE, we'll get an obscure "no
90 os.path.join(build_dir, "android_llvm_next_flags.go")
94 "android_llvm_next_flags.go file; please see "
95 "cros_llvm_next_flags.go."
97 extra_args += ["-tags", "android_llvm_next_flags"]
100 "go",
102 "-o",
104 "-ldflags",
110 version_path = os.path.join(build_dir, "VERSION")
112 with open(version_path, "r", encoding="utf-8") as r:
116 ["git", "-C", build_dir, "log", "-1", "--pretty=%B"], encoding="utf-8"
119 change_ids = re.findall(r"Change-Id: (\w+)", last_commit_msg)
121 sys.exit("Couldn't find Change-Id in last commit message.")
122 return change_ids[-1]
129 if args.version:
130 version = args.version
132 version = read_version(build_dir)
134 version += args.version_suffix
136 # Note: Go does not support using absolute package names.
137 # So we run go inside the directory of the the build file.
140 calc_go_args(args, version, build_dir, output_file), cwd=build_dir
143 # b/203821449: we're occasionally seeing very small (and non-functional)
144 # compiler-wrapper binaries on SDK builds. To help narrow down why, add a
146 # shouldn't flag false-positives.