pkg_comp icon indicating copy to clipboard operation
pkg_comp copied to clipboard

Don't find pkgsrc bash. It won't be in the sandbox.

Open schmonz opened this issue 3 years ago • 1 comments

This isn't mergeable as is, so don't worry that I don't have a signed contributor agreement. :-) But it's probably close enough for you to commit something that solves the problem.

The problem: on a platform where /bin/sh doesn't suffice for pkgsrc bootstrap and pkg_comp tries to find a bash, it's possible-to-likely that the host system has all of these properties:

  1. pkgsrc has been bootstrapped (presumably that's how we got pkgtools/pkg_comp installed)
  2. pkgsrc paths are early in $PATH, so that pkgsrc tools are found before system-provided ones
  3. shells/bash has been installed

In such cases, pkg_comp currently detects and chooses e.g. /usr/pkg/bin/bash as ${bootstrap_sh}. At some point early in the bootstrap, some build or other fails (one of the libnbcompat I think) because it's trying to run /usr/pkg/bin/bash, which is not available in the sandbox.

My change is a portion of what I'll commit to pkgsrc shortly (unless you recommend I don't): it removes pkgsrc paths from the $PATH that's in effect for which bash, so only a non-pkgsrc bash will be found. I've tested that this (in conjunction with the obvious SUBST) fixes the bootstrap on such platforms.

schmonz avatar Mar 14 '22 15:03 schmonz