llvm / llvm-zorg

Other
56 stars 94 forks source link

Clean source dir on request in PollyBuilder. #189

Closed efriedma-quic closed 1 month ago

Meinersbur commented 1 month ago

"On request" is step.build.getProperty("clean"). Using the clean argument will delete the source directory every single build for builders where this is set (e.g. polly-arm-linux) and redownload >1GB from GitHub. I think we should not abuse the available bandwidth.

efriedma-quic commented 1 month ago

The reason this came up was that there was a bad commit in LLVM that stuck some files into the source tree, so then the buildbot was continuously failing. We ended up logging into the buildbot to fix it by hand.

Is there some way to force a clean through the buildbot interface? Not sure how you do that, or what kind of permissions are required.

Can we make the buildbot run "git clean" to fix this sort of issue automatically, without re-downloading the whole tree?

Meinersbur commented 1 month ago

When you login and your GitHub email matches the email in the zorg config, a couple of options become available:

image

image

The step.build.getProperty("clean") property is set using this flag:

image

Both flags together don't always work as expected for all factories but I've been running against walls with that one already.

Local git repositories can fail a lot of different ways (e.g. disk corruption) and there is no one-solution-fits-them-all to fix it. I think occasionally re-cloning a broken repository manually is fine. Would be nice if buildbot would itself detect a broken repository but that would be an upstream feature.

efriedma-quic commented 1 month ago

I suspect a "git clean" handles the most common cases, so maybe worth doing even if it doesn't fix everything?

Otherwise, I guess if this is working as intended, we can leave it, sure.

Meinersbur commented 1 month ago

Buildbot does git reset --hard to checkout the next revision. What would git clean fix that git reset --hard doesn't?

efriedma-quic commented 1 month ago

git reset --hard only affects tracked files. git clean would delete untracked files (which lit tests can introduce by accident pretty easily).

Meinersbur commented 1 month ago

@efriedma-quic Buildbot seems to support what we want according to the documentation: https://docs.buildbot.net/current/manual/configuration/steps/source_git.html#step-Git