Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id F32ED84D41 for ; Sat, 20 May 2023 15:43:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id LEd-9SzTi1Wm for ; Sat, 20 May 2023 15:43:54 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id E513484D05 for ; Sat, 20 May 2023 15:43:53 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id DE61BFA87; Sat, 20 May 2023 15:43:53 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1684597433198310" MIME-Version: 1.0 Date: Sat, 20 May 2023 15:43:53 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/doc/guide/files To: pkgsrc-changes@NetBSD.org Approved: commit_and_comment Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20230520154353.DE61BFA87@cvs.NetBSD.org> This is a multi-part message in MIME format. --_----------=_1684597433198310 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Sat May 20 15:43:53 UTC 2023 Modified Files: pkgsrc/doc/guide/files: buildlink.xml configuring.xml Log Message: doc/guide: move the PREFER section to the user's guide and rewrite it The variables PREFER_PKGSRC and PREFER_NATIVE are user-settable, therefore it was confusing to see them documented only in the developer part. Rewrite the whole section to sync with reality since neither of these variables is tested for the word "no". To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 pkgsrc/doc/guide/files/buildlink.xml cvs rdiff -u -r1.59 -r1.60 pkgsrc/doc/guide/files/configuring.xml Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1684597433198310 Content-Disposition: inline Content-Length: 9279 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/doc/guide/files/buildlink.xml diff -u pkgsrc/doc/guide/files/buildlink.xml:1.48 pkgsrc/doc/guide/files/buildlink.xml:1.49 --- pkgsrc/doc/guide/files/buildlink.xml:1.48 Tue Jan 24 14:32:37 2023 +++ pkgsrc/doc/guide/files/buildlink.xml Sat May 20 15:43:53 2023 @@ -1,5 +1,5 @@ - + Buildlink methodology @@ -570,73 +570,5 @@ CHECK_BUILTIN.foo?= no files to symlink into ${BUILDLINK_DIR} (via BUILDLINK_FILES.pkg). - - - Global preferences for native or pkgsrc software - - When building packages, it's possible to choose whether to set - a global preference for using either the built-in (native) - version or the pkgsrc version of software to satisfy a - dependency. This is controlled by setting - PREFER_PKGSRC and - PREFER_NATIVE. These variables take values - of either yes, no, or a list of - packages. PREFER_PKGSRC tells pkgsrc to - use the pkgsrc versions of software, while - PREFER_NATIVE tells pkgsrc to use the - built-in versions. Preferences are determined by the most - specific instance of the package in either - PREFER_PKGSRC or - PREFER_NATIVE. If a package is specified - in neither or in both variables, then - PREFER_PKGSRC has precedence over - PREFER_NATIVE. For example, to require - using pkgsrc versions of software for all but the most basic - bits on a NetBSD system, you can set: - - -PREFER_PKGSRC= yes -PREFER_NATIVE= getopt skey tcp_wrappers - - - A package must have a - builtin.mk - file to be listed in PREFER_NATIVE, - otherwise it is simply ignored in that list. - - PREFER_PKGSRC and - PREFER_NATIVE should be set during bootstrap - to ensure that the bootstrap process does not use inapropriate - native tools as dependencies for core packages. - - -&rprompt; ./bootstrap --prefer-pkgsrc yes --prefer-native openssl - - - Switching between settings globally at a later date can introduce - complications with dependency resolution. This is caused by packages - built with the opposite preference being installed alongside each - other. Hence, any changes to these variables after bootstrap will - necessitate rebuilding all packages depending on one whose preference - has been changed. This is not trivial and should be avoided. - - When using pkgsrc on Linux systems, there is high risk of - "leakage", where programs installed by pkgsrc may inadvertently use a - command or library not installed by pkgsrc, e.g. those installed by - yum or apt. Such foreign dependencies may be installed, removed, or - upgraded to a version incompatible with the pkgsrc package at any - time, causing pkgsrc packages to subsequently malfunction. Pkgsrc - cannot prevent this, as it has no control over other package managers. - Another potential problem is that under Redhat Enterprise and related - Linux systems, yum packages are only patched and never upgraded, so - eventually they may become too outdated for use by pkgsrc. Even - intentionally using foreign dependencies, not considered leakage, can - lead to these problems, so it is generally discouraged. In order to - minimize such problems, PREFER_PKGSRC defaults to "yes" on Linux systems. - This ensures that pkgsrc is aware of any changes to dependency packages - and can rebuild or upgrade the entire dependency tree as needed. This - default can be overridden by setting --prefer-pkgsrc to "no" or a list of - packages, or by setting --prefer-native to "yes". - Index: pkgsrc/doc/guide/files/configuring.xml diff -u pkgsrc/doc/guide/files/configuring.xml:1.59 pkgsrc/doc/guide/files/configuring.xml:1.60 --- pkgsrc/doc/guide/files/configuring.xml:1.59 Thu Jan 5 01:42:15 2023 +++ pkgsrc/doc/guide/files/configuring.xml Sat May 20 15:43:53 2023 @@ -1,4 +1,4 @@ - + Configuring pkgsrc @@ -119,6 +119,85 @@ spelling mistakes) takes place. + + Preferences for native or pkgsrc software + + Whenever a package depends on a package that has a + builtin.mk file, the dependent package can + either use the built-in (native) version from the base system or the + pkgsrc-provided version. This only affects dependencies, so it is + still possible to build the pkgsrc package devel/pcre++ even when other packages depend + on the native pcre++ version instead. + + To force using the pkgsrc-provided version for a particular + package, define PREFER_PKGSRC = + package-ID in &mk.conf;. To force + using the native package, define + PREFER_NATIVE = + package-ID. In both cases, the + package-ID is the one from the + buildlink3.mk of the package. In most cases, + this ID is the same as the directory name of the package, but for + example, devel/pcre++ has the + package ID pcrexx. + + For the packages that are not listed by their package ID, + pkgsrc uses the pkgsrc-provided version if + PREFER_PKGSRC contains the word + yes. Otherwise, if PREFER_NATIVE + contains the word yes, pkgsrc uses the native + version. For example, to require using the pkgsrc-provided versions + for all but the most basic bits on a NetBSD system, you can + set: + + +PREFER_PKGSRC= yes +PREFER_NATIVE= getopt skey tcp_wrappers + + + A package must have a + builtin.mk file to be listed in + PREFER_NATIVE, otherwise it is simply ignored in + that list. + + PREFER_PKGSRC and + PREFER_NATIVE should be set during bootstrap to + ensure that the bootstrap process does not use inapropriate native + tools as dependencies for core packages. + + +&rprompt; ./bootstrap --prefer-pkgsrc yes --prefer-native openssl + + + Switching between settings globally at a later date can + introduce complications with dependency resolution. This is caused + by packages built with the opposite preference being installed + alongside each other. Hence, when changing any of these variables + after bootstrap, you need to rebuild all packages depending on those + whose preference has been changed. This is not trivial and should + be avoided. + + When using pkgsrc on Linux systems, there is high risk of + leakage, where programs installed by pkgsrc may + inadvertently use a command or library not installed by pkgsrc, e.g. + those installed by yum or apt. Such foreign dependencies may be + installed, removed, or upgraded to a version incompatible with the + pkgsrc package at any time, causing pkgsrc packages to subsequently + malfunction. Pkgsrc cannot prevent this, as it has no control over + other package managers. Another potential problem is that under + Redhat Enterprise and related Linux systems, yum packages are only + patched and never upgraded, so eventually they may become too + outdated for use by pkgsrc. Even intentionally using foreign + dependencies, not considered leakage, can lead to these problems, so + it is generally discouraged. In order to minimize such problems, + PREFER_PKGSRC defaults to yes on Linux systems. This ensures that + pkgsrc is aware of any changes to dependency packages and can + rebuild or upgrade the entire dependency tree as needed. This + default can be overridden by setting --prefer-pkgsrc to a + list of packages and --prefer-native to yes. + + Variables affecting the installation process --_----------=_1684597433198310--