@@ -657,3 +657,61 @@ def test_strip_wheel(any_manylinux_container, docker_python, io_folder):
657
657
["python" , "-c" , "from sample_extension import test_func; print(test_func(1))" ]
658
658
)
659
659
assert output .strip () == "2"
660
+
661
+
662
+ def test_rpath (any_manylinux_container , docker_python , io_folder ):
663
+ policy , manylinux_ctr = any_manylinux_container
664
+ if policy != 'manylinux2014_x86_64' :
665
+ pytest .skip ('This test can only run on manylinux2014_x86_64' )
666
+ orig_wheel = f'gepetto_example_adder-3.0.2-{ PYTHON_ABI } -linux_x86_64.whl'
667
+ # decompress dependencies
668
+ docker_exec (manylinux_ctr , [
669
+ 'bash' , '-c' ,
670
+ 'xz -d -c /auditwheel_src/tests/integration/gepetto_example_adder/'
671
+ f'libboost_python{ PYTHON_ABI_MAJ_MIN } .so.1.72.0.xz > '
672
+ f'/usr/local/lib/libboost_python{ PYTHON_ABI_MAJ_MIN } .so.1.72.0'
673
+ ])
674
+ docker_exec (manylinux_ctr , [
675
+ 'bash' , '-c' ,
676
+ 'xz -d -c /auditwheel_src/tests/integration/gepetto_example_adder/'
677
+ 'libexample-adder.so.3.0.2-6-gd319.xz > '
678
+ '/usr/local/lib/libexample-adder.so.3.0.2-6-gd319'
679
+ ])
680
+
681
+ # check the original wheel is not compliant
682
+ output = docker_exec (manylinux_ctr , [
683
+ 'auditwheel' , 'show' ,
684
+ f'/auditwheel_src/tests/integration/gepetto_example_adder/{ orig_wheel } '
685
+ ])
686
+ assert (
687
+ f'{ orig_wheel } is consistent with the following platform tag: '
688
+ f'"linux_{ PLATFORM } "'
689
+ ) in output .replace ('\n ' , ' ' )
690
+
691
+ # repair
692
+ docker_exec (manylinux_ctr , [
693
+ 'auditwheel' , '-v' , 'repair' , '-w' , '/io' ,
694
+ f'/auditwheel_src/tests/integration/gepetto_example_adder/{ orig_wheel } '
695
+ ])
696
+ filenames = os .listdir (io_folder )
697
+ assert len (filenames ) == 1
698
+ repaired_wheels = [fn for fn in filenames if policy in fn ]
699
+ expected_wheel_name = \
700
+ f'gepetto_example_adder-3.0.2-{ PYTHON_ABI } -{ policy } .whl'
701
+ assert repaired_wheels == [expected_wheel_name ]
702
+ repaired_wheel = repaired_wheels [0 ]
703
+ output = docker_exec (manylinux_ctr , [
704
+ 'auditwheel' , 'show' , f'/io/{ repaired_wheel } '
705
+ ])
706
+ assert (
707
+ f'{ expected_wheel_name } is consistent with the following platform tag: '
708
+ f'"{ policy } "'
709
+ ) in output .replace ('\n ' , ' ' )
710
+
711
+ docker_exec (docker_python , ['pip' , 'install' , f'/io/{ repaired_wheel } ' ])
712
+ with pytest .raises (CalledProcessError ):
713
+ docker_exec (docker_python , [
714
+ 'python' , '-c' ,
715
+ 'import example_adder as exa; assert exa.add(4, 3) == 7'
716
+ ])
717
+ pytest .xfail ('Bad RPATH' )
0 commit comments