Compilation & package

Neither case should work. A package only has visibility to identifiers in the package itself, or those have been imported into it. The import pkg1::* needs to be inside the scope of pkg2 in order to see the declaration of abc1.

The compilation unit scope is an area of code that is not inside any other package/module/interface.