Infinite loop on builds and general understanding of build order and priorities

Answered

Hi, we have a number of projects, checked out to a common root (not the default folder). As is usual with multiple projects, there are dependencies with them, so A is dependent on B, C is dependent on B and D etc.

What we want is for B to rebuild if A changes and C to be rebuilt if B OR D changes. I have setup "Finish Build Triggers" in A (when B finishes) and C (when B or D finishes) - without Snapshot dependencies. There was a problem with these building in the correct order, so I added priorities so they would be added to the build queue in the correct order. The priorities seemed to be ignored, so I added snapshot dependencies to A and C too.

Obviously we have many more than 4 projects - and now I am in the situation where sometimes the number of build queues keeps going up (above the number of projects we have) and builds keep getting queued for reasons I can't explain (e.g. B gets built, A gets built, then B is retriggered). 

So, my question is: What is the correct way to setup projects so a change to B triggers builds of A and C and defining the order so B would go in the queue above A?

I can also see that projects are not in the build queue in the priority order set, which is also confusing

Thanks

0
2 comments

The common TeamCity approach would be to set up a Build Chain (https://www.jetbrains.com/help/teamcity/build-chain.html#Configuring+Build+Chains). You can make Build A dependent on Build B with a snapshot dependency. Then, when you want Build B to run, trigger a build on Build A. You can probably move your current trigger for Build B to Build A. When Build A is triggered, it will trigger a build on Build B before Build A runs.

This might also help with your queue priority issue, but I think I might need some additional information to look into this part.

0

Thanks Eric. What happens if projects J and K  depend on A? Using a build chain implies that if J and K are built (separately), each will trigger a build of A. Is that the case?

We have many projects that depend on a few 'base' projects,so it sounds like the base projects will be built multiple times, one for each project that depends on it.So if we had J, K, L, M, N, O all dependent on A and we built all of J, K, L, M, N, O then A would be built 6 times.

Richard

0

Please sign in to leave a comment.