mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-10-26 15:13:22 +03:00
Fix the spawn test in the bypy environment
Required the launcher to be built since the pre-built one was being used. Fixes #2881
This commit is contained in:
parent
65f6b142a5
commit
67f60847ee
@ -47,6 +47,18 @@ def build_c_extensions(ext_dir, args):
|
|||||||
shutil.copytree(
|
shutil.copytree(
|
||||||
KITTY_DIR, writeable_src_dir, symlinks=True,
|
KITTY_DIR, writeable_src_dir, symlinks=True,
|
||||||
ignore=shutil.ignore_patterns('b', 'build', 'dist', '*_commands.json', '*.o'))
|
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']
|
cmd = [PYTHON, 'setup.py']
|
||||||
bundle = 'macos-freeze' if ismacos else 'linux-freeze'
|
bundle = 'macos-freeze' if ismacos else 'linux-freeze'
|
||||||
cmd.append(bundle)
|
cmd.append(bundle)
|
||||||
|
@ -3,13 +3,8 @@
|
|||||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||||
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
from . import BaseTest
|
from . import BaseTest
|
||||||
|
|
||||||
is32bit = sys.maxsize <= (1 << 32)
|
|
||||||
|
|
||||||
|
|
||||||
class TestTUI(BaseTest):
|
class TestTUI(BaseTest):
|
||||||
|
|
||||||
@ -48,7 +43,6 @@ def test_line_edit(self):
|
|||||||
le.backspace()
|
le.backspace()
|
||||||
self.assertTrue(le.pending_bell)
|
self.assertTrue(le.pending_bell)
|
||||||
|
|
||||||
@unittest.skipIf(is32bit, 'Fails for some unknown reason on 32bit builds')
|
|
||||||
def test_multiprocessing_spawn(self):
|
def test_multiprocessing_spawn(self):
|
||||||
from kitty.multiprocessing import test_spawn
|
from kitty.multiprocessing import test_spawn
|
||||||
test_spawn()
|
test_spawn()
|
||||||
|
11
setup.py
11
setup.py
@ -696,13 +696,17 @@ def files(
|
|||||||
kenv, dest, compilation_database, sources, all_headers + ['kitty/data-types.h'])
|
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
|
global env
|
||||||
env = init_env(
|
env = init_env(
|
||||||
args.debug, args.sanitize, native_optimizations, args.profile,
|
args.debug, args.sanitize, native_optimizations, args.profile,
|
||||||
args.egl_library, args.startup_notification_library, args.canberra_library,
|
args.egl_library, args.startup_notification_library, args.canberra_library,
|
||||||
args.extra_logging
|
args.extra_logging
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def build(args: Options, native_optimizations: bool = True) -> None:
|
||||||
|
init_env_from_args(args, native_optimizations)
|
||||||
sources, headers = find_c_files()
|
sources, headers = find_c_files()
|
||||||
compile_c_extension(
|
compile_c_extension(
|
||||||
kitty_env(), 'kitty/fast_data_types', args.compilation_database, sources, headers
|
kitty_env(), 'kitty/fast_data_types', args.compilation_database, sources, headers
|
||||||
@ -1041,7 +1045,7 @@ def option_parser() -> argparse.ArgumentParser: # {{{
|
|||||||
'action',
|
'action',
|
||||||
nargs='?',
|
nargs='?',
|
||||||
default=Options.action,
|
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)'
|
help='Action to perform (default is build)'
|
||||||
)
|
)
|
||||||
p.add_argument(
|
p.add_argument(
|
||||||
@ -1156,6 +1160,9 @@ def main() -> None:
|
|||||||
create_minimal_macos_bundle(args, launcher_dir)
|
create_minimal_macos_bundle(args, launcher_dir)
|
||||||
else:
|
else:
|
||||||
build_launcher(args, launcher_dir=launcher_dir)
|
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':
|
elif args.action == 'linux-package':
|
||||||
build(args, native_optimizations=False)
|
build(args, native_optimizations=False)
|
||||||
package(args, bundle_type='linux-package')
|
package(args, bundle_type='linux-package')
|
||||||
|
Loading…
Reference in New Issue
Block a user