BZR_PLUGIN_PATH should give full control on plugin directories

Bug #412930 reported by Vincent Ladeuil on 2009-08-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Medium
Vincent Ladeuil

Bug Description

And we should change the way we handle it internally.

The actual definition of the PATH used for searching plugins is:
1 ) BZR_PLUGIN_PATH if set, otherwise is $BZR_HOME/plugins
2) append bzrlib/plugins (same intent on windows but done a bit differently)
3) append system-wide installed plugins defined as the arch-less directory

These definition doesn't give a full control to the user nor the packager, since 2 and 3 can't be changed (except with --no-plugins but that doesn't cover all needs :).

If 2) and 3) where set by the distributions in BZR_PLUGIN_PATH, that would:
- address or provide a way to address bugs #316192, bug #145612, bug #82693 and bug #129298
- allows user to more easily control what plugins are taken into account for special runs (selftest in botnet slaves is the use case that prompted me to file that bug)

I'm not sure many users found a good use for BZR_PLUGIN_PATH so far but a simple transition plan may be to just change the default value for BZR_PLUGIN_PATH to include 2) and 3).

Related branches

Vincent Ladeuil (vila) on 2009-08-13
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
John A Meinel (jameinel) wrote :

I don't think distributions should be setting an environment variable as the recommended way to set this up.

I think we can come up with ways to have plugin paths that include both system-wide and user-specific location that the user has some control over.

In all cases, though, I would recommend simplifying the setup as much as we can, rather than complicating everything.

There was also a discussion about having a specific plugin enable/disable flags in config settings, which might alleviate some of this.

>>>>> John A Meinel <email address hidden> writes:

    > I don't think distributions should be setting an
    > environment variable as the recommended way to set this up.

Right, whatever mean we see fit, the point is to be able to
control *all* parts of that path.

    > I think we can come up with ways to have plugin paths that
    > include both system-wide and user-specific location that
    > the user has some control over.

Right, any specifics may be ? ;-)

    > In all cases, though, I would recommend simplifying the
    > setup as much as we can, rather than complicating
    > everything.

    > There was also a discussion about having a specific plugin
    > enable/disable flags in config settings, which might
    > alleviate some of this.

That's sufficiently different I think to keep separate bugs, but
having full control may also help address the case of the plugin
devs that want to activate one version while deactivating
another for a given command.

The main aim here is specifically to be able to *ignore*
system-wide plugins.

I don't mind leaving the bzrlib/plugins always active but that
sounds a bit incomplete.

So how about --no-site-plugins and --no-core-plugins instead ?

Vincent Ladeuil (vila) on 2009-08-19
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
status: Confirmed → In Progress

See the associated branch for a patch that allows:

Overriding the default user plugin directory:
``BZR_PLUGIN_PATH='/path/to/my/other/plugins'``

Disabling the site directory while retaining the user directory:
``BZR_PLUGIN_PATH='-site:+user'``

Disabling all plugins (better achieved with --no-plugins):
``BZR_PLUGIN_PATH='-user:-core:-site'``

Overriding the default site plugin directory:
``BZR_PLUGIN_PATH='/path/to/my/site/plugins:-site':+user``

Changed in bzr:
status: In Progress → Fix Committed
Vincent Ladeuil (vila) on 2009-09-04
summary: - BZR_PLUGIN_PATH should be set by distributions
+ BZR_PLUGIN_PATH should give full control on plugin directories
Vincent Ladeuil (vila) on 2009-09-04
Changed in bzr:
milestone: none → 2.1
status: Fix Committed → Fix Released
Vincent Ladeuil (vila) on 2009-09-17
Changed in bzr:
milestone: 2.1.0 → 2.1b1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers