diff options
author | Andrei Homescu <ahomescu@google.com> | 2024-02-27 21:27:45 +0000 |
---|---|---|
committer | Andrei Homescu <ahomescu@google.com> | 2024-02-27 21:27:45 +0000 |
commit | 5ff1682240bee4ad1a43f0e6dcf4e970bc44e411 (patch) | |
tree | f31cf298810a92a787eefae723ea95c15cb8c5e6 | |
parent | d8b417f0654777aabbadf0ef34882c4bffa780bc (diff) | |
download | aosp-5ff1682240bee4ad1a43f0e6dcf4e970bc44e411.tar.gz |
scripts: Add --no-nice argument to build.py
The Soong build environment has the nice command
disabled and prints an error when calling it.
Add a new command line option to disable nice
when running build.py.
Bug: 285203365
Test: Presubmit
Change-Id: I59717e700aedd88a19cd8f70a50dc09f19333c7b
-rwxr-xr-x | scripts/build.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/build.py b/scripts/build.py index 5633750..8df3563 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -313,6 +313,8 @@ def build(args): args.buildid = get_new_build_id(args.build_root) print("BuildID", args.buildid) + nice = "" if args.no_nice else "nice" + # build projects failed = [] @@ -320,7 +322,7 @@ def build(args): cmd = ( f"export BUILDROOT={args.build_root};" f"export BUILDID={args.buildid};" - f"nice $BUILDTOOLS_BINDIR/make {project} " + f"{nice} $BUILDTOOLS_BINDIR/make {project} " f"-f $LKROOT/makefile -j {args.jobs}" ) # Call envsetup. If it fails, abort. @@ -731,6 +733,11 @@ def main(default_config=None, emulator=True): action="store_true", help="Use colored build logs with pinned status lines.", ) + parser.add_argument( + "--no-nice", + action="store_true", + help="Do not use nice to run the build.", + ) args = parser.parse_args() build_config = TrustyBuildConfig( |