public inbox for goredo-devel@lists.cypherpunks.ru
Atom feed
From: Sergey Matveev <stargrave@stargrave•org>
To: goredo-devel@lists.cypherpunks.ru
Subject: Re: [PATCH] Don't create nested target directories automatically
Date: Fri, 15 Apr 2022 19:23:38 +0300	[thread overview]
Message-ID: <YlmcCjH/AmTwNqxY@stargrave.org> (raw)
In-Reply-To: <96b4042d-a742-481e-9891-676cb9a0c6c9@spacefrogg.net>

[-- Attachment #1: Type: text/plain, Size: 1894 bytes --]

*** goredo [2022-04-15 13:17]:
>Next situation: In goredo, it is legal and wanted, that you can implement always-out-of-date targets by not creating any output. You would still need the directory to store the record for that target. And it would not be obvious, why you'd have to have a mkdir call, when you don't want to write something.

Absolutely right! Phony targets will anyway just have to store at least
their "Build:"-identifier that is used to determine if the target was
already built during parallel jobs run. And it keeps ifcreate-dependencies
on .do-files. Phony targets are the first citizen dependencies as any
others too, they just do not has any content and are always out-of-date
because of that.

>One suggestion to your patch: Instead of failing, you could defer creating the directory to the point where redo actually wants to write a record to a file.

The only thing I see is really just to defer creating of dependency
information file until .do-file was really found. But if .do file is
run, then directories will be created anyway to store $3 and stdout
output. They can neither be deferred nor placed in other directories,
because they are renamed, that happens only within single filesystem.
So if .do fails, then anyway you will have directories and probably
empty .redo left.

Is it worth adding more complex code, just to remove some garbage if no
.do file was found? Anyway if you have got some default.do in
directories above, then the whole bunch of directories and .redo will be
created anyway, probably failing the target, leaving no $3/stdout files,
but directories are have to be created there. And you can not remove
them, checking if they are empty, because that will race with probably
running simultaneous jobs.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2022-04-15 16:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15  0:55 [PATCH] Don't create nested target directories automatically Andrew Chambers
2022-04-15  6:10 ` goredo
2022-04-15  6:49   ` Andrew Chambers
2022-04-15  7:15     ` goredo
2022-04-15  7:31       ` Andrew Chambers
2022-04-15  9:28         ` goredo
2022-04-15 12:00           ` Andrew Chambers
2022-04-15 13:17             ` goredo
2022-04-15 13:39               ` Andrew Chambers
2022-04-15 13:58                 ` goredo
2022-04-15 16:23               ` Sergey Matveev [this message]
2022-04-16  0:36                 ` Andrew Chambers
2022-04-15 16:23     ` Sergey Matveev
2022-04-15  6:57   ` Andrew Chambers
2022-04-15 16:23 ` Sergey Matveev