extending sections using <= fails transitively

Bug #605017 reported by Dylan Jay
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Buildout
New
Undecided
Unassigned

Bug Description

A buildout such as the following will fail

parts = C B
[A]
recipe = blah

[B]
<=A

[C]
<=B

This will cause C to inadvertently remove the <=A from [B]. B will then have no recipe.

Revision history for this message
Dylan Jay (t-launchpad-dylanjay-com) wrote :
Revision history for this message
Vincent Pelletier (vincent-nexedi) wrote :

Hi.

I experienced this bug too. I attach an almost stand-alone test case (based on the "<=" section in buildout doc on pypi). The bug triggers when filling myfiles2 section (copy/paste of myfiles section, with different path).
Also, I developped a slightly different (one-word-er) fix for this bug (I didn't look in the bug tracker first...), I attach it as well.

Regards,
Vincent Pelletier

Revision history for this message
Vincent Pelletier (vincent-nexedi) wrote :
Revision history for this message
Vincent Pelletier (vincent-nexedi) wrote :

Patch in #3 is wrong: extended section properties take precedence over overriding's properties. This case is not demonstrated by the documentation, but I'm convinced the current behaviour is intentional.

Revision history for this message
Vincent Pelletier (vincent-nexedi) wrote :

New version of patch #3, this time preserving different-name section extension (aka "<=", as opposed to same-name aka "[buildout]\nextends = ...") precedence.

Revision history for this message
Vincent Pelletier (vincent-nexedi) wrote :

I found a case which is better served by patch in comment #1: if some section alters an extended section during initialisation, my fix would hide that alteration, while patch #1 would make it available (because extentions are always walked through entirely, while my patch caches the result of first walkthrough).

I cannot think of a valid case for such alteration, but nevertheless patch #1 pushes less assumptions to the code than mine, hence it is better.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

There's now a suggested fix at https://github.com/buildout/buildout/pull/37

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.