Add an option to setup.py to skip building kitten

Fixes #6809
This commit is contained in:
Kovid Goyal
2023-11-11 15:55:56 +05:30
parent dee2e83fb4
commit 2759ec1fe1

View File

@@ -145,6 +145,7 @@ class Options:
prefix: str = './linux-package'
dir_for_static_binaries: str = 'build/static'
skip_code_generation: bool = False
skip_building_kitten: bool = False
clean_for_cross_compile: bool = False
python_compiler_flags: str = ''
python_linker_flags: str = ''
@@ -959,6 +960,9 @@ def build_static_kittens(
args: Options, launcher_dir: str, destination_dir: str = '', for_freeze: bool = False,
for_platform: Optional[Tuple[str, str]] = None
) -> str:
if args.skip_building_kitten:
print('Skipping building of the kitten binary because of a command line option. Build is incomplete', file=sys.stderr)
return
sys.stdout.flush()
sys.stderr.flush()
go = shutil.which('go')
@@ -1653,6 +1657,12 @@ def option_parser() -> argparse.ArgumentParser: # {{{
help='Do not create the *_generated.* source files. This is useful if they'
' have already been generated by a previous build, for example during a two-stage cross compilation.'
)
p.add_argument(
'--skip-building-kitten',
default=Options.skip_building_kitten,
action='store_true',
help='Do not build the kitten binary. Useful if you want to build it separately.'
)
p.add_argument(
'--clean-for-cross-compile',
default=Options.clean_for_cross_compile,