public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Eli Schwartz <eschwartz93@gmail.com>
To: Ulrich Mueller <ulm@gentoo.org>
Cc: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH 1/2] distutils-r1.eclass: teach setuptools to respect (some) build options
Date: Wed, 13 Sep 2023 17:06:35 -0400	[thread overview]
Message-ID: <54b962d5-2659-2a15-385a-fa314a81ffe8@gmail.com> (raw)
In-Reply-To: <w6gwmwua0ds.fsf@uni-mainz.de>

On 9/13/23 5:27 AM, Ulrich Mueller wrote:
>>>>>> On Wed, 13 Sep 2023, Eli Schwartz wrote:
> 
>>> "|| die" should also be added for the cat command.
> 
>> Redirecting output to a file in a directory you have just guaranteed
>> to exist cannot fail.
> 
> That's a rather bold statement. I can imagine a number of possible
> failures, e.g. no space left on device, quota exceeded, or a low-level
> I/O error of the filesystem. Also fork or exec of the cat command could
> fail (e.g. out of memory).
> 
> While either of these may be unlikely here, best practice is to check
> for errors of _all_ external commands.


The implementation of `die` performs a fork+exec of the sed command,
invokes eerror (many times!) which forks to pipe, invokes $() which
forks, and could behave abnormally due to out of memory. It is not safe
to treat `|| die` as error recovery for an out of memory condition.

The implementation of `die` performs multiple writes to files inside of
${PORTAGE_BUILDDIR}, and could behave abnormally due to write failures.
It is not safe to treat `|| die` as error recovery for a write failure
of the ${PORTAGE_BUILDDIR} drive (whatever the reason for that write
failure).

Regarding:

- no space left on device
- quota exceeded
- low-level I/O error of the filesystem

this isn't "a number of possible failures" :) it is the same failure but
elicited by different prompts. Regarding this, I have already commented...

(And the `|| die` is added to the next revision of this patch either way.)


-- 
Eli Schwartz



  reply	other threads:[~2023-09-13 21:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 19:14 [gentoo-dev] [PATCH 1/2] distutils-r1.eclass: teach setuptools to respect (some) build options Eli Schwartz
2023-09-12 19:14 ` [gentoo-dev] [PATCH 2/2] python-utils-r1.eclass: unconditionally warn on occluded packages in cwd Eli Schwartz
2023-09-12 19:56 ` [gentoo-dev] [PATCH 1/2] distutils-r1.eclass: teach setuptools to respect (some) build options Ulrich Mueller
2023-09-13  2:07   ` Eli Schwartz
2023-09-13  2:26     ` Michał Górny
2023-09-13  2:52       ` Eli Schwartz
2023-09-13  3:13         ` Sam James
2023-09-13  7:50         ` Alexey Sokolov
2023-09-13 13:10         ` Michael Orlitzky
2023-09-13 21:06           ` Eli Schwartz
2023-09-13  9:27     ` Ulrich Mueller
2023-09-13 21:06       ` Eli Schwartz [this message]
2023-09-14  8:24         ` Ulrich Mueller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54b962d5-2659-2a15-385a-fa314a81ffe8@gmail.com \
    --to=eschwartz93@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox