Description
As we approach a new major version there will be more and more breaking changes introduced via compile-time flags, and it becomes infeasible to test every combination of those flags. Our CI currently uses -Dstrict_multi_assign
unconditionally. We should instead express this in terms of some selected flag combinations:
- The normal profile doesn't specify any flags at all. This corresponds to what usually happens at the command line.
- The strict profile incorporates all opt-in breaking changes slated for the next major version. Right now this includes
-Dstrict_multi_assign
, and eventually-Dpreview_overload_order
would belong here too. - The legacy profile incorporates all opt-out breaking changes maintaining the current major version's compatibility behaviour. This includes
-Dno_number_autocast
.
The strict profile will continue to be the default on CI; for the normal and legacy profiles we add jobs that do something along the lines of make crystal std_spec primitives_spec samples
. Note that we don't need to run the compiler specs because every spec's flags come from the spec itself (e.g. as an argument to assert_type
) rather than the spec command line.
We have the extra option of exposing these profiles as compile-time options, for example --profile=normal|strict|legacy
. In that case we need to be explicit about the applied flags in the compiler or the reference manual, because the profiles are no longer an implementation detail in the Makefile.