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-9794) prevent autoload superclass errors #7590

Merged
merged 2 commits into from Jun 25, 2019

Conversation

tkishel
Copy link
Contributor

@tkishel tkishel commented Jun 21, 2019

With these commits, 'package_targetable.rb' requires 'puppet/provider/package'
avoiding errors when the gem package provider is the first provider to
be autoloaded, which varies depending on the inode order of files in
'puppet/provider/package' and which one 'Dir.entries' happens to returns first.

The 'package_provider' fact in puppetlabs-stdlib triggers this error when it
requires the 'puppet/type/package' outside the body of 'setcode'.

In between the time that 'puppet/type.rb' is required and when when providers
are loaded 'Puppet::Provider::Package' refers to the wrong object. An explicit
'require puppet/provider/package' overwrites an earlier 'Puppet::Provider::Package'
constant, resulting from a mixin of Puppet::Util and Puppet::Provider.

With this commit, 'package_targetable.rb' requires 'puppet/provider/package'
avoiding errors when the gem package provider is the first provider to
be autoloaded, which varies depending on the inode order of files in
'puppet/provider/package' and which one 'Dir.entries' happens to returns first.

The 'package_provider' fact in puppetlabs-stdlib triggers this error when it
requires the 'puppet/type/package' outside the body of 'setcode'.

In between the time that 'puppet/type.rb' is required and when when providers
are loaded 'Puppet::Provider::Package' refers to the wrong object. An explicit
'require puppet/provider/package' overwrites an earlier 'Puppet::Provider::Package'
constant, resulting from a mixin of Puppet::Util and Puppet::Provider.
Addressing the issue of autoloading identified duplicate and missing requires.
With this commit, those duplicate and missing requires are normalized.
@tkishel tkishel requested a review from a team June 21, 2019 23:04
@tkishel tkishel force-pushed the PUP-9794_autoload_superclass branch from 9d6be25 to 14f6565 Compare June 21, 2019 23:05
@tkishel tkishel changed the base branch from master to 5.5.x June 21, 2019 23:16
@puppetcla
Copy link

CLA signed by all contributors.

@joshcooper
Copy link
Contributor

jenkins please test this on amazon7-64

@joshcooper joshcooper merged commit ec423ed into puppetlabs:5.5.x Jun 25, 2019
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