From patchwork Tue Mar 12 17:01:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Schwartz X-Patchwork-Id: 1039 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id D4D31C70D6E0 for ; Tue, 12 Mar 2019 17:01:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00=-1, DKIMWL_WL_HIGH=-0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3, T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Tue, 12 Mar 2019 17:01:44 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id A9FDB11331AC0C; Tue, 12 Mar 2019 17:01:37 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Tue, 12 Mar 2019 17:01:36 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 60D712BF74; Tue, 12 Mar 2019 17:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1552410094; bh=wRRnmN1Hnz3dGbzV58UFkdApiYiitmMaebK546iai34=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Reply-To; b=pScOCUVwZ+y2GS3gZUEa5HYaaSFnb3ph5J8QQRypqfJkHEILG2B1ZcdnzfK2Xsbqd VsYTBAVTEEM/mt0KuiyOUPvX+BhEK0sD+X1kykbbrk4B1Fp+y/HM9L+Sr+RD5uunJm RGv4l+2v2ElYq6vRnsnFWiV1nSyM96v9KBBwUPxN89jP+nMh3z0uKhC49/vqUz5nRA ZGMZtm+2s/LLCxafFW7vVdVuACGDwmBr9U6e1ID9CbWQ45Xq13LqLVvmBdH0/BMdP8 gteXGHAu+e4IJbkcAVAiFtF/NhlpGQH13y0FCO7FOwstGXOZdQp5JSIDT76cxdOy70 gakUvUDTJI9Sm9Q5ZD0HdMkNwUnECdRFpL3nFQivEI5BmYvdhWMTlD9QuTUn1oNp6H K0OZbqtvy+SLxhO9u35517vQHkxXRoIGPJlTlLLnS1p5VcvjqD5/eota3R6T/VNIQV fCUIJbK9lrlWZvGXyhtxILrB8j45ZfnNwRGUEvYCiV7GKNIJTqToaLqASghqNfsVP3 CFDjtsXaXNEqE7H4+hdiLIFpKIv/lki+99dh+7fdvuHKXcSYpMjXYpEfMdQzkaF07n +uvxLesY3ED5Y+oRjB0CIvwer7QcVucAwXnAPtG06mwdXdnfyD4iGDjLZRGbQH+Z+y XFlM5hDXrma1T3E31R4fNwRI= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 63F262BF3B for ; Tue, 12 Mar 2019 17:01:30 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Tue, 12 Mar 2019 17:01:30 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 14F2F11331ABF4; Tue, 12 Mar 2019 17:01:25 +0000 (UTC) Received: from didactylos.localdomain (unknown [216.97.144.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id 9A4FD11331ABF3; Tue, 12 Mar 2019 17:01:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1552410084; bh=wRRnmN1Hnz3dGbzV58UFkdApiYiitmMaebK546iai34=; h=From:To:Subject:Date; b=G7M4gs2ykCytuZZ83M4ou7G+wcm5wV2XH+2K62/xUJfmYETZKFOMJR31wQbR96Xaz mgRATk2IjmZQQ+gGSSvUb8kEHwXMpqasPbw9EfNzGhj78fjNLC2UWh4xmiZEIGjv3i hNe6iJWNwn48mR+B+nXR2lsqUy/2dDJkg344OlIU6mmUl7Wry3+JFmidqF6wceks9r 02/q2a3aqgjwxqw4NqfkdGTmaE6WowJDX/MSrt3dQp6PTE/PS8GZuu2IFRgcXOuhdb 7Ve1Kc39CAZ35Wsv4HeOWlEURx+O7gsp9izgkuZjW+2GBmg4KJ9xKbn8wRb1FtSpE2 gjJPhQnXQxYHo6U7l4ZFWg8A/VH6IkOzPhr8MHc4rQcT87Mu29M67VDvaOXfWZVO3w n0QTbwDU51wucgEDLFbx968gg5vj02Xf067zE1ecKrwJv6LzZTU18dPrmI++FUgR5r byE1aWPgI1KWWLzBOm6shUgFd/Y3Sxyop7tphGjv7v9zSiJ9dxdnVxKJWgQOoLZyiG NLFSqX2pDPIywvilrjAlsFLDzl3vMZmqC+xJ83sEDbpGkBnwcxVndE5VhgDbGIxq6k QR1tDHx0E2mHU0KxghRw4nHbewhTKQ3tiK88rfF8X3R2P2gsCfA4ADlbYTDOkVnMNx p4GQjG1OKI7oQnjuGPXnfnFc= From: Eli Schwartz To: pacman-dev@archlinux.org Date: Tue, 12 Mar 2019 13:01:12 -0400 Message-Id: <20190312170114.9291-1-eschwartz@archlinux.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [pacman-dev] [PATCH 1/3] doc: describe when and why the prepare function should be used X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Discussion list for pacman development Errors-To: pacman-dev-bounces@archlinux.org Sender: "pacman-dev" We don't want people to run architecture/OS/makepkg.conf specific processes during prepare() and in fact it's been observed that makepkg by design doesn't even run prepare_buildenv() for it, so the prohibition against this is now baked into makepkg. Reflect this differentiation in the documentation on just what, exactly, a prepare() function is. Signed-off-by: Eli Schwartz --- This patch coincides with quequotion's clarification of the options=() array, so thanks for inspiring me to write this! I believe that both patches have merit independent of each other. doc/PKGBUILD.5.asciidoc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/PKGBUILD.5.asciidoc b/doc/PKGBUILD.5.asciidoc index e8ce691f..285627ab 100644 --- a/doc/PKGBUILD.5.asciidoc +++ b/doc/PKGBUILD.5.asciidoc @@ -342,9 +342,12 @@ files into the packaging directory, with optional `prepare()`, `build()`, and *prepare() Function*:: An optional `prepare()` function can be specified in which operations to prepare the sources for building, such as patching, are performed. This - function is run after the source extraction and before the `build()` - function. The `prepare()` function is skipped when source extraction - is skipped. + function is run exactly once, after the source extraction and before the + `build()` function. The `prepare()` function is skipped when source + extraction is skipped. No system-specific or build-specific commands should + be run during `prepare()` under any circumstances, as they are meant to run + exclusively during `build()`, and features like `buildflags` or `makeflags` + are expressly not available. *build() Function*:: The optional `build()` function is use to compile and/or adjust the source