Fix incremental builds poisoning buildMode-specific artifacts (#2337) (#2342)