Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding packages to jail before bulk build #146

Open
bapt opened this issue Sep 18, 2014 · 6 comments
Open

Allow adding packages to jail before bulk build #146

bapt opened this issue Sep 18, 2014 · 6 comments

Comments

@bapt
Copy link
Member

bapt commented Sep 18, 2014

For a couple of broken ports like graphics/ImageMagick and multimedia/p5-GStreamer it would be real nice to allow the pre-installation of an already built package.

The following patch does this by allowing you to create a file ${JAILNAME}-pkgs.conf with a list of packages in it that will get installed after a jail is cloned. This might be a bit naive but here it is and it works:

--- common.sh   2013-07-02 14:12:26.454590801 +0000
+++ common.sh.orig  2013-06-27 15:37:22.705590503 +0000
@@ -909,17 +909,6 @@
        injail mtree -eu -f /etc/mtree/BSD.var.dist -p /var >/dev/null 2>&1 || :
        injail mtree -eu -f /etc/mtree/BSD.usr.dist -p /usr >/dev/null 2>&1 || :
##     fi
-   # Add packages to jails - yes the variable name is arbitrary
-   MY_CUSTOM_PACKAGES=$(cat ${POUDRIERED}/${JAILNAME}-pkgs.conf 2>/dev/null)
-   if [ -n "${MY_CUSTOM_PACKAGES}" ]; then
-       msg "Custom package installation detected"
-       for pkg_name in ${MY_CUSTOM_PACKAGES} ; do
-           # This is likely really naive so I don't do anything with this other than store it
-           msg "...installing ${pkg_name}"
-           MY_ERRORS=$(injail pkg_add /packages/All/$pkg_name)
-       done
-   fi
@bapt
Copy link
Member Author

bapt commented Sep 18, 2014

--- common.sh   2013-07-03 22:20:40.190422006 -0700
+++ common.sh.orig  2013-06-27 08:37:22.705590503 -0700
@@ -907,22 +909,6 @@
        injail mtree -eu -f /etc/mtree/BSD.var.dist -p /var >/dev/null 2>&1 || :
        injail mtree -eu -f /etc/mtree/BSD.usr.dist -p /usr >/dev/null 2>&1 || :

##     fi
-   # Add packages to jails - yes the variable name is arbitrary
-        MY_PKGFILE="${POUDRIERED}/${JAILNAME}-pkgs.conf"
-        if [ -f "${MY_PKGFILE}" ]; then
-       msg "Found custom package file ${MY_PACKAGE_FILE}"
-       MY_CUSTOM_PACKAGES=$(cat ${POUDRIERED}/${JAILNAME}-pkgs.conf 2>/dev/null)
-       if [ -n "${MY_CUSTOM_PACKAGES}" ]; then
-           msg "Custom package installation data detected"
-           for pkg_name in ${MY_CUSTOM_PACKAGES} ; do
-               # This is likely really naive so I don't do anything with this other than store it
-               msg "...installing ${pkg_name}"
-               MY_ERRORS=$(injail pkg_add /packages/All/$pkg_name)
-           done
-       fi

## \-        fi

 }

 setup_makeconf() {

This one is more robust.

@bapt
Copy link
Member Author

bapt commented Sep 18, 2014

I don't understand the use case for this. Can you elaborate? Also, your patch is reversed.

@bapt
Copy link
Member Author

bapt commented Sep 18, 2014

Sorry for the reversal. The use case goes like this. Certain ports do not install prerequisite packages even though they wind up being prerequisites. As an older example:

- ====>> [02] Starting build of graphics/ImageMagick
  perl: not found
  "Makefile", line 83: warning: "/bin/sh -c 'case `perl --version` in _freebsd-thread_) echo yes ;; esac'" returned non-zero status

So to fix these issues, the patch I submitted (which I evolved a bit) allows one to specify a list of packages that get installed to the jail before bulk builds happen using the same area you use to modify make.conf and options and etc.

I have forked your github repo and will eventually be trying to submit a pull request for the latest version (3.0.13 as of this writing) for this patch.

@DragonSA
Copy link
Member

Another use case is lang/pypy. It allows one to translate pypy with itself (making things much faster) but pypy is obviously not a dependency. Another use case would be if a port fails in the presence of another port, or if the build behaviour changes when another port is installed.

@DragonSA
Copy link
Member

DragonSA commented Jan 11, 2015

P.S. jail hooks will allow one to develop this capability without having to extend poudriere itself. However, pkg does not get installed at that time so one will need to use pkg-static from /packages/All/pkg-*.txz from within the jail. I used:

cat jail.sh << _EOF
jexec -U root $MASTERNAME tcsh
_EOF

to do my (evil) work.

@grahamperrin
Copy link
Contributor

grahamperrin commented Aug 18, 2021

#146 (comment)

… pre-installation of an already built package. …

Does option -b fulfil this requirement? As currently implemented in poudriere-devel-3.3.99.20210720

man 8 poudriere-bulk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants