buildout / buildout

Buildout is a deployment automation tool written in and extended with Python
http://www.buildout.org
Other
570 stars 168 forks source link

Parts += bug with multiple extends #629

Open sgeulette opened 1 year ago

sgeulette commented 1 year ago

with https://github.com/IMIO/collective.behavior.internalnumber/blob/master/test-4.3.cfg

the instance part is not included even though it's setup in https://raw.githubusercontent.com/collective/buildout.plonetest/master/plone-4.3.x.cfg

mauritsvanrees commented 1 year ago

When I use the annotate command, the parts do contain instance:

$ bin/buildout -c test-4.3.cfg annotate
...
parts= 
instance
omelette
ploneversioncheck
createcoverage
code-analysis

And when I run the buildout for real, it indeed creates a bin/instance script. This is on Mac. So: no idea.

You could try an upgrade to zc.buildout 2.13.8, or even 3.0.1 which still works on Python 2.7.

sgeulette commented 1 year ago

Sorry, after encountered the bug (seen by gotcha), I have included instance part in base.cfg to continue working. I just removed my local correction and bumped zc.buildout to 3.0.1. If you test again, I think you will now have the error.

mauritsvanrees commented 1 year ago

Okay, when I revert your change, it no longer installs the instance part.

Let's see, when I take the relevant extends and parts lines, it boils down to this config:

test-4.3.cfg
extends =
    https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-4.3.x.cfg
        extends = plone-4.3.x.cfg
            parts = instance
        parts += test
    base.cfg
        extends = https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
                parts +=
                    code-analysis
                    i18ndude
        parts +=
            omelette
            ploneversioncheck
            createcoverage

From that, I would hope for the following buildout parts, preferably in this order:

instance
test
code-analysis
i18ndude
omelette
ploneversioncheck
createcoverage

Instead, the resulting [buildout] parts option is:

$ bin/buildout -c test-4.3.cfg query buildout:parts

omelette
ploneversioncheck
createcoverage
code-analysis
i18ndude

When I comment out base.cfg, I get:

$ bin/buildout -c test-4.3.cfg query buildout:parts
instance
test

When I keep base.cfg but comment out qa.cfg:

$ bin/buildout -c test-4.3.cfg query buildout:parts
instance
test
omelette
ploneversioncheck
createcoverage

In the original config again, with annotate I see:

parts= 
omelette
ploneversioncheck
createcoverage
code-analysis
i18ndude
    IMPLICIT_VALUE
+=  base.cfg
+=  https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg

So the parts += from buildout.plonetest/master/test-4.3.x.cfg and the parts= from buildout.plonetest/master/test-4.3.x.cfg are effectively ignored.

It could be a bug in Buildout, that it uses an unexpected order when using nested extends.

What seems to work for me:

extends =
    https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-4.3.x.cfg
    https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
    base.cfg
distributist commented 5 months ago

I believe this is the same as issue #176. I supplied a patch and pull request (#226) 9 years ago, but there was no interest in it at that time. I've been patching buildout 2 and recently buildout 3 internally since then, running an extremely complex buildout with no issues.

I would be happy to create an updated pull request against buildout 3 (and buildout 2 if desired) if there is interest in fixing this issue.