Skip to content

Commit

Permalink
Switch to uv. Deleted unwanted directories
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Feb 25, 2025
1 parent a606294 commit 1e401d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.
2 changes: 1 addition & 1 deletion blint_db/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# variables
DEBUG_MODE = False
# constants
TEMP_PATH = Path(os.getenv("BLINT_DB_TEMP", Path.cwd().absolute())) / "temp"
TEMP_PATH = Path(os.getenv("BLINT_DB_TEMP", str(Path.cwd()))) / "temp"
WRAPDB_LOCATION = TEMP_PATH / "wrapdb"
VCPKG_LOCATION = TEMP_PATH / "vcpkg"

Expand Down
35 changes: 5 additions & 30 deletions blint_db/handlers/language_handlers/meson_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,6 @@ def __init__(self):
git_clone(WRAPDB_URL, WRAPDB_LOCATION)
git_checkout_commit(WRAPDB_LOCATION, WRAPDB_HASH)

def build(self, project_name):
setup_command = (
f"meson setup build/{project_name} -Dwraps={project_name}".split(" ")
)
meson_setup = subprocess.run(setup_command, cwd=WRAPDB_LOCATION, check=False, env=os.environ.copy(), shell=sys.platform == "win32", encoding="utf-8")
subprocess_run_debug(meson_setup, project_name)
compile_command = f"meson compile -C build/{project_name}".split(" ")
meson_compile = subprocess.run(
compile_command, cwd=WRAPDB_LOCATION, check=False
)
subprocess_run_debug(meson_compile, project_name)

def find_executables(self, project_name):
full_project_dir = WRAPDB_LOCATION / "build" / project_name / "subprojects"
executable_list = []
for root, dir, files in os.walk(full_project_dir):
for file in files:
# what is the value of variable `root`
file_path = Path(root) / file
if os.access(file_path, os.X_OK) or ".so" in file_path.absolute():
executable_list.append(file_path)
return executable_list

def delete_project_files(self, project_name):
pass

Expand All @@ -59,13 +36,11 @@ def get_project_list(self):


def meson_build(project_name):
setup_command = f"meson setup build/{project_name} -Dwraps={project_name}".split(
" "
)
meson_setup = subprocess.run(setup_command, cwd=WRAPDB_LOCATION, check=False, env=os.environ.copy(), shell=sys.platform == "win32", encoding="utf-8")
setup_command = f"meson setup -Dwraps={project_name}".split(" ")
meson_setup = subprocess.run(setup_command, cwd=os.path.join(WRAPDB_LOCATION, "build", project_name), check=False, env=os.environ.copy(), shell=sys.platform == "win32", encoding="utf-8")
subprocess_run_debug(meson_setup, project_name)
compile_command = f"meson compile -C build/{project_name}".split(" ")
meson_compile = subprocess.run(compile_command, cwd=WRAPDB_LOCATION, check=False, env=os.environ.copy(), shell=sys.platform == "win32", encoding="utf-8")
compile_command = "meson compile".split(" ")
meson_compile = subprocess.run(compile_command, cwd=os.path.join(WRAPDB_LOCATION, "build", project_name), check=False, env=os.environ.copy(), shell=sys.platform == "win32", encoding="utf-8")
subprocess_run_debug(meson_compile, project_name)


Expand All @@ -76,7 +51,7 @@ def find_meson_executables(project_name):
for file in files:
# what is the value of variable `root`
file_path = Path(root) / file
if os.access(file_path, os.X_OK) or ".so" in file_path.absolute():
if os.access(file_path, os.X_OK) or ".so" in str(file_path):
executable_list.append(file_path)
return executable_list

Expand Down

0 comments on commit 1e401d6

Please sign in to comment.