File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,27 @@ def test_local_lib(venv, wheel_link_against_local_lib):
178178 assert int (output ) == 3
179179
180180
181+ @pytest .mark .skipif (sys .platform in {'win32' , 'cygwin' }, reason = 'requires RPATH support' )
182+ def test_sharedlib_in_package_rpath (wheel_sharedlib_in_package , tmp_path ):
183+ artifact = wheel .wheelfile .WheelFile (wheel_sharedlib_in_package )
184+ artifact .extractall (tmp_path )
185+
186+ origin = '@loader_path' if sys .platform == 'darwin' else '$ORIGIN'
187+
188+ rpath = set (mesonpy ._rpath ._get_rpath (tmp_path / 'mypkg' / f'_example{ EXT_SUFFIX } ' ))
189+ # This RPATH entry should be removed by meson-python but it is not.
190+ build_rpath = {f'{ origin } /../src' }
191+ assert rpath == {origin , * build_rpath }
192+
193+ rpath = set (mesonpy ._rpath ._get_rpath (tmp_path / 'mypkg' / f'liblib{ LIB_SUFFIX } ' ))
194+ # This RPATH entry should be removed by meson-python but it is not.
195+ build_rpath = {f'{ origin } /' }
196+ assert rpath == {f'{ origin } /sub' , * build_rpath }
197+
198+ rpath = set (mesonpy ._rpath ._get_rpath (tmp_path / 'mypkg' / 'sub' / f'libsublib{ LIB_SUFFIX } ' ))
199+ assert rpath == set ()
200+
201+
181202def test_sharedlib_in_package (venv , wheel_sharedlib_in_package ):
182203 venv .pip ('install' , wheel_sharedlib_in_package )
183204 output = venv .python ('-c' , 'import mypkg; print(mypkg.prodsum(2, 3, 4))' )
You can’t perform that action at this time.
0 commit comments