@@ -2414,7 +2414,14 @@ def test_sanity_check_paths_lib64(self):
24142414
24152415 # modify test easyconfig: move lib/libtoy.a to lib64/libtoy.a
24162416 ectxt = re .sub (r"\s*'files'.*" , "'files': ['bin/toy', ('lib/libtoy.a', 'lib/libfoo.a')]," , ectxt )
2417- postinstallcmd = "mkdir %(installdir)s/lib64 && mv %(installdir)s/lib/libtoy.a %(installdir)s/lib64/libtoy.a"
2417+ postinstallcmd = ' && ' .join ([
2418+ # remove lib64 symlink (if it's there)
2419+ "rm -f %(installdir)s/lib64" ,
2420+ # create empty lib64 dir
2421+ "mkdir %(installdir)s/lib64" ,
2422+ # move libtoy.a
2423+ "mv %(installdir)s/lib/libtoy.a %(installdir)s/lib64/libtoy.a" ,
2424+ ])
24182425 ectxt = re .sub ("postinstallcmds.*" , "postinstallcmds = ['%s']" % postinstallcmd , ectxt )
24192426
24202427 test_ec = os .path .join (self .test_prefix , 'toy-0.0.eb' )
@@ -3829,7 +3836,6 @@ def test_toy_build_lib_lib64_symlink(self):
38293836 toy_ec = os .path .join (test_ecs , 't' , 'toy' , 'toy-0.0.eb' )
38303837
38313838 test_ec_txt = read_file (toy_ec )
3832- test_ec_txt += "\n postinstallcmds += ['mv %(installdir)s/lib %(installdir)s/lib64']"
38333839
38343840 test_ec = os .path .join (self .test_prefix , 'test.eb' )
38353841 write_file (test_ec , test_ec_txt )
@@ -3842,30 +3848,30 @@ def test_toy_build_lib_lib64_symlink(self):
38423848 lib_path = os .path .join (toy_installdir , 'lib' )
38433849 lib64_path = os .path .join (toy_installdir , 'lib64' )
38443850
3845- # lib64 subdir exists, is not a symlink
3846- self .assertExists (lib64_path )
3847- self .assertTrue (os .path .isdir (lib64_path ))
3848- self .assertFalse (os .path .islink (lib64_path ))
3849-
3850- # lib subdir is a symlink to lib64 subdir
3851+ # lib subdir exists, is not a symlink
38513852 self .assertExists (lib_path )
38523853 self .assertTrue (os .path .isdir (lib_path ))
3853- self .assertTrue (os .path .islink (lib_path ))
3854- self .assertTrue (os .path .samefile (lib_path , lib64_path ))
3854+ self .assertFalse (os .path .islink (lib_path ))
38553855
3856- # lib symlink should point to a relative path
3857- self .assertFalse (os .path .isabs (os .readlink (lib_path )))
3856+ # lib64 subdir is a symlink to lib subdir
3857+ self .assertExists (lib64_path )
3858+ self .assertTrue (os .path .isdir (lib64_path ))
3859+ self .assertTrue (os .path .islink (lib64_path ))
3860+ self .assertTrue (os .path .samefile (lib64_path , lib_path ))
3861+
3862+ # lib64 symlink should point to a relative path
3863+ self .assertFalse (os .path .isabs (os .readlink (lib64_path )))
38583864
38593865 # cleanup and try again with --disable-lib-lib64-symlink
38603866 remove_dir (self .test_installpath )
38613867 with self .mocked_stdout_stderr ():
3862- self ._test_toy_build (ec_file = test_ec , extra_args = ['--disable-lib- lib64-symlink' ])
3868+ self ._test_toy_build (ec_file = test_ec , extra_args = ['--disable-lib64-lib -symlink' ])
38633869
3864- self .assertExists (lib64_path )
3865- self .assertNotExists (lib_path )
3866- self .assertNotIn ('lib ' , os .listdir (toy_installdir ))
3867- self .assertTrue (os .path .isdir (lib64_path ))
3868- self .assertFalse (os .path .islink (lib64_path ))
3870+ self .assertExists (lib_path )
3871+ self .assertNotExists (lib64_path )
3872+ self .assertNotIn ('lib64 ' , os .listdir (toy_installdir ))
3873+ self .assertTrue (os .path .isdir (lib_path ))
3874+ self .assertFalse (os .path .islink (lib_path ))
38693875
38703876 def test_toy_build_sanity_check_linked_libs (self ):
38713877 """Test sanity checks for banned/requires libraries."""
0 commit comments