From a3c8f32c1a72ee075cb4d2e582aba53425e6dd7b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 11 Nov 2023 17:34:03 +0530 Subject: [PATCH] Fix Linux CI build --- docs/conf.py | 4 ++-- setup.py | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c7b398e74..20f375cf3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -639,9 +639,9 @@ def setup_man_pages() -> None: def build_extra_man_pages() -> None: base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - kitten = os.path.join(base, 'kitty/launcher/kitten') + kitten = os.environ.get('KITTEN_EXE_FOR_DOCS', os.path.join(base, 'kitty/launcher/kitten')) if not os.path.exists(kitten): - raise Exception('The kitten binary is not built cannot generate man pages') + raise Exception(f'The kitten binary {kitten} is not built cannot generate man pages') raw = subprocess.check_output([kitten, '-h']).decode() started = 0 names = set() diff --git a/setup.py b/setup.py index c7e1f8a1a..1aa1b6c31 100755 --- a/setup.py +++ b/setup.py @@ -960,9 +960,6 @@ 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') @@ -974,6 +971,9 @@ def build_static_kittens( raise SystemExit(f'The version of go on this system ({current_go_version}) is too old. go >= {required_go_version} is needed') if not for_platform: update_go_generated_files(args, os.path.join(launcher_dir, appname)) + 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 '' cmd = [go, 'build', '-v'] vcs_rev = args.vcs_rev or get_vcs_rev() ld_flags: List[str] = [] @@ -1155,7 +1155,11 @@ def compile_python(base_path: str) -> None: def create_linux_bundle_gunk(ddir: str, libdir_name: str) -> None: + base = Path(ddir) + in_src_launcher = base / (f'{libdir_name}/kitty/kitty/launcher/kitty') + launcher = base / 'bin/kitty' if not os.path.exists('docs/_build/html'): + os.environ['KITTEN_EXE_FOR_DOCS'] = os.path.join(os.path.dirname(str(launcher)), 'kitten') make = 'gmake' if is_freebsd else 'make' run_tool([make, 'docs']) copy_man_pages(ddir) @@ -1199,9 +1203,6 @@ MimeType=image/*;application/x-sh;application/x-shellscript;inode/directory;text ''' ) - base = Path(ddir) - in_src_launcher = base / (f'{libdir_name}/kitty/kitty/launcher/kitty') - launcher = base / 'bin/kitty' if os.path.exists(in_src_launcher): os.remove(in_src_launcher) os.makedirs(os.path.dirname(in_src_launcher), exist_ok=True)