Raise error if building with an enforced target when previously building without enforcing and the target is not fully supported
#2,594 opened on Feb 10, 2024
Description
If you run gleam run -m blah where blah is a module from a dependency it is possible for the root package to build even if it doesn't support the current target. This is so that you can run deps code that is for the other target.
This is good, but there's a problem in that when you run gleam build again normally it reports success as the modules are loaded from the cache, and this does not check target support even if it is supposed to be enforced. This could be confusing to someone as it seems their build works when it does not.
It is not possible however to get into a bad state here as gleam run and gleam publish will both check to make sure the target is supported. As such this is a very low priority item of work.