From 3b1b18347ceb74dec8878fcf689e298ad9bc9d95 Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Fri, 9 Feb 2024 03:08:41 +1000 Subject: [PATCH] Check for invalid combination of python + minimal build in build.py (#19463) ### Description Python bindings aren't supported in a minimal build. Check in build.py so user gets a better error message. ### Motivation and Context #19422 --- tools/ci_build/build.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index b2040b24ffaa2..8567d595b7429 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -2536,11 +2536,15 @@ def main(): if args.build_nuget and cross_compiling: raise BuildError("Currently nuget package creation is not supported while cross-compiling") - if args.enable_pybind and args.disable_rtti: - raise BuildError("Python bindings use typeid so you can't disable RTTI") + if args.enable_pybind: + if args.disable_rtti: + raise BuildError("Python bindings use typeid so you can't disable RTTI") - if args.enable_pybind and args.disable_exceptions: - raise BuildError("Python bindings require exceptions to be enabled.") + if args.disable_exceptions: + raise BuildError("Python bindings require exceptions to be enabled.") + + if args.minimal_build is not None: + raise BuildError("Python bindings are not supported in a minimal build.") if args.nnapi_min_api: if not args.use_nnapi: