Skip to content

Commit

Permalink
Get rid of unnecessary bash wrappers in subprocesses.Popen
Browse files Browse the repository at this point in the history
Signed-off-by: Frederik Pfautsch <frederik.pfautsch@missinglinkelectronics.com>
  • Loading branch information
f14h committed Dec 17, 2024
1 parent 4276e82 commit 0e179bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fpga/usrp3/tools/utils/repeat_fpga_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def run_ip_build(
logging.info(f"Running IP build with command: {cmd}")
output = ""
with subprocess.Popen(
f'/bin/bash -c "{cmd}"',
cmd,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
Expand Down
7 changes: 1 addition & 6 deletions host/python/uhd/rfnoc_utils/image_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@

USRP3_LIB_RFNOC_DIR = os.path.join("usrp3", "lib", "rfnoc")

# Path to the system's bash executable
BASH_EXECUTABLE = "/bin/bash" # FIXME this should come from somewhere

# Map device names to the corresponding directory under usrp3/top
DEVICE_DIR_MAP = {
"x300": "x300",
Expand Down Expand Up @@ -86,7 +83,7 @@ def get_vivado_path(fpga_top_dir, args):
get_viv_path_cmd = '. ./setupenv.sh && echo "VIVADO_PATH=\$VIVADO_PATH"'
try:
output = subprocess.check_output(
f'{BASH_EXECUTABLE} -c "{get_viv_path_cmd}"',
get_viv_path_cmd,
shell=True,
cwd=fpga_top_dir,
text=True,
Expand Down Expand Up @@ -289,8 +286,6 @@ def build(fpga_top_dir, device, build_dir, use_secure_netlist, **args):
logging.info(" * Build Artifacts Directory: %s", build_dir)
logging.info(" * Build Output Directory: %s", build_output_dir)
logging.info(" * Build IP Directory: %s", build_ip_dir)
# Wrap it into a bash call:
make_cmd = f'{BASH_EXECUTABLE} -c "{make_cmd}"'
logging.info("Executing the following command: %s", make_cmd)
my_env = os.environ.copy()
ret_val = subprocess.call(make_cmd, shell=True, env=my_env, cwd=fpga_top_dir)
Expand Down

0 comments on commit 0e179bd

Please sign in to comment.