Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 2019 04:31:36 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
To:        Peter Pentchev <roam@ringlet.net>
Cc:        "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>, Theron <theron.tarigo@gmail.com>, Bakul Shah <bakul@bitblocks.com>, freebsd-hackers@freebsd.org, soc-status@freebsd.org, freebsd-ports@freebsd.org
Subject:   Re: GSoC: Separation of Ports Build Process from Local Installation
Message-ID:  <201905291131.x4TBVaVD020568@gndrsh.dnsmgr.net>
In-Reply-To: <20190529095653.GN18665@straylight.m.ringlet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
-- Start of PGP signed section.
> On Tue, May 28, 2019 at 08:28:41PM -0700, Rodney W. Grimes wrote:
> > [ Charset UTF-8 unsupported, converting... ]
> > > Hello All,
> > > 
> > > For Google Summer of Code 2019 I am working on FreeBSD's ports tree 
> > > makefiles towards eliminating the dependency of the ports building 
> > > process on the local system's installed packages.? Currently this level 
> > > of separation can only be accomplished in practice through chroot or 
> > > Jail.? The project will eliminate the need for cooperation of the root 
> > > user since /usr/local will not need to be touched.
> > > 
> > > The major technical obstacle to be overcome is that ports expect to find 
> > > files of their dependencies installed in /usr/local.? To support this 
> > > without touching that location on the installed system, file accesses 
> > > will be redirected to a location controlled by the ports build process 
> > > through use of a library to intercept file accesses.
> > 
> > Assumption of /usr/local was considered wrong long long ago and it
> > should always be ${PREFIX}.  Any place that actually assumes this
> > value to be /usr/local should be fixed.
> > 
> > Had this policy been properly maintained it would simply be a mater
> > of changing ${PREFIX} to a new and empty place before starting
> > a ports build and things should of just worked.
> > 
> > Restoration to this ancient and functional behavior is desirable
> > at least on my part.
> 
> Hmm, I could be wrong, but isn't ${LOCALBASE} supposed to be where
> ports find stuff *during the build*, and ${PREFIX} where they
> install the built files?  Of course, I haven't actually touched
> a FreeBSD ports build in years, so I might very likely be wrong.
> I also seem to remember a series of test port builds done a long
> time ago with a different value for LOCALBASE, specifically to catch
> ports that do not honor the policy in this regard.

${LOCALBASE} came along after the time frame I am speaking of,
but yes, that is the present place that ports can find stuff.
I think the default is that LOCALBASE=PREFIX=/usr/local which
is fine, but there are things that just assume these values
to be /usr/local and that is broken.

For a list, with a lot of false positives:
find /usr/src -type f | xargs grep "/usr/local"

I have no idea how to do the same for all of ports,
but given prior and not to long ago history, we have
ports that break if you are not installing in /usr/local/

> > > Once I have that working (well enough to build one port at a time) I 
> > > will move on to modify bsd.port.mk itself (and related files) to utilize 
> > > this mechanism for virtual installation of port dependencies during builds.
> > > 
> > > The full project proposal can be seen at 
> > > https://docs.google.com/document/d/1B30U9csgY299W59tNraSX1LYjzsba2i04OrYAUpdIZs/edit 
> > > .
> > > 
> > > My goal is that this work can be integrated well enough into 
> > > /usr/ports/Mk so that unlike Jail, no set up work should be required for 
> > > using ports tree to build a set of installable packages.
> > > 
> > > Please let me know if you are interested in this project; feedback is 
> > > appreciated.? If someone would like to provide ongoing feedback or 
> > > mentorship that would be especially helpful.? Bakul Shah is my mentor 
> > > officially for GSoC but I would be happy to have additional support from 
> > > someone who is experienced with internals of the port infrastructure 
> > > makefiles.
> 
> G'luck,
> Peter
> 
> -- 
> Peter Pentchev  roam@{ringlet.net,debian.org,FreeBSD.org} pp@storpool.com
> PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
> Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
-- End of PGP section, PGP failed!

-- 
Rod Grimes                                                 rgrimes@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905291131.x4TBVaVD020568>