Well, not if the cleanup patch goes at the end of that sequence rather than the beginning.
That's what I meant by a "final cleanup patch". However this is not an issue that any sequencing of such patches can fix:
Without rebase, every patch has an implicit implication that if it builds cleanly when applied to its parent, it builds cleanly no matter what other patches are merged into the tree in the future.
Once you start rebasing, you lose that guarantee unless you edit the patches themselves: there's no guarantee that just because sequences A-B-C, A-D and A-D-E each build, that A-B-C-D will build. Hence bisect (which may need to build A-B-C-D) breaks.
The thing is, when you rebase, you don't have A-B-C-D at all. If you have A-B-C and A-D and you rebase A-D onto A-B-C, you actually have A-B-C and A-B-C-D', where D' is the same diff as D, but it's a different revision. And when you build, you may find that D' doesn't work when D did.
Merging doesn't even help, because if you merge A-D to A-B-C, you end up with:
A-B-C-M
\_D_/
at which point M would be broken in the same cases where D' would be broken.
The point is M contains the fixes required to make A-B-C plus A-D build. Then you have no histories in that tree that don't compile.
Like you said, A-B-C-D' DOESN'T build, PRECISCELY because D' is the same diff as D. You need to make A-B-C-D'-M to get a working build, but the history A-B-C-D' is STILL BROKEN.
So you run a build on D', make the necessary fixes, and amend it. Which is exactly what you would have had to do with M anyway, or else M wouldn't build either. I don't see any difference at all.
Merge commits don't magically fix broken builds. All they do is ensure that you've resolved merge conflicts, but rebases do the same thing!
That's what I meant by a "final cleanup patch". However this is not an issue that any sequencing of such patches can fix:
Without rebase, every patch has an implicit implication that if it builds cleanly when applied to its parent, it builds cleanly no matter what other patches are merged into the tree in the future.
Once you start rebasing, you lose that guarantee unless you edit the patches themselves: there's no guarantee that just because sequences A-B-C, A-D and A-D-E each build, that A-B-C-D will build. Hence bisect (which may need to build A-B-C-D) breaks.