File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -283,16 +283,20 @@ impl ToolchainComponents {
283283 for entry in fs:: read_dir ( dir) . context ( "Cannot read lib dir to find components" ) ? {
284284 let entry = entry?;
285285 let path = entry. path ( ) ;
286- if path. is_file ( ) && path . extension ( ) == Some ( OsStr :: new ( "so" ) ) {
286+ if path. is_file ( ) {
287287 if let Some ( filename) = path. file_name ( ) . and_then ( |s| s. to_str ( ) ) {
288+ // libLLVM.so can have a weird suffix, like libLLVM.so.<suffix>, so we don't
289+ // check its .so suffix directly.
288290 if filename. starts_with ( "libLLVM" ) {
289291 self . lib_llvm = Some ( path) ;
290- } else if filename. starts_with ( "librustc_driver" ) {
291- self . lib_rustc = Some ( path) ;
292- } else if filename. starts_with ( "libstd" ) {
293- self . lib_std = Some ( path) ;
294- } else if filename. starts_with ( "libtest" ) {
295- self . lib_test = Some ( path) ;
292+ } else if path. extension ( ) == Some ( OsStr :: new ( "so" ) ) {
293+ if filename. starts_with ( "librustc_driver" ) {
294+ self . lib_rustc = Some ( path) ;
295+ } else if filename. starts_with ( "libstd" ) {
296+ self . lib_std = Some ( path) ;
297+ } else if filename. starts_with ( "libtest" ) {
298+ self . lib_test = Some ( path) ;
299+ }
296300 }
297301 }
298302 }
You can’t perform that action at this time.
0 commit comments