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 2020-08-10 11:44, Greg Troxel wrote:
Jason Bacon <outpaddling%yahoo.com@localhost> writes:

On 2020-08-09 13:08, Greg Troxel wrote:
Jason Bacon <outpaddling%yahoo.com@localhost> 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
+Linux)
+    if [ -z "$prefer_pkgsrc" ]; then
+        prefer_pkgsrc="yes"
+    fi
+    ;;
+esac
+
  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.

The (draft) patch should allow the user to override the new default PREFER_PKGSRC=yes by specifying --prefer-native=yes or --prefer-pkgsrc=no|list.  People with edge cases like Peter's openssl can use --prefer-native="list" and still default to PREFER_PKGSRC for everything else.

Let me know if you see any shortcomings in the logic.

--- Pkgsrc/pkgsrc/bootstrap/bootstrap.orig    2020-08-10 09:31:25.512000000 +0000
+++ Pkgsrc/pkgsrc/bootstrap/bootstrap    2020-08-10 13:25:37.346000000 +0000
@@ -71,6 +71,7 @@
     [ --pkginfodir <pkginfodir> ]
     [ --pkgmandir <pkgmandir> ]
     [ --prefer-pkgsrc <list|yes|no> ]
+    [ --prefer-native <list|yes|no> ]
     [ --prefix <prefix> ]
     [ --preserve-path ]
     [ --quiet ]
@@ -471,6 +472,10 @@
             prefer_pkgsrc=`get_optarg "$1"` ;;
     --prefer-pkgsrc)
             prefer_pkgsrc="$2"; shift ;;
+    --prefer-native=*)
+            prefer_native=`get_optarg "$1"` ;;
+    --prefer-native)
+            prefer_native="$2"; shift ;;
     --preserve-path) preserve_path=yes ;;
     --mk-fragment=*)
             mk_fragment=`get_optarg "$1"` ;;
@@ -1103,10 +1108,27 @@
 echo "PKGMANDIR=        $pkgmandir" >> ${TARGET_MKCONF}
 echo "" >> ${TARGET_MKCONF}

+case $opsys in
+Linux)
+    # Default PREFER_PKGSRC=yes unless user specifies --prefer-native=yes
+    # Linux systems likely have software from other packages managers
+    # like yum or apt that can leak into pkgsrc and cause issues as they
+    # age, undergo ABI changes, or get added/removed behind our backs.
+    # Default to letting pkgsrc maintain all dependencies to avoid these
+    # problems.
+    if [ -z "$prefer_pkgsrc" ] && [ "$prefer_native" != "yes" ]; then
+        prefer_pkgsrc="yes"
+    fi
+    ;;
+esac
+
 if [ -n "$prefer_pkgsrc" ]; then
     echo "PREFER_PKGSRC=        $prefer_pkgsrc" >> ${TARGET_MKCONF}
     echo "" >> ${TARGET_MKCONF}
 fi
+if [ -n "$prefer_native" ]; then
+    echo "PREFER_NATIVE=        $prefer_native" >> ${TARGET_MKCONF}
+    echo "" >> ${TARGET_MKCONF}
+fi

 BOOTSTRAP_MKCONF=${wrkdir}/mk.conf
 cp ${TARGET_MKCONF} ${BOOTSTRAP_MKCONF}


Home | Main Index | Thread Index | Old Index