Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PUP-2344) Fix issue with inter-module calls (visibility error) #2568

Closed

Conversation

hlindberg
Copy link
Contributor

This fixes the problem where inter-module function calls could
not be made. The main problem was that a function when loaded
was given the public loader and thus had no visibility into its
containing module's dependencies.

The design is that module resolution should be on-demand, only
when something actually needs the proviate loader should it be resolved.
The resolution is triggered by asking for the private loader, but no
such call was made on the call-path when a function was loaded.

This commit adds the notion of private_loader to the loaders (those that
do not have one respond with self). Those that do either provide the
private loader explicitly (environment loader), or on demand (by
obtaining the private loader from loaders).

This change required tests to be modified since the logic now depends
on :loaders being bound in the Puppet context
logic that made this happen on demand was not implemented

This fixes the problem where inter-module function calls could
not be made. The main problem was that a function when loaded
was given the public loader and thus had no visibility into its
containing module's dependencies.

The design is that module resolution should be on-demand, only
when something actually needs the proviate loader should it be resolved.
The resolution is triggered by asking for the private loader,  but no
such call was made on the call-path when a function was loaded.

This commit adds the notion of private_loader to the loaders (those that
do not have one respond with self). Those that do either provide the
private loader explicitly (environment loader), or on demand (by
obtaining the private loader from loaders).

This change required tests to be modified since the logic now depends
on :loaders being bound in the Puppet context
logic that made this happen on demand was not implemented
@puppetcla
Copy link

CLA signed by all contributors.

@zaphod42
Copy link
Contributor

I found a problem when testing this. It tries to call loader on a LoaderModuleData, which doesn't have that method. In reading through the code to track it down I've built up a bunch of cleanups that I'll send out once I get a fix for the loader problem.

@zaphod42
Copy link
Contributor

Closing in favor of GH-2587

@zaphod42 zaphod42 closed this Apr 26, 2014
tdevelioglu pushed a commit to tdevelioglu/puppet that referenced this pull request Mar 29, 2016
@hlindberg hlindberg deleted the pup-2344_calls-between-modules branch September 16, 2017 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants