[m-dev.] mmc --generate-dependencies and foreign import modules

Julien Fischer jfischer at opturion.com
Fri Mar 27 14:11:13 AEDT 2020


Hi Keri,

Apologies for the belated response.

On Mon, 23 Mar 2020, Keri Harris wrote:

> I've noticed that with mercury 20.01.1 the
> hard_coded/foreign_import_module unit test is failing:
>
>   mmc --generate-dependencies foreign_import_module
>   mmc --compile-to-c foreign_import_module
>   mgnuc -- -c foreign_import_module.c -o foreign_import_module.o
>   foreign_import_module.c:40.10: fatal error:
>    foreign_import_module_2.mh: No such file or directory
>   compilation terminated.

It also fails with the most recent ROTD, but only when I run the test
manually, e.g.

     $ mmake foreign_import_module.depend
     $ mmake foreign_import_module.runtest

OTOH, doing a mmake runtest in the tests/hard_coded directory works fine.

> It appears that the 'mmc --generate-dependencies' step is generating a
> '.d' file which is missing .mh dependencies:
>
>   $ mmc --generate-dependencies foreign_import_module
>
>   $ grep -A4 "foreign_import_module\.\$O" foreign_import_module.d
>     foreign_import_module.$O : \
>                     builtin.mh \
>                     int.mh \
>                     io.mh \
>                     private_builtin.mh

What exactly --generate-dependencies *does* do has been the subject of
some discussion on the reviews lists recently ;-)

> After the subsequent call to 'mmc --compile-to-c' the '.d' file does
> contain all dependencies:
>
>   $ mmc --compile-to-c foreign_import_module
>
>   $ grep -A7 "foreign_import_module\.\$O" foreign_import_module.d
>     foreign_import_module.$O : \
>                     array.mh \
>                     bitmap.mh \
>                     foreign_import_module.mh \
>                     foreign_import_module_2.mh \
>                     io.mh \
>                     string.mh \
>                     time.mh
>
> Running 'mmc --make foreign_import_module' works, but the unit tests

mmc --make use a different chunk of code do compute file depenencies.

> rely on 'mmc --generate-dependencies' generating a correct dependency
> graph. Is this a known issue?

It is now - thanks for reporting it.

Julien.


More information about the developers mailing list