diff options
author | Andrei Homescu <ahomescu@google.com> | 2024-02-28 03:45:49 +0000 |
---|---|---|
committer | Andrei Homescu <ahomescu@google.com> | 2024-02-29 23:13:00 +0000 |
commit | 4f292492b55941ea6bc923223a0eeef0a63b0d41 (patch) | |
tree | 0f457ba5c27984f765f00652f2e4a3c4499e9ca5 | |
parent | 5ff1682240bee4ad1a43f0e6dcf4e970bc44e411 (diff) | |
download | aosp-4f292492b55941ea6bc923223a0eeef0a63b0d41.tar.gz |
scripts: Handle relative build-root paths
Bug: 285203365
Test: m trusty_generic-arm64-test-debug
Change-Id: I342635df955ff984332fd4e0e0dd8791a814bee9
-rwxr-xr-x | scripts/build.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/build.py b/scripts/build.py index 8df3563..62300f9 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -645,7 +645,6 @@ def create_test_map(args, build_config, projects): def main(default_config=None, emulator=True): top = os.path.abspath(os.path.join(script_dir, "../../../../..")) - os.chdir(top) parser = argparse.ArgumentParser() @@ -658,7 +657,7 @@ def main(default_config=None, emulator=True): ) parser.add_argument( "--build-root", - type=str, + type=os.path.abspath, default=os.path.join(top, "build-root"), help="Root of intermediate build directory.", ) @@ -740,6 +739,13 @@ def main(default_config=None, emulator=True): ) args = parser.parse_args() + # Change the current directory to the Trusty root + # We do this after parsing all the arguments because + # some of the paths, e.g., build-root, might be relative + # to the directory that the script was called from, not + # to the Trusty root directory + os.chdir(top) + build_config = TrustyBuildConfig( config_file=args.config, android=args.android ) |