freebsd / poudriere

Port/Package build and test system
https://github.com/freebsd/poudriere/wiki
BSD 2-Clause "Simplified" License
379 stars 161 forks source link

Poudriere validates wrong (system default) ports tree upon 'testport' #1073

Closed michael-o closed 7 months ago

michael-o commented 10 months ago

Prerequisites

Describe the bug

Consider the following:

# poudriere ports -l
PORTSTREE    METHOD    TIMESTAMP           PATH
default      git       2021-11-30 10:54:18 /var/poudriere/ports/default
default-head git       2021-11-30 10:54:18 /var/poudriere/ports/default-head
ldadw-custom svn+https 2021-11-30 10:56:25 /var/poudriere/ports/ldadw-custom
michael-o    git       2021-11-30 10:54:18 /var/poudriere/ports/michael-o
root@deblndw011x:/var/poudriere/ports/default-head (pr-272541 *)
# git status
On branch pr-272541
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   Mk/Uses/ghostscript.mk
        modified:   print/ghostscript10/Makefile

no changes added to commit (use "git add" and/or "git commit -a"

now lets test the port:

root@deblndw011x:/usr/local/etc/poudriere.d
# poudriere -vv testport -j 124-release-amd64 -p default-head -i print/ghostscript10
=>> Debug: Reading /usr/local/etc/poudriere.conf
[00:00:00] Creating the reference jail... done
[00:00:13] Mounting system devices for 124-release-amd64-default-head
[00:00:13] Warning: Using packages from previously failed, or uncommitted, build: /var/poudriere/data/packages/124-release-amd64-default-head/.building
[00:00:13] Mounting ports from: /var/poudriere/ports/default-head
[00:00:13] Mounting packages from: /var/poudriere/data/packages/124-release-amd64-default-head
[00:00:13] Mounting distfiles from: /usr/ports/distfiles
[00:00:13] Copying /var/db/ports from: /usr/local/etc/poudriere.d/124-release-amd64-default-head-options
[00:00:13] Appending to make.conf: /usr/local/etc/poudriere.d/124-release-amd64-default-head-make.conf
/etc/resolv.conf -> /var/poudriere/data/.m/124-release-amd64-default-head/ref/etc/resolv.conf
[00:00:13] Starting jail 124-release-amd64-default-head
[00:00:13] Will build as nobody:nobody (65534:65534)
[00:00:14] Ports supports: FLAVORS SELECTED_OPTIONS
[00:00:14] Inspecting ports tree for modifications to git checkout... yes
[00:00:15] Ports top-level git hash: 6ffebb1e6505 (dirty)
make: "/usr/ports/print/ghostscript10/Makefile" line 52: Malformed conditional (${FLAVOR} == default)
make: "/usr/ports/print/ghostscript10/Makefile" line 55: Malformed conditional (${FLAVOR} == x11)
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/ports/print/ghostscript10
[00:00:15] Error: Port is broken
[00:00:15] Cleaning up
[00:00:16] Unmounting file systems
Exiting with status 1

Yes, I have shredded /usr/ports/print/ghostscript10/Makefile because I did nagivate to the wrong dir, then stopped and moved to default-head. It is suprising that /usr/ports is touched at all since I have suppied a separate ports tree.

Fixing /usr/ports and retrying:

root@deblndw011x:/var/poudriere/ports/default-head (pr-272541 *)
# gitup ports
# Scanning local repository...
# Host: git.freebsd.org
# Port: 443
# Proxy Host: de.coia.siemens.net
# Proxy Port: 9400
# Repository Path: /ports.git
# Target Directory: /usr/ports
# Have: c2432e318536e2c98d555e29d14faa705d73bbec
# Want: 9370aa5524f43224d8f8c49e2a1c8a32b500cf3f
# Branch: 2023Q3
 ! /usr/ports/ftp/curl/Makefile has been modified.
 ! /usr/ports/print/ghostscript10/Makefile has been modified.
# Action: repair
 * /usr/ports/ftp/curl/Makefile
 * /usr/ports/print/ghostscript10/Makefile
# The local repository has been repaired.  Please rerun gitup to pull the latest commit.
# Done.
root@deblndw011x:/var/poudriere/ports/default-head (pr-272541 *)
# gitup ports
# Scanning local repository...
# Host: git.freebsd.org
# Port: 443
# Proxy Host: de.coia.siemens.net
# Proxy Port: 9400
# Repository Path: /ports.git
# Target Directory: /usr/ports
# Have: c2432e318536e2c98d555e29d14faa705d73bbec
# Want: 9370aa5524f43224d8f8c49e2a1c8a32b500cf3f
# Branch: 2023Q3
# Action: pull
 * /usr/ports/archivers/p5-Gzip-Faster/Makefile
 * /usr/ports/audio/gnome-podcasts/Makefile
 * /usr/ports/audio/mumble/Makefile
 * /usr/ports/audio/mumble/distinfo
...
root@deblndw011x:/var/poudriere/ports/default-head (pr-272541 *)
# poudriere testport -j 124-release-amd64 -p default-head -i print/ghostscript10
[00:00:00] Creating the reference jail... done
[00:00:13] Mounting system devices for 124-release-amd64-default-head
[00:00:13] Warning: Using packages from previously failed, or uncommitted, build: /var/poudriere/data/packages/124-release-amd64-default-head/.building
[00:00:13] Mounting ports from: /var/poudriere/ports/default-head
[00:00:13] Mounting packages from: /var/poudriere/data/packages/124-release-amd64-default-head
[00:00:13] Mounting distfiles from: /usr/ports/distfiles
[00:00:13] Copying /var/db/ports from: /usr/local/etc/poudriere.d/124-release-amd64-default-head-options
[00:00:13] Appending to make.conf: /usr/local/etc/poudriere.d/124-release-amd64-default-head-make.conf
/etc/resolv.conf -> /var/poudriere/data/.m/124-release-amd64-default-head/ref/etc/resolv.conf
[00:00:13] Starting jail 124-release-amd64-default-head
[00:00:13] Will build as nobody:nobody (65534:65534)
[00:00:14] Ports supports: FLAVORS SELECTED_OPTIONS
[00:00:14] Inspecting ports tree for modifications to git checkout... yes
[00:00:23] Ports top-level git hash: 6ffebb1e6505 (dirty)
make: "/usr/ports/print/ghostscript10/Makefile" line 52: Malformed conditional (${FLAVOR} == default)
make: "/usr/ports/print/ghostscript10/Makefile" line 55: Malformed conditional (${FLAVOR} == x11)
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/ports/print/ghostscript10
[00:00:23] Error: Port is broken
[00:00:23] Cleaning up
[00:00:23] Unmounting file systems
Exiting with status 1

Still does not work. Then I fixed /var/poudriere/ports/default-head/print/ghostscript10/Makefile:

root@deblndw011x:/var/poudriere/ports/default-head (pr-272541 *)
# poudriere testport -j 124-release-amd64 -p default-head -i print/ghostscript10
[00:00:00] Creating the reference jail... done
[00:00:13] Mounting system devices for 124-release-amd64-default-head
[00:00:13] Warning: Using packages from previously failed, or uncommitted, build: /var/poudriere/data/packages/124-release-amd64-default-head/.building
[00:00:13] Mounting ports from: /var/poudriere/ports/default-head
[00:00:13] Mounting packages from: /var/poudriere/data/packages/124-release-amd64-default-head
[00:00:13] Mounting distfiles from: /usr/ports/distfiles
[00:00:13] Copying /var/db/ports from: /usr/local/etc/poudriere.d/124-release-amd64-default-head-options
[00:00:13] Appending to make.conf: /usr/local/etc/poudriere.d/124-release-amd64-default-head-make.conf
/etc/resolv.conf -> /var/poudriere/data/.m/124-release-amd64-default-head/ref/etc/resolv.conf
[00:00:13] Starting jail 124-release-amd64-default-head
[00:00:13] Will build as nobody:nobody (65534:65534)
[00:00:14] Ports supports: FLAVORS SELECTED_OPTIONS
[00:00:14] Inspecting ports tree for modifications to git checkout... yes
[00:00:15] Ports top-level git hash: 6ffebb1e6505 (dirty)
[00:00:16] Logs: /var/poudriere/data/logs/bulk/124-release-amd64-default-head/2023-08-31T12:24:50
[00:00:16] Loading MOVED for /var/poudriere/data/.m/124-release-amd64-default-head/ref/usr/ports
[00:00:16] Gathering ports metadata
[00:00:17] Calculating ports order and dependencies
[00:00:18] Trimming IGNORED and blacklisted ports
[00:00:19] Sanity checking the repository
[00:00:19] Checking packages for incremental rebuild needs
[00:00:19] Deleting glib-2.76.4,2.pkg: new version: 2.76.4_1,2
[00:00:19] Deleting jpeg-turbo-2.1.5.1.pkg: new version: 3.0.0
...

So as far as I can see the correct tree is examined, but the output is wrong.

Expected behavior

To continue w/o touching /usr/ports at all!

Environment

michael-o commented 10 months ago

Looking at this again and the poudriere source, I believe that my report is bogus since the output applies to the jail where the tree is of course, by default, in /usr/ports and not the jailhost.

michael-o commented 7 months ago

Closing because I was wrong.