diff --git a/bypy/init_env.py b/bypy/init_env.py index e2759adac..f8e5b8d47 100644 --- a/bypy/init_env.py +++ b/bypy/init_env.py @@ -47,6 +47,18 @@ def build_c_extensions(ext_dir, args): shutil.copytree( KITTY_DIR, writeable_src_dir, symlinks=True, ignore=shutil.ignore_patterns('b', 'build', 'dist', '*_commands.json', '*.o')) + + # Build the launcher as it is needed for the spawn test + try: + os.remove(os.path.join(writeable_src_dir, 'kitty', 'launcher', 'kitty')) + except FileNotFoundError: + pass + if run(PYTHON, 'setup.py', 'build-launcher', cwd=writeable_src_dir) != 0: + print('Building of kitty launcher failed', file=sys.stderr) + os.chdir(KITTY_DIR) + run_shell() + raise SystemExit('Building of kitty launcher failed') + cmd = [PYTHON, 'setup.py'] bundle = 'macos-freeze' if ismacos else 'linux-freeze' cmd.append(bundle) diff --git a/kitty_tests/tui.py b/kitty_tests/tui.py index b79f8ffb8..2a989deb6 100644 --- a/kitty_tests/tui.py +++ b/kitty_tests/tui.py @@ -3,13 +3,8 @@ # License: GPL v3 Copyright: 2018, Kovid Goyal -import sys -import unittest - from . import BaseTest -is32bit = sys.maxsize <= (1 << 32) - class TestTUI(BaseTest): @@ -48,7 +43,6 @@ class TestTUI(BaseTest): le.backspace() self.assertTrue(le.pending_bell) - @unittest.skipIf(is32bit, 'Fails for some unknown reason on 32bit builds') def test_multiprocessing_spawn(self): from kitty.multiprocessing import test_spawn test_spawn() diff --git a/setup.py b/setup.py index bd924ed87..7c4295bd2 100755 --- a/setup.py +++ b/setup.py @@ -696,13 +696,17 @@ def compile_kittens(compilation_database: CompilationDatabase) -> None: kenv, dest, compilation_database, sources, all_headers + ['kitty/data-types.h']) -def build(args: Options, native_optimizations: bool = True) -> None: +def init_env_from_args(args: Options, native_optimizations: bool = False) -> None: global env env = init_env( args.debug, args.sanitize, native_optimizations, args.profile, args.egl_library, args.startup_notification_library, args.canberra_library, args.extra_logging ) + + +def build(args: Options, native_optimizations: bool = True) -> None: + init_env_from_args(args, native_optimizations) sources, headers = find_c_files() compile_c_extension( kitty_env(), 'kitty/fast_data_types', args.compilation_database, sources, headers @@ -1041,7 +1045,7 @@ def option_parser() -> argparse.ArgumentParser: # {{{ 'action', nargs='?', default=Options.action, - choices='build test linux-package kitty.app linux-freeze macos-freeze clean'.split(), + choices='build test linux-package kitty.app linux-freeze macos-freeze build-launcher clean'.split(), help='Action to perform (default is build)' ) p.add_argument( @@ -1156,6 +1160,9 @@ def main() -> None: create_minimal_macos_bundle(args, launcher_dir) else: build_launcher(args, launcher_dir=launcher_dir) + elif args.action == 'build-launcher': + init_env_from_args(args, False) + build_launcher(args, launcher_dir=launcher_dir) elif args.action == 'linux-package': build(args, native_optimizations=False) package(args, bundle_type='linux-package')