Lines Matching +full:build +full:- +full:opts
3 # Use of this source code is governed by a BSD-style license that can be
11 To test changes more quickly, set the --noclean option. This prevents the target directories from
14 For easy binary size comparison, use the --size-only option to only do builds that will result in a
15 binary size output, which are non-test release builds.
18 structure with Cargo.toml files. Only top-level crates are tested directly. To skip a top-level
20 tests run single-threaded, add an empty .build_test_serial file to the directory.
41 ARM_TRIPLE = os.getenv("ARM_TRIPLE", "armv7a-cros-linux-gnueabihf")
42 AARCH64_TRIPLE = os.getenv("AARCH64_TRIPLE", "aarch64-cros-linux-gnu")
43 X86_64_TRIPLE = os.getenv("X86_64_TRIPLE", "x86_64-unknown-linux-gnu")
44 X86_64_WIN_MSVC_TRIPLE = os.getenv("X86_64_WIN_MSVC_TRIPLE", "x86_64-pc-windows-msvc")
72 triple: Target triple. Example: 'x86_64-unknown-linux-gnu'.
99 """Does a cargo build for the triple in release or debug mode.
102 triple: Target triple. Example: 'x86_64-unknown-linux-gnu'.
103 is_release: True to build a release version.
105 only_build_targets: Only build packages that will be tested.
107 args = ["cargo", "build", "--target=%s" % triple]
110 args.append("--release")
117 args.append("-p")
120 args.append("--features")
124 return False, "build error"
135 triple: Target triple. Example: 'x86_64-unknown-linux-gnu'.
136 is_release: True to build a release version.
138 no_run: True to pass --no-run flag to cargo test.
142 args = ["cargo", "test", "--target=%s" % triple]
145 args.append("--release")
148 args.append("--no-run")
151 args.append("-p")
154 args.append("--features")
158 args.append("--")
159 args.append("--test-threads=1")
167 triple: Target triple. Example: 'x86_64-unknown-linux-gnu'.
168 is_release: True to build a release version.
170 no_run: True to pass --no-run flag to cargo test.
198 triple: Target triple. Example: 'x86_64-unknown-linux-gnu'.
205 copy_output: True to copy build artifacts to external directory.
206 output_directory: Destination of copy of build artifacts.
207 only_build_targets: Only build packages that will be tested.
220 env["TARGET_CC"] = "%s-clang" % triple
226 # which one is valid, just add both and let the dynamic linker and pkg-config search.
239 env["RUSTFLAGS"] = "-C linker=" + env["TARGET_CC"]
241 env["RUSTFLAGS"] += " -Cembed-bitcode=yes -Clto"
245 env["RUSTFLAGS"] = env.get("RUSTFLAGS", "") + " -C link-args=/EXPORT:{}".format(symbol)
264 print("All build and tests skipped.")
284 # We only care about the non-test binaries, so only copy the output from cargo build.
329 triple: Target triple. Example: 'x86_64-unknown-linux-gnu'.
333 proc = subprocess.Popen(["%s-strip" % triple, bin_path])
346 "--x86_64-msvc-sysroot",
347 default="build/amd64-msvc",
352 "--arm-sysroot",
353 default="/build/arm-generic",
357 "--aarch64-sysroot",
358 default="/build/arm64-generic",
362 "--x86_64-sysroot",
363 default="/build/amd64-generic",
368 "--noclean",
372 help="Keep the tempororary build directories.",
375 "--copy",
380 "--copy-directory",
382 help="Destination of .exe files when using --copy",
385 "--serial",
389 help="Run cargo build serially rather than in parallel",
393 "--x86_64-only",
399 "--only-build-targets",
405 "--size-only",
409 help="Only perform builds that output their binary size (i.e. release non-test).",
412 "--job_type",
418 "--skip_file_name",
428 "--build_mode",
431 help="Build mode of the binaries.",
438 opts = get_parser().parse_args(argv)
441 if opts.build_mode == "release":
445 opts.x86_64_msvc_sysroot,
448 opts.skip_file_name,
452 opts.x86_64_msvc_sysroot,
455 opts.skip_file_name,
459 elif opts.build_mode == "debug":
462 opts.x86_64_msvc_sysroot,
465 opts.skip_file_name,
472 (opts.x86_64_sysroot, X86_64_TRIPLE, "debug", opts.skip_file_name, False),
473 (opts.x86_64_sysroot, X86_64_TRIPLE, "release", opts.skip_file_name, False),
474 (opts.x86_64_sysroot, X86_64_TRIPLE, "debug", opts.skip_file_name, True),
475 (opts.x86_64_sysroot, X86_64_TRIPLE, "release", opts.skip_file_name, True),
477 if not opts.x86_64_only:
480 (opts.arm_sysroot, ARM_TRIPLE, "debug", opts.skip_file_name, False),
481 (opts.arm_sysroot, ARM_TRIPLE, "release", opts.skip_file_name, False),
483 opts.aarch64_sysroot,
486 opts.skip_file_name,
490 opts.aarch64_sysroot,
493 opts.skip_file_name,
499 if opts.size_only:
500 # Only include non-test release builds
505 # First we need to build necessary DLLs.
507 # we want to build the DLLs only once up front.
512 build_dlls(os.getcwd(), mode, opts.job_type, BUILD_FEATURES)
514 # set keyword args to build_or_test based on opts
518 clean=opts.clean,
519 copy_output=opts.copy,
520 copy_directory=opts.copy_directory,
521 only_build_targets=opts.only_build_targets,
524 if opts.parallel:
530 print_summary("build", build_test_cases, results, opts)
539 # Run tests serially. We set clean=False so it re-uses the results of the build phase.
545 copy_output=opts.copy,
546 copy_directory=opts.copy_directory,
547 only_build_targets=opts.only_build_targets,
552 print_summary("test", test_cases, results, opts)
560 def print_summary(title, cases, results, opts): argument
561 print("---")
565 title = "%s_%s" % (triple.split("-")[0], kind)
582 and not opts.only_build_targets