Issue #13948 has been updated by Jeff Weiss.
I looked into the lifecycle around Faces. A face doesn't (and can't) specify it's own defaults with `app_defaults()`. In this case, we're golden because a face that wants to override `$libdir`, it will have to set it either via the command option or in code, both of which will call the hook. We still have a scenario where a face could override `$vardir` via code (while its possible that $vardir can also be overridden with the command line, that scenario doesn't lead to this edge case) and although `$libdir` is defined at `$vardir/lib`, the new value won't cascade down to `$LOAD_PATH` because it wasn't the value of `$libdir` that changed, but rather a dependent interpolated variable. ---------------------------------------- Bug #13948: libdir does not always get added to LOAD_PATH https://projects.puppetlabs.com/issues/13948#change-61205 Author: Chris Price Status: Accepted Priority: Urgent Assignee: Jeff Weiss Category: Faces Target version: Telly Affected Puppet version: Keywords: apps faces pluginsync Branch: There is a hook for the libdir setting that causes it to be added to the ruby LOAD_PATH whenever a value is assigned to it. Without this hook being triggered, puppet won't be able to locate faces and applications correctly. This is problematic if the user's configuration leaves libdir set to its default value of "$vardir/lib"; in this case it never gets explicitly assigned, and thus the hook will never be called. This worked OK in 2.7.x because the libdir setting used ":call_on_define", which meant that the hook would always get called at the time that the setting was defined. However, in Telly, certain settings (including libdir) MUST not be initialized at definition time--doing so introduces very confusing and problematic ordering issues whereby you have to be very careful about what point in the application lifecycle you are able to call "require 'puppet'". Therefore, we no longer use :call_on_define for libdir. To repro this, just pluginsync or copy a module that contains an app or face into your local $vardir/lib, and then run 'puppet help' without explicitly specifying 'libdir'. Your app/face will not show up in the help list. Possible fixes: 1) There is a spot in the code (probably in Settings#set_value or something called from in there) that will detect that we don't currently have a cached, interpolated value for a setting. We could probably check for and trigger the hook at that point in time. 2) Much less desirable, hacky... but would work as a last resort: we could put a line at the end of "Settings#initialize_app_defaults" that explicitly calls the hook for libdir. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
