From 25c1e2787e54c434490e777d99e81deb03f16ea1 Mon Sep 17 00:00:00 2001 From: Ryan Volz Date: Mon, 7 Feb 2022 18:15:39 -0500 Subject: [PATCH] Modify conda env vars in Windows post-install script. This initializes the environment with the following environment variables set to empty, so that they are cleared when the environment is activated and interference from other installations (e.g. PothosSDR) is avoided: GR_PREFIX GRC_BLOCKS_PATH UHD_PKG_PATH VOLK_PREFIX --- rerender.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rerender.py b/rerender.py index f4c531e..759365f 100755 --- a/rerender.py +++ b/rerender.py @@ -120,7 +120,16 @@ def render_constructor( # write the post_install scripts referenced in the construct dict if platform.startswith("win"): with (constructor_dir / "post_install.bat").open("w") as f: - f.write("\n".join((r"del /q %PREFIX%\pkgs\*.tar.bz2", "exit 0", ""))) + f.write( + "\n".join( + ( + r'echo {"env_vars": {"GR_PREFIX": "", "GRC_BLOCKS_PATH": "", "UHD_PKG_PATH": "", "VOLK_PREFIX": ""}}>%PREFIX%\conda-meta\state', + r"del /q %PREFIX%\pkgs\*.tar.bz2", + "exit 0", + "", + ) + ) + ) else: with (constructor_dir / "post_install.sh").open("w") as f: f.write(