[m-users.] Issues when upgrading from 2019-07-18 to 2019-10-16
Zoltan Somogyi
zoltan.somogyi at runbox.com
Fri Oct 18 16:49:41 AEDT 2019
On Thu, 17 Oct 2019 22:30:46 -0700, M McDonough <foolkingcrown at gmail.com> wrote:
> I recently upgraded the compiler on my Windows machine, and I'm now
> getting some errors when building a library:
>
> z2_c.m:009: In module `z2_c':
> z2_c.m:009: warning: module `mglow' is imported in the interface, but it is
> z2_c.m:009: not used in the interface.
> z2_c.m:011: In module `z2_c':
> z2_c.m:011: warning: module `mopus' is imported in the interface, but it is
> z2_c.m:011: not used in the interface.
> z2_c.m:012: In module `z2_c':
> z2_c.m:012: warning: module `audio_loader' is imported in the interface, but
> z2_c.m:012: it is not used in the interface.
> z2_c.m:013: In module `z2_c':
> z2_c.m:013: warning: module `cinnamon' is imported in the interface, but it
> z2_c.m:013: is not used in the interface.
> <etc, there are many more>
> `Mercury\ints\z2_c.int' and `Mercury\int2s\z2_c.int2' not written.
>
> This module is used just to make the a library, so it contains no
> actual preds, types, typeclasses, etc, only imports of the modules
> that make up the library. Has something changed where this now
> prevents int files from being written?
Yes. If the compiler discovers any issues while generating the contents
it wants to put into the interface file, it doesn't go ahead with the
creation of that interface file.
The idea is that all the compilations that use an interface file that has
such issues will have to be (re)done later anyway when the issues are fixed,
because those fixes will cause *different* contents to be generated for that
interface file. Therefore it is better not to waste either the computer's or the
programmer's time with would-have-to-be-repeated-later compiler invocations.
Modules being unnecessarily imported in the interface is one issue now
being detected at interface-file-generation time. There are others, and I am
working on adding more.
I am open to feedback as to whether it would be worthwhile to add an option
to stop the generation of the interface file only for errors, and not for warnings.
Note that such an option would be useful only for projects that do *not* intend
to fix warnings.
> I had thought that the Mercury
> stdlib was built in much the same way.
The Mercury standard library has its imports in its *implementation* section,
not its interface section, so it does not get the warnings above.
Zoltan.
More information about the users
mailing list