To use dev-dependencies, you need to guard with cfg(all(kani, test))
#1258
Labels
[C] Feature / Enhancement
A new feature request or enhancement to an existing feature.
[E] User Experience
An UX enhancement for an existing feature. Including deprecation of an existing one.
When cargo builds a project in test mode that has a dev-dependency, we see 3 basic calls to rustc (i.e. kani-compiler, in our case):
We're adding
--cfg=kani
to all these calls, so if we gate on justcfg(kani)
for theuse
of the dev-dependency, the first build will fail with an unknown import. (Possibly this is deliberate on cargo's part: ensuringcargo build
will succeed before testing? Unfortunately, we inject our additionalcfg(kani)
so it's not actually the same as acargo build
...)If you instead gate your proofs module with
#[cfg(all(kani, test))]
, things will work properly. For example:We should make this unnecessary, somehow. If we adopted #1214, then perhaps we could detect the lack of
--test
inkani-compiler
and thus disable--cfg=kani
. That would fix it...The text was updated successfully, but these errors were encountered: