Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jul 2019 11:24:49 -0700
From:      Theron Tarigo <theron@freebsd.org>
To:        soc-status@freebsd.org
Subject:   GSoC: Separation of Ports Build Process from Local Installation
Message-ID:  <1102f554-ed70-c497-af06-c94c8d0a1725@freebsd.org>

next in thread | raw e-mail | index | archive | help
Hello all,

This project aims to decouple the build process of the ports framework 
from the local installation.  To work around the assumptions made by 
ports about dependency file locations, a userspace tool to remap 
processes' filesystem namespaces is under development: 
freebsd-user-namespace, provided as port devel/userns.

This past week, I investigated the problems of incompatibilities between 
port Makefile special cases and the new mode of ports building.  Right 
now, usage of a modified environment as required by the approach is 
handled for standard do-configure, do-build, etc. targets but not for 
port-defined targets.  Furthermore, usage of absolute paths in Make 
targets must be handled specially since a constraint of this project has 
been to not require anything from ports to be installed system-wide.  
Several approaches or prototypes and experiments thereof have been tried:
  1. For each known BUILD_DEPENDS which is a command, make that command 
available in a special PATH.
  2. Use Make's .SHELL feature to intercept all Make target commands in 
a wrapper shell which sets up the environment.
  3. Set environment directly from Make
  5. Rewrite _ALL_ ports which define targets to use a Make variable 
which may set the required environment.
  7. Run entire top-level Make command under the required environment.

Each of these is not appropriate as a general solution.  Instead, 
bsd.port.mk will be modified to run all targets (do-configure, do-build, 
do-install, etc.) in a sub-make with modified environment, while all 
scripts (do-depends.sh etc.) will continue to be run as they are currently.

What I am working on next:

- Implement the planned sub-make fix described above.  Test ports and debug.
- Compare the packages built by separated-build method to either 
official packages or ports built by original FreeBSD method.  Any 
differences should be attributable to built times and hostnames.
- Debug the ports which fail by segfaut or buserror; this implicates 
userns library.
- Provide more thorough documentation of PORTS_SEPARATED_BUILD, in 
particular its usage and its limitations, so that users and devs 
interested in this project can more easily test it for themselves.

Project goals and status are kept at 
https://wiki.freebsd.org/SummerOfCode2019Projects/PortsSeparatedBuild .

Source of the userspace filesystem namespace tool is shared at 
https://github.com/therontarigo/freebsd-user-namespace .
Changes to ports framework are shared at 
https://github.com/freebsd/freebsd-ports/compare/master...therontarigo:separated 
.

Theron Tarigo




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1102f554-ed70-c497-af06-c94c8d0a1725>