Mercury Bugs - mercury
View Issue Details
0000569mercuryBugpublic2023-12-04 12:262023-12-06 12:51
Reporterwangp 
Assigned Towangp 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000569: timestamp regression with nested submodules in mmc --make
DescriptionHere is a problem with nested submodules attributed to commit 4d4ef3e3a "Cache timestamps by target file."

This sequence of commands:
```
#!/bin/sh
touch nested_module_test.m
mmc -m nested_module_test
sleep 1
echo --------
mmc -m nested_module_test
```

exhibits this incorrect behaviour:

Making Mercury/int3s/nested_module_test.int3
Making Mercury/int0s/nested_module_test.int0
Making Mercury/ints/nested_module_test.int
Making Mercury/cs/nested_module_test.c
Making Mercury/os/nested_module_test.o
Making nested_module_test
--------
Making Mercury/int3s/nested_module_test.int3
Making Mercury/os/nested_module_test.sub.o
Making nested_module_test

where nested_module_test.sub.o and nested_module_test are re-made by the second call to mmc --make, when they should already be up-to-date.


The previous (correct) behaviour is:

Making Mercury/int3s/nested_module_test.int3
Making Mercury/int0s/nested_module_test.int0
Making Mercury/ints/nested_module_test.int
Making Mercury/cs/nested_module_test.c
Making Mercury/os/nested_module_test.o
Making Mercury/os/nested_module_test.sub.o
Making nested_module_test
--------
Making Mercury/int3s/nested_module_test.int3
** Nothing to be done for `nested_module_test'.

[Actually, nested_module_test.int3 should not need to be remade either - that is a long-standing bug, but a minor one.]
TagsNo tags attached.
Attached Files? nested_module_test.m (651) 2023-12-04 12:26
https://bugs.mercurylang.org/file_download.php?file_id=326&type=bug

Notes
(0001227)
zs   
2023-12-05 12:58   
It is possible that this is related to bug 568. Commit 764eab72a
touched make.timestamp.m in a way that removed the special treatment
of modules that are NOT the top modules of their source file.

I am testing a fix for 568 that reverses that commit, but also
fixes the old misleading documentation that led to it. That diff
may, or may not, also fix this bug. I have just posted it to m-rev.
(0001229)
wangp   
2023-12-06 12:51   
Fix committed 2023 dec 6.

Issue History
2023-12-04 12:26wangpNew Issue
2023-12-04 12:26wangpStatusnew => assigned
2023-12-04 12:26wangpAssigned To => wangp
2023-12-04 12:26wangpFile Added: nested_module_test.m
2023-12-05 12:58zsNote Added: 0001227
2023-12-06 12:51wangpStatusassigned => resolved
2023-12-06 12:51wangpResolutionopen => fixed
2023-12-06 12:51wangpNote Added: 0001229