creusot icon indicating copy to clipboard operation
creusot copied to clipboard

`cargo creusot` rebuilds too much if any `RUSTFLAGS` argument changes

Open Lysxia opened this issue 1 year ago • 1 comments

Issue first noticed here: https://github.com/creusot-rs/creusot/pull/1212#issuecomment-2451799287

cargo creusot and cargo creusot --monolithic make each other rebuild everything including dependencies, even though the flag --monolithic should only affect the current package. The problem is that we are passing options in RUSTFLAGS which applies even to build dependencies. Previously (#1207) we had the opposite problem where cargo did not see the arguments that changed at all, so it did nothing at all when adding/removing --monolithic or any other creusot-rustc argument.

We need a more fine grained way than RUSTFLAGS to pass argument to creusot-rustc.

Lysxia avatar Nov 04 '24 15:11 Lysxia

Yea, changing RUSTFLAGS (correctly) causes cargo to rebuild everything. We definitely need to pass arguments through another mechanism, but then that re-introduces the stale detection issues with cargo. it might be worth asking on zulip / irlo.

xldenis avatar Nov 04 '24 15:11 xldenis

Closed by #1764, which undoes #1212. In the end, the creusot-rustc options are not meant to change in regular usage, and in any case they only affect the output Coma files and they shouldn't affect the hashes of other rustc artefacts. The state of argument handling in Creusot is still wonky but normal users shouldn't be messing with those arguments anyway.

Lysxia avatar Oct 07 '25 09:10 Lysxia