Form must depend on control

Hello everyone,
I want to exchange the constrains and objective function in the case like Topology optimisation of fluids in Stokes flow in the official tutorials

volume_constraint = UFLInequalityConstraint((V/delta - rho)*dx, m)

if A involve rho such as

A1 = (0.5 * inner(alpha(rho) * u, u) * dx + mu * inner(grad(u), grad(u)) * dx)

it will work, but when I use constraint without rho, it will remind me “Form must depend on control”, such as

A2 = (mu * inner(grad(u), grad(u)) * dx)

it seems that variable rho must be involved in the constrains explicitly. But A2 is actually influenced by rho, because (u, p) and rho can be calculated by Stokes equation.

How can I implement this constrains?
Thank you for your time.