Skip to content

Commit

Permalink
fix: normalize haskell libraries that have no version component
Browse files Browse the repository at this point in the history
  • Loading branch information
swest50 committed Jan 22, 2025
1 parent d68abcf commit 2e621f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/dapper_python/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def normalize_haskell(soname: str) -> (str, Optional[str], bool):
api_hash = name.rsplit('-', 1)[-1]
if len(api_hash) in [20, 21, 22] and api_hash.isalnum():
name = name[:-(len(api_hash) + 1)]
name, version = name.rsplit('-', 1)
return f"{name}.so", version, True
if '-' in name:
name, version = name.rsplit('-', 1)
return f"{name}.so", version, True
else:
return f"{name}.so", None, True
return soname, None, False
1 change: 1 addition & 0 deletions python/tests/test_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def test_haskell_normalization():
("libHSAgda-2.6.3-F91ij4KwIR0JAPMMfugHqV-ghc9.4.7.so", "libHSAgda.so", "2.6.3", None, True),
("libHScpphs-1.20.9.1-1LyMg8r2jodFb2rhIiKke-ghc9.4.7.so", "libHScpphs.so", "1.20.9.1", None, True),
("libHSrts-1.0.2_thr_debug-ghc9.4.7.so", "libHSrts.so", "1.0.2_thr_debug", None, True),
("libHSrts-ghc8.6.5.so", "libHSrts.so", None, None, True)
]
do_soname_normalization_tests(test_cases)

Expand Down

0 comments on commit 2e621f9

Please sign in to comment.