Skip to content

Commit 315f12a

Browse files
committed
finish test
1 parent 4272b53 commit 315f12a

File tree

8 files changed

+23
-11
lines changed

8 files changed

+23
-11
lines changed

src/auditwheel/lddtree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ def ldd(
568568
if soname not in _all_libs:
569569
_all_libs[soname] = DynamicLibrary(soname, fullpath, realpath)
570570
if realpath is None:
571-
log.info("Could not locate %s, skipping.", soname)
571+
log.debug("Could not locate %s, skipping.", soname)
572572
continue
573573
if any(fnmatch(str(realpath), e) for e in exclude):
574574
log.info("Excluding %s", realpath)

tests/integration/test_manylinux.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,17 @@ def repair(
161161
strip: bool = False,
162162
library_paths: list[str] | None = None,
163163
excludes: list[str] | None = None,
164+
verbose: int = 0,
164165
) -> str:
165166
plat = plat or self._policy
166167
args = []
167168
if library_paths:
168169
ld_library_path = ":".join([*library_paths, "$LD_LIBRARY_PATH"])
169170
args.append(f"LD_LIBRARY_PATH={ld_library_path}")
170-
args.extend(["auditwheel", "repair", "-w", "/io", "--plat", plat])
171+
args.append("auditwheel")
172+
if verbose:
173+
args.append(f"-{'v' * verbose}")
174+
args.extend(["repair", "-w", "/io", "--plat", plat])
171175
if only_plat:
172176
args.append("--only-plat")
173177
if not isa_ext_check:
@@ -643,6 +647,10 @@ def test_dependency_order(
643647
policy = anylinux.policy
644648

645649
test_path = "/auditwheel_src/tests/integration/testrpath"
650+
orig_wheel = anylinux.build_wheel(test_path)
651+
652+
repair_output = anylinux.repair(orig_wheel, library_paths=[f"{test_path}/a"], verbose=3)
653+
assert 'lddtree:Could not locate libd.so, skipping' in repair_output
646654

647655
def test_multiple_top_level(
648656
self, anylinux: AnyLinuxContainer, python: PythonContainer

tests/integration/testrpath/a/a.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "b.h"
2-
#include "c.h"
2+
#include "d.h"
33

44
int fa(void) {
5-
return 1 + fb() + fc();
5+
return 1 + fb() + fd();
66
}

tests/integration/testrpath/b/b.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "d.h"
2+
13
int fb(void) {
2-
return 10;
4+
return 10 + fd();
35
}

tests/integration/testrpath/c/c.h

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
int fc(void) {
1+
int fd(void) {
22
return 11;
33
}

tests/integration/testrpath/d/d.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int fd(void);

tests/integration/testrpath/setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99

1010
class BuildExt(build_ext):
1111
def run(self) -> None:
12-
cmd = "gcc -fPIC -shared -o c/libc.so c/c.c"
12+
cmd = "gcc -fPIC -shared -o d/libd.so d/d.c"
1313
subprocess.check_call(cmd.split())
14-
cmd = "gcc -fPIC -shared -o b/libb.so b/b.c -Ic -Lc -lc"
14+
cmd = "gcc -fPIC -shared -o b/libb.so b/b.c -Id"
15+
subprocess.check_call(cmd.split())
16+
cmd = "patchelf --add-needed libd.so b/libb.so"
1517
subprocess.check_call(cmd.split())
1618
cmd = (
1719
"gcc -fPIC -shared -o a/liba.so a/a.c "
18-
"-Wl,{dtags_flag} -Wl,-rpath=$ORIGIN/../b -Wl,-rpath=$ORIGIN/../c "
19-
"-Ib -Lb -lb -Ic -Lc -lc"
20+
"-Wl,{dtags_flag} -Wl,-rpath=$ORIGIN/../b -Wl,-rpath=$ORIGIN/../d "
21+
"-Ib -Lb -lb -Id -Ld -ld"
2022
).format(
2123
dtags_flag=(
2224
"--enable-new-dtags"

0 commit comments

Comments
 (0)