From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8806B158089 for ; Wed, 13 Sep 2023 02:07:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EA76E2BC0B4; Wed, 13 Sep 2023 02:07:34 +0000 (UTC) Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BB7D62BC014 for ; Wed, 13 Sep 2023 02:07:34 +0000 (UTC) Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6bf298ef1f5so4355034a34.0 for ; Tue, 12 Sep 2023 19:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694570854; x=1695175654; darn=lists.gentoo.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+y4wR7HLTsDJlZBCbjUniZdFgWQGFX6QA+JEibcRIa4=; b=m9I2Lp2EhxLsiHgqZWy6hNF4Or1cPE1qRU/UyDtZvICvuTXGnhouJFO5NOx7bQdeKf v9VJseG3Pay0glUb/cM5a3iWi6zlhHjP+7BxLBmNy0VkgPdrbfcu4PI4riqIH26sxv5W ucs7DYBXO9s087F2uYoWEKeY4kUMwv4nptbYU4ReZrOBVaz9cGbpqwpJedrHUTUBfzAg oc8h2RvpPmALTh4WXcASaF5sQWq08PV10ErXoEK2aDVDMtIy4g2gTuSQb34ewd83eQCV OraZtPgyyv0HzHLqekF3SKXwHrvRKaeI4srgQY+HhSfB2Y1tiIMj3M7taWSOHJZBq82F khmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694570854; x=1695175654; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+y4wR7HLTsDJlZBCbjUniZdFgWQGFX6QA+JEibcRIa4=; b=PGa0irbAAVd/nYpLMononOeeK58jkNwmi+aJoyxMWy71O+afTBDb7PnWrIGeYIVqax UlrAVUX3iLoozYQdC3gqMFndpzvHdg8fKbfEI4P0NhshMPDp0NN1CFugyxSQUcQQJ0ve AeJsS5mzTI1Zntk3xgjx6GVy6AS61nDoy1OWOXa+Y1BzO1T/qdagN4oGzU1f+ynht7En fpurl/fqUkiXquIny/6UUIthTnWaWVHXrkIVVrEPDH18mYkhWb56+yT6VC97NOnQNTU4 3F9QY+7ro+DOHCrgHYA4M+fQHDf1VHQZIL3XFNoQA3Fdw9fBQPohgfUCIz5cjS8Hi/mK DBuQ== X-Gm-Message-State: AOJu0YyWBzzMvJKkdekGdYutKtsY/8TotSp1dnjlYVZ7Aorpyq0Wezjw 4mBPXwoAB77U44liT7ttc+3oeWx9a16vzSXe X-Google-Smtp-Source: AGHT+IE9b+V74LRmJOWpXcNTZ2gdaCMcpSDTkxdv9OT1LD6sd5S93aCYGN+D2+NimkWREyfrw33rWg== X-Received: by 2002:a05:6830:1e66:b0:6be:fd1c:c210 with SMTP id m6-20020a0568301e6600b006befd1cc210mr1566183otr.24.1694570853779; Tue, 12 Sep 2023 19:07:33 -0700 (PDT) Received: from ?IPV6:2600:1700:57f0:ca20:b42b:533b:c0b4:7cc9? ([2600:1700:57f0:ca20:b42b:533b:c0b4:7cc9]) by smtp.gmail.com with ESMTPSA id q13-20020a9d7c8d000000b006b9e872c0a0sm4544765otn.68.2023.09.12.19.07.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Sep 2023 19:07:33 -0700 (PDT) Message-ID: <1affddb8-221c-4c67-4395-03c2425d0e0e@gmail.com> Date: Tue, 12 Sep 2023 22:07:31 -0400 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [gentoo-dev] [PATCH 1/2] distutils-r1.eclass: teach setuptools to respect (some) build options Content-Language: en-US To: Ulrich Mueller Cc: gentoo-dev@lists.gentoo.org References: <20230912191501.536700-1-eschwartz93@gmail.com> From: Eli Schwartz In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 4caf56fa-e100-4545-9b58-33043e5d62cb X-Archives-Hash: b29bdd947f1ec8535c1fd0d4a708d71d On 9/12/23 3:56 PM, Ulrich Mueller wrote: >>>>>> On Tue, 12 Sep 2023, Eli Schwartz wrote: > >> + mkdir -p "${BUILD_DIR}" || die >> + local -x DIST_EXTRA_CONFIG="${BUILD_DIR}/extra-setup.cfg" >> + cat > "${DIST_EXTRA_CONFIG}" <<-EOF >> + [build] >> + build_base = ${BUILD_DIR}/build >> + >> + [build_ext] >> + parallel = ${jobs} >> + EOF > > "|| 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. (mkdir -p will return nonzero and die, if it exits without having guaranteed its target is a directory on disk. There is one loophole, and that is if its target already existed beforehand, but the mkdir -p process did not have write permissions for it; mkdir will not check permissions if it detects it doesn't have to do work. This should not be the case inside the workdir, or something has gone significantly wrong beforehand.) That being said, as a style guide concern I can see why being cautious is generally desirable, as it's much easier to review code that uses it when it isn't strictly necessary than code that doesn't use it when it turns out to be necessary. I'm not very used to this yet :) so I blindly assumed while writing it that it wasn't necessary to do some additional typing and add this for call sites that shouldn't be able to fail. I will add this in the next revision. -- Eli Schwartz