pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: proposal to make bootstrap on Linux prefer pkgsrc by default.

On 10/08/2020 23:47, Jason Bacon wrote:
On 2020-08-10 16:54, Klaatu wrote:
On Monday, August 10, 2020 03:32:36 PM Jason Bacon wrote:
On 2020-08-10 11:44, Greg Troxel wrote:
Jason Bacon <> writes:
On 2020-08-09 13:08, Greg Troxel wrote:
Jason Bacon <> writes:

Do you intend to change it, or do you think there is some reason not to,
or that others object?  As I said above, my only goal here is that we
adjust defaults to the consensus of best practice.
My aim here was to recap and clarify my experience with this issue so
we have a solid foundation on record for the argument.  So yes, I
think PREFER_PKGSRC should be the default.
Sounds good to me, and you have definitely convinced me.

I have changed the subject to reflect the proposed change of default.

Should it be changed just for Linux, or for other platforms as well?
So far, we have had discussion that supports changing it on Linux.
Specific othesr, not so much, and "all others", not at all.  So I'd
prefer to just change it on Linux where we have a good basis to believe
that's in the interest of someone who doesn't understand this issue and
runs bootstrap.

Are we simply talking about something like the following in the
bootstrap script or is it more complicated?

--- Pkgsrc/pkgsrc/bootstrap/bootstrap.orig    2020-08-10
09:31:25.512000000 +0000
+++ Pkgsrc/pkgsrc/bootstrap/bootstrap    2020-08-10 09:36:00.236000000
+0000 @@ -1103,6 +1103,14 @@

   echo "PKGMANDIR=        $pkgmandir" >> ${TARGET_MKCONF}
   echo "" >> ${TARGET_MKCONF}

+case $opsys in
+    if [ -z "$prefer_pkgsrc" ]; then
+        prefer_pkgsrc="yes"
+    fi
+    ;;

   if [ -n "$prefer_pkgsrc" ]; then
       echo "PREFER_PKGSRC=        $prefer_pkgsrc" >> ${TARGET_MKCONF}
       echo "" >> ${TARGET_MKCONF}
I think there probably needs to be a doc change, and there needs to be a
prefer-native that causes this not to happen, etc.  But basically, that
seems like it.
And a draft patch for the guide...

Index: files/buildlink.xml

RCS file: /cvsroot/pkgsrc/doc/guide/files/buildlink.xml,v
retrieving revision 1.43
diff -u -r1.43 buildlink.xml
--- files/buildlink.xml 20 Jun 2020 09:47:05 -0000      1.43
+++ files/buildlink.xml 10 Aug 2020 20:28:19 -0000
@@ -602,16 +602,40 @@
         file to be listed in <varname>PREFER_NATIVE</varname>,
         otherwise it is simply ignored in that list.</para>

-      <para>Setting <varname>PREFER_NATIVE</varname> should be performed -      straight after bootstrap and <varname>PREFER_PKGSRC</varname> during
-      bootstrap.
+      <para><varname>PREFER_PKGSRC</varname> should be set during bootstrap
+      to ensure that the bootstrap process does not use native tools as
+      dependencies for core packages.
+      Setting <varname>PREFER_NATIVE</varname> should be performed
+      immediately after bootstrap at the latest, but can also be set
+      during bootstrap.
         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
+      built with the opposite preference being installed alongside each
+      other.  Hence, it is advisable to rebuild all installed packages
+      following any changes to these variables.</para>
   &rprompt; <userinput>./bootstrap --prefer-pkgsrc yes</userinput>
+&rprompt; <userinput>./bootstrap --prefer-native openssl</userinput>
+      <para>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
+      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
+      and can rebuild or upgrade the entire dependency tree as needed.
+      default can be overridden by setting --prefer-pkgsrc to "no" or a
list of
+      packages, or by setting --prefer-native to "yes".</para>
I know this isn't a voting platform, but I'd like to voice support for this
proposal as a user of pkgsrc on both NetBSD and Linux.

The explanation as written here is good, the advantages are obvious, and the
guidance is clear.
It may not be a voting platform per se, but we do need feedback from the community to make good decisions, so thanks.

I was left wondering why the bootstrap script was given a --prefer-pkgsrc flag but not a --prefer-native flag in the first place. Maybe the latter was simply not deemed necessary at the time, but if it was deliberately omitted for some reason, I hope someone will chime it.

But, does it really make a difference on Linux?

I have two bootstraps on Debian Stretch, one with "--prefer-pkgsrc yes" and the other without. Same set of software built, same "/usr/pkg" size. My feeling is that prefer-pkgsrc only matters on NetBSD.

Ottavio Caruso

Home | Main Index | Thread Index | Old Index