Which suggests to me a linked list of resource resolvers. First one in the chain to return a file handle to the data or PBC wins. The head of parrot's own "system" chain would be available to be appended to any other chains that wanted it.
And the more I mull this over, the more I really come up with maybe 4 slots in the search chain which are logically important. The order is up for debate, but they all need to be in there (whenever they apply, that is).
1. Paths relative to the PBC binary which is searching for a library. 2. Paths relative to the embedding application. 3. Paths relative to parrot itself (be that libparrot.shlib or parrot). 4. Paths to "system" libraries as specified by the administrator.
When searching for resources, only #1 should be used. Here are some examples:
PBC File: (whatever) Host app: /usr/local/bin/parrot Parrot: /usr/local/lib/libparrot.shlib Consider searches for: icu.dat Search path: 1. /usr/local/shared # Relative to executable
PBC File: D:\inetpub\wwwroot\example.pbchtml Host app: C:\Apache\libexec\httpd.exe Parrot: C:\Parrot\lib Consider searches for: icu.dat mod_parrot.pbc My::WWWUtil.pbc Time::HiRes.pbc Search path: D:\inetpub\wwwroot{,\lib,\..\lib} # Relative to PBC C:\Apache\libexec{,\lib,\..\lib} # Relative to host app C:\CPAN\lib # System libraries C:\Parrot\lib # Relative to parrot
PBC File: ./bin/fib Host app: /home/me/bin/parrot Parrot: /home/me/bin/parrot Consider searches for: icu.dat Time::HiRes.pbc fib.parrot_resource_file One possible search path: ./bin/{,/lib,/../lib} # Relative to PBC /usr/local/lib # System libraries /home/me/lib # Relative to parrot
The scenario which gives me a little bit of heartburn is one like this, though:
Consider, say, an e-commerce site package. Call it OneStep::ECS. Runs under mod_parrot in Apache. Has hooks to load plugins:
• Third-party plugins to provide connectivity to payment processing engines (call it OneStep::VeriSignPayflow.pbc).
• First-party plugins allowing the customer to integrate his storefront with his database (call it MySite::OneStepECSCustomizations.pbc).
Now consider searches for VeriSign::PayflowPro.pbc, PayFlowPro.dll, MySite::CRM.pbc, MySite::Reporting.pbc, mysite_logo.png, Time::HiRes.pbc, libparrot.pbc, CGI.pbc....
So maybe some libraries are "hosts" and need to be included in the search paths of libraries which are linked to them. One could even look at libparrot that way, in which case the search path model becomes:
Paths relative to this PBC file. Paths relative to its hosts. Paths relative to its hosts' hosts. Paths relative to its hosts' hosts' hosts. ... Paths configured by the system administrator.
—
Gordon Henriksen [EMAIL PROTECTED]