autoPatchelfHook: support glob patterns
so for example cuda could be ignored by setting: ``` nix autoPatchelfIgnoreMissingDeps = [ "*cuda*.so*" ]; ```
This commit is contained in:
parent
41c09640e7
commit
01535ff0b0
|
@ -5,6 +5,7 @@ import os
|
||||||
import pprint
|
import pprint
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from fnmatch import fnmatch
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
@ -265,8 +266,10 @@ def auto_patchelf(
|
||||||
print(f"auto-patchelf: {len(missing)} dependencies could not be satisfied")
|
print(f"auto-patchelf: {len(missing)} dependencies could not be satisfied")
|
||||||
failure = False
|
failure = False
|
||||||
for dep in missing:
|
for dep in missing:
|
||||||
if dep.name.name in ignore_missing or "*" in ignore_missing:
|
for pattern in ignore_missing:
|
||||||
print(f"warn: auto-patchelf ignoring missing {dep.name} wanted by {dep.file}")
|
if fnmatch(dep.name.name, pattern):
|
||||||
|
print(f"warn: auto-patchelf ignoring missing {dep.name} wanted by {dep.file}")
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
print(f"error: auto-patchelf could not satisfy dependency {dep.name} wanted by {dep.file}")
|
print(f"error: auto-patchelf could not satisfy dependency {dep.name} wanted by {dep.file}")
|
||||||
failure = True
|
failure = True
|
||||||
|
|
Loading…
Reference in a new issue