mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Git versioning flag (flutter/engine#20748)
* [gn] Adds a flag to turn off git hash versioning Without this flag, it is excessively tedious to build Dart SDK for local testing on Fuchsia, since Fuchsia runner will reject a Dart SDK without a matching version. * [gn] Add flag --no-dart-version-git-info This flag suppresses the SDK stamping by git hash, which allows deploying self-built Dart SDK. Without this flag, it is impossible to build and deploy a development Dart SDK on Fuchsia.
This commit is contained in:
parent
a87555a115
commit
c0a14ebec4
@ -230,7 +230,8 @@ def ProcessCIPDPackage(upload, engine_version):
|
||||
if tries == num_tries - 1:
|
||||
raise
|
||||
|
||||
def BuildTarget(runtime_mode, arch, optimized, enable_lto, enable_legacy, asan, additional_targets=[]):
|
||||
def BuildTarget(runtime_mode, arch, optimized, enable_lto, enable_legacy,
|
||||
asan, dart_version_git_info, additional_targets=[]):
|
||||
unopt = "_unopt" if not optimized else ""
|
||||
out_dir = 'fuchsia_%s%s_%s' % (runtime_mode, unopt, arch)
|
||||
flags = [
|
||||
@ -250,6 +251,8 @@ def BuildTarget(runtime_mode, arch, optimized, enable_lto, enable_legacy, asan,
|
||||
flags.append('--no-fuchsia-legacy')
|
||||
if asan:
|
||||
flags.append('--asan')
|
||||
if not dart_version_git_info:
|
||||
flags.append('--no-dart-version-git-info')
|
||||
|
||||
RunGN(out_dir, flags)
|
||||
BuildNinjaTargets(out_dir, [ 'flutter' ] + additional_targets)
|
||||
@ -316,6 +319,12 @@ def main():
|
||||
help=('Comma-separated list; adds additional targets to build for '
|
||||
'Fuchsia.'))
|
||||
|
||||
parser.add_argument(
|
||||
'--no-dart-version-git-info',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='If set, skips building and just creates packages.')
|
||||
|
||||
args = parser.parse_args()
|
||||
RemoveDirectoryIfExists(_bucket_directory)
|
||||
build_mode = args.runtime_mode
|
||||
@ -334,7 +343,9 @@ def main():
|
||||
product = product_modes[i]
|
||||
if build_mode == 'all' or runtime_mode == build_mode:
|
||||
if not args.skip_build:
|
||||
BuildTarget(runtime_mode, arch, optimized, enable_lto, enable_legacy, args.asan, args.targets.split(","))
|
||||
BuildTarget(runtime_mode, arch, optimized, enable_lto, enable_legacy,
|
||||
args.asan, not args.no_dart_version_git_info,
|
||||
args.targets.split(","))
|
||||
BuildBucket(runtime_mode, arch, optimized, product)
|
||||
|
||||
if args.upload:
|
||||
|
||||
@ -288,6 +288,8 @@ def to_gn_args(args):
|
||||
sys.exit(1)
|
||||
gn_args['enable_vulkan_validation_layers'] = True
|
||||
|
||||
gn_args['dart_version_git_info'] = not args.no_dart_version_git_info
|
||||
|
||||
return gn_args
|
||||
|
||||
def parse_args(args):
|
||||
@ -300,6 +302,8 @@ def parse_args(args):
|
||||
parser.add_argument('--interpreter', default=False, action='store_true')
|
||||
parser.add_argument('--dart-debug', default=False, action='store_true', help='Enables assertions in the Dart VM. ' +
|
||||
'Does not affect optimization levels. If you need to disable optimizations in Dart, use --full-dart-debug')
|
||||
parser.add_argument('--no-dart-version-git-info', default=False, action='store_true',
|
||||
help='Set by default; if unset, turns off the dart SDK git hash check')
|
||||
parser.add_argument('--full-dart-debug', default=False, action='store_true', help='Implies --dart-debug ' +
|
||||
'and also disables optimizations in the Dart VM making it easier to step through VM code in the debugger.')
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user