FreshPorts and FLAVORS

Dan Langille dan at langille.org
Mon Dec 4 14:50:59 UTC 2017


I've been reading up on FLAVORS (https://wiki.freebsd.org/Ports/FlavorsAndSubPackages)
and creating a plan for FreshPorts.

Since FLAVORS came in, FreshPorts has been reporting false sanity test failures like this:

https://www.freshports.org/sanity_test_failures.php?message_id=201712041212.vB4CCwu4059472@repo.freebsd.org

e.g.

###

devel/py-flake8:

NOTE: this particular sanity test is very experimental
A port specified in the BUILD_DEPENDS of devel/py-flake8 does not exist:
'devel/py-pytest-runner at py27' on branch 'head'.

NOTE: this particular sanity test is very experimental
A port specified in the BUILD_DEPENDS of devel/py-flake8 does not exist:
'devel/py-setuptools at py27' on branch 'head'.

NOTE: this particular sanity test is very experimental
A port specified in the RUN_DEPENDS of devel/py-flake8 does not exist:
'devel/py-mccabe at py27' on branch 'head'.

...

###

Some background based on the Makefile for the above commit: https://svnweb.freebsd.org/ports/head/devel/py-flake8/Makefile?view=markup&pathrev=455509

FreshPorts converts this line: 

BUILD_DEPENDS=  ${PYTHON_PKGNAMEPREFIX}pytest-runner>=0:devel/py-pytest-runner@${FLAVOR}

to: 

py27-pytest-runner>=0:devel/py-pytest-runner at py27

The part before the : is dropped, leaving us with the port upon which devel/py-flake8 is dependent:

py-pytest-runner at py27

FreshPorts looks for that in the ports tree, and fails.  As such, FreshPorts needs to learn about FLAVORS.
Or more precisely, at least in the short term, how to ignore FLAVORS.

The solution I have is:

###

[dan at pro02:~/tmp] $ cat depends.pl 
#!/usr/local/bin/perl

my $depends = 'devel/py-setuptools at py27';

($depends, undef) = split /[@\:]/, $depends;

print "'$depends'\n";
[dan at pro02:~/tmp] $ perl depends.pl 
'devel/py-setuptools'

###

This results in a port which FreshPorts can find in the tree.  I plan to start coding and testing this
approach later today.

This solution also caters for depends such as devel/git:configure which also created false positives.

I suspect this will only be a short term solution.

short term issues:

* I am not yet sure about duplicate depends.  If a port has devel/py-setuptools at py27 and devel/py-setuptools at py36, what will happen?
* looking at the depends on FreshPorts, you cannot tell which FLAVORS are available / in use.

long term issues:

* Should FreshPorts discern between different FLAVORS? How useful would that be?
* How should FreshPorts display FLAVORS available in a port.

Comments and suggestions welcome.  So are patches.

-- 
Dan Langille - BSDCan / PGCon
dan at langille.org




More information about the freebsd-ports mailing list