freebsd / poudriere

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

Poudriere fails to build pyNN- dependencies of non-default python version #313

Closed yurivict closed 7 years ago

yurivict commented 9 years ago

Port shar is here: http://pastebin.com/c98Jn1XX

It does rebuild and extract python34 fine:

[10amd64-local-workstation-job-01] `-- Extracting libffi-3.2.1... done
[10amd64-local-workstation-job-01] Extracting python34-3.4.3_1... done
===>   Returning to build of tiny-network-utilities-0.150518

but it fails to rebuild required py34-* modules:

=======================<phase: run-depends    >============================
===>   tiny-network-utilities-0.150518 depends on package: py34-netifaces>0 - not found
===>    Verifying install for py34-netifaces>0 in /usr/ports/net/py-netifaces
===>   tiny-network-utilities-0.150518 depends on package: /packages/All/py34-netifaces-0.10.3.txz - not found
===>   USE_PACKAGE_DEPENDS_ONLY set - not building missing dependency from source
*** Error code 1

It looks like poudriere rebuilds py27- dependencies, and then fails on missing py34- ones.

This may well be the problem in ports Mk/, but it only fails in poudriere.

yurivict commented 9 years ago

Looking into this myself. Looks like pourdiere isn't package generation aware.

'list_deps' is where this begins. Changing it to this:

list_deps() {
        [ $# -ne 1 ] && eargs list_deps directory
        local dir="/usr/ports/$1"
        local makeargs="-VPKG_DEPENDS -VBUILD_DEPENDS -VEXTRACT_DEPENDS -VLIB_DEPENDS -VPATCH_DEPENDS -VFETCH_DEPENDS -VRUN_DEPENDS"

        prefix_stderr_quick "(${COLOR_PORT}$1${COLOR_RESET})${COLOR_WARN}" \
                injail make -C ${dir} $makeargs | \
                tr ' ' '\n' | \
                sed -E "s,^(py[0-9]+)-(.*)/py-(.*),\1-\2/\1-\3,g" | \
                sed -e "s,[[:graph:]]*/usr/ports/,,g" \
                -e "s,:[[:graph:]]*,,g" -e '/^$/d' | \
                sort -u || err 1 "Makefile broken: $1"
}

makes it compute package names with generations. This will need to be used to strip generation:

pname_strip_generation() {
        echo "$1" | sed -E "s,^(py[0-9]+)-,py-,g"
}

Then many functions need to be aware of this, when port directory =/= port name with generation in it.

yurivict commented 9 years ago

Ok, this is clearly the bug in poudriere. I have made most of the changes needed to fix this. Will try to make a patch.

yurivict commented 9 years ago

Pull request: https://github.com/freebsd/poudriere/pull/314

bdrewery commented 9 years ago

No, it's not a bug in Poudriere. It's a flawed hack in the ports framework. Any implementation of building these packages needs to be handled mostly in the framework. Putting special logic in Poudriere is not right; Portmaster and Portupgrade are also broken with this framework hack. #259 discusses this as well.

I'm against adding support for this hack into Poudriere. The proper framework support should either use slaves or just bundle multiple versions in each python package or come up with a more longterm solution of having multiple versions/packages per origin. Currently it is too specific and shortsighted.

yurivict commented 9 years ago

But framework itself builds them fine currently. Poudriere is the one that fails to handle them.

This is like virtual slave support. It is generic, not only for python, but also for ruby, and for any number of classes.

bdrewery commented 9 years ago

It was a mistake to add the feature into the framework IMO. Especially without discussing and considering the impact on all of the tools people use.

bdrewery commented 8 years ago

This is stale, I consider it a bug now and is tracked in #259

bdrewery commented 7 years ago

For direct context, I backtracked on "it's not a bug in Poudriere" heavily and implemented support for _DEPENDSARGS in #483, as well as FLAVORS.