File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1078,6 +1078,7 @@ const pkgorigins = Dict{PkgId,PkgOrigin}()
10781078
10791079require (uuidkey:: PkgId ) =  @lock  require_lock _require_prelocked (uuidkey)
10801080
1081+ const  already_warned_path_change_pkgs =  Set {UUID} ()
10811082function  _require_prelocked (uuidkey:: PkgId )
10821083    just_loaded_pkg =  false 
10831084    if  ! root_module_exists (uuidkey)
@@ -1093,6 +1094,16 @@ function _require_prelocked(uuidkey::PkgId)
10931094        error (" package `$(uuidkey. name) ` did not define the expected \
10941095              module `$(uuidkey. name) `, check for typos in package module name"  )
10951096    end 
1097+     pkgorig =  get (pkgorigins, uuidkey, nothing )
1098+     new_path =  locate_package (uuidkey)
1099+     if  pkgorig != =  nothing  &&  pkgorig. path != =  nothing  && 
1100+             ! samefile (fixup_stdlib_path (pkgorig. path), new_path) &&  uuidkey. uuid ∉  already_warned_path_change_pkgs
1101+         @warn  " Package $(uuidkey. name)  already loaded from path $(repr (pkgorig. path)) , \
1102+                now attempted to be loaded from $(repr (new_path)) . This might indicate a \ 
1103+                change of environment between package loads and can mean that incompatible \ 
1104+                packages have been loaded."  
1105+         push! (already_warned_path_change_pkgs, uuidkey. uuid)
1106+     end 
10961107    return  root_module (uuidkey)
10971108end 
10981109
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments