diff --git a/bypy/devenv.go b/bypy/devenv.go index a5fea2272..02452b834 100755 --- a/bypy/devenv.go +++ b/bypy/devenv.go @@ -19,6 +19,14 @@ import ( const folder = "dependencies" +func root_dir() string { + f, e := filepath.Abs(filepath.Join(folder, runtime.GOOS+"-"+runtime.GOARCH)) + if e != nil { + panic(e) + } + return f +} + var _ = fmt.Print func exit(x any) { @@ -129,14 +137,14 @@ func dependencies(args []string) { exit("Prebuilt dependencies are only available for Linux and macOS") } url = strings.Replace(url, "{}", which, 1) - if err := os.RemoveAll(filepath.Join(folder, "root")); err != nil { + if err := os.RemoveAll(root_dir()); err != nil { exit(err) } if err := os.MkdirAll(folder, 0o755); err != nil { exit(err) } tarfile, _ := filepath.Abs(cached_download(url)) - root, _ := filepath.Abs(filepath.Join(folder, "root")) + root := root_dir() if err := os.MkdirAll(root, 0o755); err != nil { exit(err) } @@ -186,9 +194,15 @@ func build(args []string) { dependencies(nil) } python := "" - root, _ := filepath.Abs(filepath.Join(folder, "root")) + root := root_dir() os.Setenv("DEVELOP_ROOT", root) prepend("PKG_CONFIG_PATH", filepath.Join(root, "lib", "pkgconfig")) + for _, x := range os.Environ() { + if strings.HasPrefix(x, "PYTHON") { + a, _, _ := strings.Cut(x, "=") + os.Unsetenv(a) + } + } switch runtime.GOOS { case "linux": prepend("LD_LIBRARY_PATH", filepath.Join(root, "lib")) diff --git a/bypy/rsync.conf b/bypy/rsync.conf index 5fd61f610..c016f98eb 100644 --- a/bypy/rsync.conf +++ b/bypy/rsync.conf @@ -1 +1 @@ -to_vm_excludes '/build /dist /kitty/launcher/kitty* /.build-cache /tags __pycache__ /*_commands.json *.so *.pyd *.pyc *_generated.go' +to_vm_excludes '/dependencies /build /dist /kitty/launcher/kitty* /.build-cache /tags __pycache__ /*_commands.json *.so *.pyd *.pyc *_generated.go'