@@ -2429,7 +2429,14 @@ def test_sanity_check_paths_lib64(self):
2429
2429
2430
2430
# modify test easyconfig: move lib/libtoy.a to lib64/libtoy.a
2431
2431
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
+ ])
2433
2440
ectxt = re .sub ("postinstallcmds.*" , "postinstallcmds = ['%s']" % postinstallcmd , ectxt )
2434
2441
2435
2442
test_ec = os .path .join (self .test_prefix , 'toy-0.0.eb' )
@@ -3844,7 +3851,6 @@ def test_toy_build_lib_lib64_symlink(self):
3844
3851
toy_ec = os .path .join (test_ecs , 't' , 'toy' , 'toy-0.0.eb' )
3845
3852
3846
3853
test_ec_txt = read_file (toy_ec )
3847
- test_ec_txt += "\n postinstallcmds += ['mv %(installdir)s/lib %(installdir)s/lib64']"
3848
3854
3849
3855
test_ec = os .path .join (self .test_prefix , 'test.eb' )
3850
3856
write_file (test_ec , test_ec_txt )
@@ -3857,30 +3863,30 @@ def test_toy_build_lib_lib64_symlink(self):
3857
3863
lib_path = os .path .join (toy_installdir , 'lib' )
3858
3864
lib64_path = os .path .join (toy_installdir , 'lib64' )
3859
3865
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
3866
3867
self .assertExists (lib_path )
3867
3868
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 ))
3870
3870
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 )))
3873
3879
3874
3880
# cleanup and try again with --disable-lib-lib64-symlink
3875
3881
remove_dir (self .test_installpath )
3876
3882
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' ])
3878
3884
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 ))
3884
3890
3885
3891
def test_toy_build_sanity_check_linked_libs (self ):
3886
3892
"""Test sanity checks for banned/requires libraries."""
0 commit comments