@@ -2429,7 +2429,14 @@ def test_sanity_check_paths_lib64(self):
24292429
24302430 # modify test easyconfig: move lib/libtoy.a to lib64/libtoy.a
24312431 ectxt = re .sub (r"\s*'files'.*" , "'files': ['bin/toy', ('lib/libtoy.a', 'lib/libfoo.a')]," , ectxt )
2432- postinstallcmd = "mkdir %(installdir)s/lib64 && mv %(installdir)s/lib/libtoy.a %(installdir)s/lib64/libtoy.a"
2432+ postinstallcmd = ' && ' .join ([
2433+ # remove lib64 symlink (if it's there)
2434+ "rm -f %(installdir)s/lib64" ,
2435+ # create empty lib64 dir
2436+ "mkdir %(installdir)s/lib64" ,
2437+ # move libtoy.a
2438+ "mv %(installdir)s/lib/libtoy.a %(installdir)s/lib64/libtoy.a" ,
2439+ ])
24332440 ectxt = re .sub ("postinstallcmds.*" , "postinstallcmds = ['%s']" % postinstallcmd , ectxt )
24342441
24352442 test_ec = os .path .join (self .test_prefix , 'toy-0.0.eb' )
@@ -3844,7 +3851,6 @@ def test_toy_build_lib_lib64_symlink(self):
38443851 toy_ec = os .path .join (test_ecs , 't' , 'toy' , 'toy-0.0.eb' )
38453852
38463853 test_ec_txt = read_file (toy_ec )
3847- test_ec_txt += "\n postinstallcmds += ['mv %(installdir)s/lib %(installdir)s/lib64']"
38483854
38493855 test_ec = os .path .join (self .test_prefix , 'test.eb' )
38503856 write_file (test_ec , test_ec_txt )
@@ -3857,30 +3863,30 @@ def test_toy_build_lib_lib64_symlink(self):
38573863 lib_path = os .path .join (toy_installdir , 'lib' )
38583864 lib64_path = os .path .join (toy_installdir , 'lib64' )
38593865
3860- # lib64 subdir exists, is not a symlink
3861- self .assertExists (lib64_path )
3862- self .assertTrue (os .path .isdir (lib64_path ))
3863- self .assertFalse (os .path .islink (lib64_path ))
3864-
3865- # lib subdir is a symlink to lib64 subdir
3866+ # lib subdir exists, is not a symlink
38663867 self .assertExists (lib_path )
38673868 self .assertTrue (os .path .isdir (lib_path ))
3868- self .assertTrue (os .path .islink (lib_path ))
3869- self .assertTrue (os .path .samefile (lib_path , lib64_path ))
3869+ self .assertFalse (os .path .islink (lib_path ))
38703870
3871- # lib symlink should point to a relative path
3872- self .assertFalse (os .path .isabs (os .readlink (lib_path )))
3871+ # lib64 subdir is a symlink to lib subdir
3872+ self .assertExists (lib64_path )
3873+ self .assertTrue (os .path .isdir (lib64_path ))
3874+ self .assertTrue (os .path .islink (lib64_path ))
3875+ self .assertTrue (os .path .samefile (lib64_path , lib_path ))
3876+
3877+ # lib64 symlink should point to a relative path
3878+ self .assertFalse (os .path .isabs (os .readlink (lib64_path )))
38733879
38743880 # cleanup and try again with --disable-lib-lib64-symlink
38753881 remove_dir (self .test_installpath )
38763882 with self .mocked_stdout_stderr ():
3877- self ._test_toy_build (ec_file = test_ec , extra_args = ['--disable-lib- lib64-symlink' ])
3883+ self ._test_toy_build (ec_file = test_ec , extra_args = ['--disable-lib64-lib -symlink' ])
38783884
3879- self .assertExists (lib64_path )
3880- self .assertNotExists (lib_path )
3881- self .assertNotIn ('lib ' , os .listdir (toy_installdir ))
3882- self .assertTrue (os .path .isdir (lib64_path ))
3883- self .assertFalse (os .path .islink (lib64_path ))
3885+ self .assertExists (lib_path )
3886+ self .assertNotExists (lib64_path )
3887+ self .assertNotIn ('lib64 ' , os .listdir (toy_installdir ))
3888+ self .assertTrue (os .path .isdir (lib_path ))
3889+ self .assertFalse (os .path .islink (lib_path ))
38843890
38853891 def test_toy_build_sanity_check_linked_libs (self ):
38863892 """Test sanity checks for banned/requires libraries."""
0 commit comments