[m-rev.] for post-commit review: touched_files

Zoltan Somogyi zoltan.somogyi at runbox.com
Fri Dec 8 22:17:18 AEDT 2023


On 2023-12-08 16:34 +11:00 AEDT, "Peter Wang" <novalazy at gmail.com> wrote:
> On Fri, 08 Dec 2023 16:26:37 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>> 
>> In writing this reply, I dug deeper into how the filenames in the
>> second arg of touched_files are used. I found code that did not document
>> what it did and why. I think I have figured that out, and will modify the code
>> to make that plain. I intend to post it for your review later today. I intend to
>> rename touched_files to make_lhs_files, because I now think that better
>> describes how the info in it is used. Would that work for you?
> 
> It's all right.

The attached diff has bootchecked in hlc.gc, and is partway through stage 3
in a C# bootcheck. If it works, and if Peter approves, I intend to commit it,
and then work on the code further, to fix at least some of the issues that this diff
marks with an XXX MAKE. (Such as including rhs_error in a type named lhs_result.)

The main change I want to make is to split the files in make_lhs_files into four
categories, not three. These would be:

- the lhs target files that do NOT have a corresponding date file (such as .c_date for .c files),
- the lhs target files that DO have a corresponding date file
- the date files of the lhs files in the category above, as now, and
- the foreign code files, as now.

So the change in the split of what used to the first field of three into two fields.

The rationale for this is as follows.

- To decide whether we need to execute the make rule's action because some of the
  lhs files do not exist, we need to test whether the files in the first two categories above
  exist. (Arguably, we should also test for the existence of the files in the fourth one
  as well, but we have not been doing that.)

- To decide whether we need to execute the make rule's action because some of the
  lhs files are out of date, we need to test the timestamps of the files in categories
  2, 3 and 4. The current code does that, but it gets the timestamps of the files
  in categories 1 and 3 TWICE.

- For the purpose of cleaning up after a failed make action, we need to be able delete files
  in all four categories.

Peter, do you have any objections to this plan?

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.lhs
Type: application/octet-stream
Size: 857 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20231208/eb7d0c4f/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.lhs
Type: application/octet-stream
Size: 65542 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20231208/eb7d0c4f/attachment-0003.obj>


More information about the reviews mailing list