themill / wiz

Environment management framework
GNU Lesser General Public License v3.0
45 stars 4 forks source link

Definitions with 'auto-use' and conditions can lead to incorrect namespace to be guessed #60

Closed buddly27 closed 4 years ago

buddly27 commented 4 years ago

Wiz tries to guess the namespace when no namespace is being given to him, so we usually want to give fully qualified name in definition requirements to ensure that the expected one is being picked.

# No namespace given
> wiz use foo

# Explicitly fetch definition without namespace 
> wiz use ::foo

# Explicitly fetch definition with namespace 
> wiz use namespace::foo

However, Qip is creating definitions which require python instead of ::python. This is done on purpose so it can pick a different python when it is required (e.g. maya::python, flame::python).

The issue is that the namespace can be guessed from definitions which are automatically used but conditioned to another definition. For instance:

{
    "identifier": "bar",
    "namespace": "maya",
    "auto-use": true,
    "conditions": [
        "maya::maya"
    ]
}

Having this definition will cause maya::python to be picked all the time over python.

To fix this bug, we need to ensure that namespace is not guessed from conditioned packages.

buddly27 commented 4 years ago

Here are two suggestions to fix this issue: