Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/install_nixl_from_source_ubuntu.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def is_pip_package_installed(package_name):
def find_nixl_wheel_in_cache(cache_dir):
"""Finds a nixl wheel file in the specified cache directory."""
# The repaired wheel will have a 'manylinux' tag, but this glob still works.
search_pattern = os.path.join(cache_dir, "nixl-*.whl")
search_pattern = os.path.join(cache_dir, "nixl*.whl")
wheels = glob.glob(search_pattern)
Comment on lines +40 to 41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The glob pattern nixl*.whl is a bit too broad. It would match any file starting with nixl and ending with .whl, such as a hypothetical nixltools-1.0.whl. This could lead to selecting the wrong wheel file if multiple such files exist in the cache and the sort order is not favorable.

To make the search more robust, it's better to use two more specific glob patterns: one for the old format (nixl-*.whl) and one for the new format (nixl_*-*.whl). This ensures we only match wheels for the nixl package, accommodating both naming conventions while being less likely to match unrelated packages.

Suggested change
search_pattern = os.path.join(cache_dir, "nixl*.whl")
wheels = glob.glob(search_pattern)
wheels = glob.glob(os.path.join(cache_dir, "nixl-*.whl"))
wheels.extend(glob.glob(os.path.join(cache_dir, "nixl_*-*.whl")))

if wheels:
# Sort to get the most recent/highest version if multiple exist
Expand Down