Skip to content

jail update with -m src=path method leaves old stale files in the jail src copy #1299

@bugsbeastie

Description

@bugsbeastie

Prerequisites

  • Have you checked for an existing issue describing your problem?
  • Are you running the latest version?
    poudriere-devel-3.4.99.20251213
  • Is your ports tree recent?
    Ports top-level git hash: 27fa8e7879a65e89aad6f3a711eac114b472973b
  • Is your FreeBSD Host on a supported release?
    FreeBSD 16.0-CURRENT #0 main-n282851-2f83319214d9: Sun Jan 4 23:57:33 CET 2026

Background

With the pkgbase method of managing the base FreeBSD system, poudriere is an attractive tool to build pkgbase packages (together with ports packages).

poudriere jail already has both -b and -B options to build the base system from sources and package pkgbase packages.

Managing both the ports and src trees outside poudriere has benefits (one can have a full git log history in the host, but copy only latest trees into the poudriere jails). Then, using -m src=/usr/src method is the way to go.

The bug (I strongly believe)

It is natural to update the host trees using git pull and then to update the jails using poudriere jail -u -j JID -K "" -b -B -JN.

However, the subroutine install_from_src() is only doing the straight copy of the src tree from the host into the jail, without cleaning the old version in the jail:

...
msg_n "Copying ${SRC_BASE} to ${JAILMNT}/usr/src..."
mkdir -p ${JAILMNT}/usr/src
...
[cpignore logic]
...
do_clone -r ${cpignore_flag} "${SRC_BASE:?}" "${JAILMNT:?}/usr/src"
...

Expected behavior

I think nuking the old src tree from the jail before the copy is the way to go here:

rm -R "${JAILMNT:?}/usr/src"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions