From a12a05e66697fcccfc9140cd9252d61613ca3172 Mon Sep 17 00:00:00 2001 From: BlackAngelTVdev Date: Fri, 6 Nov 2026 08:41:18 +0100 Subject: [PATCH] fix(build): fetch the dependency bundle when its Python is missing dependencies/ is gitignored, so a fresh clone has none, but a working tree can keep the folder with only the cached tarball. Checking for the folder skipped the download and the build then died with a cryptic missing-Python error. Check the bundle Python itself so an incomplete bundle is fetched. --- bypy/devenv.go | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/bypy/devenv.go b/bypy/devenv.go index c216a42..5f09493 100644 --- a/bypy/devenv.go +++ b/bypy/devenv.go @@ -367,6 +367,18 @@ func prepend(env_var, path string) { os.Setenv(env_var, path+val) } +func python_exe() string { + switch runtime.GOOS { + case "linux": + return filepath.Join(root_dir(), "bin", "python") + case `darwin`: + return filepath.Join(root_dir(), macos_python) + default: + exit("Building is only supported on Linux and macOS") + } + return "" +} + func setup_to_run_python() (python string) { root := root_dir() for _, x := range os.Environ() { @@ -379,18 +391,20 @@ func setup_to_run_python() (python string) { case "linux": prepend("LD_LIBRARY_PATH", filepath.Join(root, "lib")) os.Setenv("PYTHONHOME", root) - python = filepath.Join(root, "bin", "python") case `darwin`: - python = filepath.Join(root, macos_python) default: exit("Building is only supported on Linux and macOS") } - return + return python_exe() } func build(args []string) { chdir_to_base() - if _, err := os.Stat(folder); err != nil { + // Check the Python binary instead of the dependencies folder: the folder + // survives a git pull (it is gitignored, so a clone has none) but can + // contain only the cached tarball, which used to fail later with a + // cryptic missing Python error instead of downloading the bundle. + if _, err := os.Stat(python_exe()); err != nil { dependencies(nil) } root := root_dir()