# Can Flavors be used to Avoid Circular Dependencies in Poudriere?



## SomePoorBastard (Jun 19, 2022)

I'm looking at some documentation within poudriere(), to try to find a way to avoid running into circular dependencies while building ports. While reading that documentation, I come across a specific concept which isn't explained clearly in the mandoc: flavors. Searching the forums here didn't turn up anything obvious. The results that were returned led me to suspect that flavors probably correspond to the architecture the port was built for.
However, using an external search engine with the expression `flavors site:freebsd.org` did pop up a nice piece from the Porter's Handbook: https://docs.freebsd.org/en/books/porters-handbook/flavors/



> 7.1. An Introduction to Flavors​Flavors are a way to have multiple variations of a port. The port is built multiple times, with variations.
> For example, a port can have a normal version with many features and quite a few dependencies, and a light "lite" version with only basic features and minimal dependencies.
> Another example could be, a port can have a GTK flavor and a QT flavor, depending on which toolkit it uses.



Has anyone used flavors in a manner to avoid situations like these?

`[00:00:10] Error: Dependency loop detected:
These packages depend on each other: libgd-2.3.3_1,1 libheif-1.12.0.62_1 aom-3.3.0_1 libjxl-0.6.1_5 openexr-3.1.5 py38-breathe-4.33.1 doxygen-1.9.3_1,2 texlive-base-20210325_3
These packages depend on each other: libgd-2.3.3_1,1 libheif-1.12.0.62_1 aom-3.3.0_1 libjxl-0.6.1_5 openexr-3.1.5 py38-breathe-4.33.1 doxygen-1.9.3_1,2 graphviz-2.50.0_2
These packages depend on each other: texlive-base-20210325_3 libgd-2.3.3_1,1 libheif-1.12.0.62_1 aom-3.3.0_1 libjxl-0.6.1_5 openexr-3.1.5 py38-breathe-4.33.1 doxygen-1.9.3_1,2 tex-formats-20210325_1 texlive-texmf-20210325`


----------



## zirias@ (Jun 19, 2022)

Flavors won't help you. They just offer the ability to build multiple (and differently named) packages from the same port, in different configurations. E.g. all the python ports use them, so there are packages for each currently supported python version available. Vim uses them, so you can have e.g. a package with and another without GUI...

With default port options, there won't be circular dependencies (and if they happen, they'll be quickly found on the official builders and fixed). But it's always possible to create them with custom options. You'll just have to investigate which port option causes the problem for you.


----------



## sidetone (Jun 19, 2022)

Report the circular dependencies to the port maintainer(s) or mailing list. Provide the relevant information of it. Then, they can be expected to remove them. That will also help the project a lot.


----------



## zirias@ (Jun 19, 2022)

sidetone I'd oppose that except for two corner cases:

If you're running into the circular dependency with all-default options, it would be noted anyways on the next bulk build, but reporting it might speed up things
If you find a good solution to avoid it with your specific combination of port options, then sure, report it and attach a patch 
But IMHO, trying to avoid circular dependencies with any possible combination of port options would unnecessarily restrict these options.


----------



## SomePoorBastard (Jun 19, 2022)

I appreciate you taking the time to share your experience.

I'll definitely have to take notes and share them somewhere best suited for such knowledge.


----------

