Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jul 2026 01:25:00 -0700
From:      "Edward Sanford Sutton, III" <mirror176@hotmail.com>
To:        ports@freebsd.org
Subject:   Re: What is a FLAVOR and how to unbreak ports?
Message-ID:  <SA1PR11MB8811F3226FA85F2D836AE4D2E6CC2@SA1PR11MB8811.namprd11.prod.outlook.com>
In-Reply-To: <f73caf78-c17c-40e6-9b02-c6137725029c@comcast.net>
References:  <add809af-41f1-4f3a-9f8d-246f2a01ec36@comcast.net> <CALH631nghtQpj%2BLoxsx3SL7tfr_URbW7pHRZScLpyki8HvBjBg@mail.gmail.com> <6ce75735-75f7-4852-814c-91b8105692e6@comcast.net> <SA1PR11MB88113E9A84985B293F61293BE6CC2@SA1PR11MB8811.namprd11.prod.outlook.com> <f73caf78-c17c-40e6-9b02-c6137725029c@comcast.net>

index | next in thread | previous in thread | raw e-mail

On 7/26/26 19:43, Steve Kargl wrote:
> On 7/26/26 18:41, Edward Sanford Sutton, III wrote:
>>    Flavors are a way to have separate packages created for different 
>> configurations of a port. That way users of pkg do not need to go 
>> manually build software for relatively common software variation 
>> possibilities that they may want or need in place of a single default 
>> set of options.
> 
> Yeah, I read the porter's documentation.  I could not find where
> it mentions a comprehensive list of the FLAVORs.  There is no
> discussion of how one can query for the list of FLAVORs.

   Also not present in the normal handbook when talking about using the 
ports tree. Unless I'm mistaken, people shouldn't be directed to the 
porter's handbook unless trying to create or modify ports instead of 
just use them. Maybe I missed it, but I didn't find any clear definition 
of relevant variables and commands in /usr/ports/Mk files except as 
comments above sections of what is being done with blocks of code; 
normally many variables and targets are described in comments at the top 
of bsd.port.mk and if not then its in the relevant other files in there.

>> On 7/26/26 13:18, Steve Kargl wrote:
>>> On 7/26/26 12:51, Gleb Popov wrote:
>>>> On Sun, Jul 26, 2026 at 10:43 PM Steve Kargl <kargls@comcast.net> 
>>>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Updating a laptop that had a year old FreeBSD on it
>>>>> to top-of-tree.
>>>>>
>>>>> % portmaster -Byd --force-config sqlite3 |& tee sgk.log
>>>>
>>>> Try updating libclc first using portmaster or plain make.
>>>
>>> I did try plain make in libclc.  See the end of original email.
>>> make dies with an error about llvm15 no longer being supported.
>>> If llvm15 is no longer supported on fbsd 16, then the libclc
>>> Makefile should simply skip trying to build for llvm15.
>>>
>>>> Figure out what flavor you need by looking at the installed 
>>>> package's name
>>>
>>> That's the question.  What is a FLAVOR and how do I determine what
>>> FLAVOR is the right flavor?
>>>
>>>> pkg info -x libclc
>>>>
>>>> If going the plain make route, append FLAVOR=llvmXY to make invocation.
>>>
>>> Is there a comprehensive list of FLAVORs?  'man make.conf' does not
>>> mention FLAVOR.  Is it possible to set FLAVORS there?

Maybe try adding the following to make.conf:

.if {.CURDIR:M*/devel/libclc}
FLAVOR=	llvm19
.endif

or the more dynamic FLAVOR line I suggest below for the port's makefile 
itself to avoid needing to edit in the future. I'm not sure if FreeBSD16 
is on llvm19 as default or not. I don't think '{}' characters are needed 
but I have a series of these separated by '||' to try to override a 
different variable and forget if it worked or not.

>>    Flavors are a property of each port individually and not an 
>> externally defined property; some different ports use common flavors 
>> like 'nox11' but there is no hard rule to it. In the ports tree you 
>> can list flavors with `make -C /usr/ports/devel/libclc -VFLAVORS` and 
>> drop - C if you run it in the port's folder.
> 
> Well, that's inconvenient, but that make command should be provided
> in the porter's documentation.  At the moment, portmaster dies
> with some mystery error.  Going to /usr/ports/devel/libclc and type
> 'make' leads to all sorts of fun.  libclc dies because llvm15
> is no longer supported; so, well, the port shouldn't even try
> to build that flavor.

   FLAVOR is the variable for how to set which flavor will be built and 
'all' is a special value for building all of them but I don't know if 
that is a ports tree thing or a poudriere thing. If the user doesn't 
define a default, the port doesn't define a default, and a port that 
called it as a dependency doesn't call it as a default, then it will be 
built as the first entry in the variable FLAVORS. Valid values are 
supposed to be listed in the FLAVORS variable.
   `cd /usr/ports/devel/libclc;make -VFLAVORS` isn't a special syntax 
for flavors but just a general syntax that tells make to list the 
contents of the variable that follows the -V. I learned it years ago and 
use it to inspect what variables are set to when looking at how ports 
work to learn, fix them, and try to write them.
   I don't see why we wouldn't have a flavors target so users can type 
`make flavors-list. I usually try to ignore that flavors exist and just 
use options and setting/overriding variables but once I become aware of 
them I have tried to adopt use of a few, usually either so a default is 
overridden that is not an option (should that usually be considered a 
bug?) or so I can have multiple packages built so I can flip between 
them without waiting on another rebuild.

>>    For manually running make, `make -C /usr/ports/devel/libclc 
>> FLAVOR=llvm17` would be an example of overriding it. Not sure if there 
>> are other ways to express it.
> 
> That's the problem.  There are apparently 8 flavors.  How do I determine
> I need llvm17 instead of llvm20?

   Just as flavors have so little documentation in the handbooks and 
Makefile comments, they seem to have little documentation in many ports. 
Port maintainers could tell users about flavors in pkg-message though 
that seems out of place and becomes bloat when it ends up in every 
package but a pkg-message or COMMENT customized to say which flavor it 
is would be a good idea.
   I used llvm17 as an example to say you can do it, not that you 
should. I'd assume that `make -VLLVM_DEFAULT` would have been the 
correct number to use if dependent port(s) didn't try to force a flavor. 
Ports I've found that depend on libclc seem to use the value as listed 
as `make -VLLVM_PORT:T` Since you are only installing it as a 
dependency, its best to check what was requested by the dependent port 
but all ports depending on libclc directly all seem to force it to a 
particular one. Have you tried to alter the default version of llvm or 
anything in your make.conf already?

>>    Some changes I assume should happen:
>>    1. The default of libclc should be reconsidered if it is broken on 
>> a platform unless it is being actively worked on. Why are we 
>> defaulting to the oldest compiler, a compiler not included as a base 
>> compiler on any supported FreeBSD version, and not even having a 
>> comment as to why?

I revise my statement. Unless libclc always needs to be built with or 
have compatibility with llvm15, then the if/endif lines around the 
broken and broken should be replaced with something like(untested):

FEATURES_FreeBSD_16=	${16 17 18 19 20 21 22:L:S/^/llvm/}

to remove the existence of that being a choice. If 15 should still be a 
choice and broken for FreeBSD16 then instead we should have BROKEN 
wrapped with if tests of both the OS version and the FLAVOR. Maybe the 
BROKEN test is okay as it is, but at the very least I'd think something 
like(untested):

FLAVOR?=	${LLVM_PORT:T}

just after the flavors list would fix it any time it has not been 
specified. The only ports I have found that depend on devel/libclc are 
graphics/mesa-dri, graphics/mesa-devel, and graphics/mesa-libs . Since 
those all request a flavor set to the same I'd assume it is fine to make 
it be the default version unless any of them ever conditionally change 
that (didn't observe them doing so but only quickly skimmed).

> Good question.
> 
> 
>>> In the old days, one could cd into any directory under /usr/port
>>> and simply type 'make'.
>>
>>    Unless things are broken. Having been building things since 2004, 
>> you can usually find broken things when you look.
> 
> I've been building ports since its inception.  In fact, I was the
> maintainer for lang/f2c and few others prior to the creation of
> portmgr.  portmgr broke lang/f2c, I received daily complaints it
> was broken, and it only wasted a few weeks of my time trying to
> figure out what portmgr did.  I dropped maintainership decades
> ago due to that experience.
> 
>   at over 30,000 port
>> folders, its hard to have the tree in a state where 'nothing' fails.
> 
> Sure, I find a number of issues every time I need to rebuild
> ports.  I fix/workaround the issue and move on with life.  The
> math/arpack-ng port now has a mpich and openmpi flavor, because
> I got tired of editing out the hardcoded use of mpich and asked
> for either 'none' or 'openmpi' build option.  Unfortunately,
> math/octave has a hardcoded dependency on arpack-ng@mpich.  Fun
> times.
> 
>>> My actual problem is building devel/node24, which dies with an
>>> error:
>>> ld.lld: error: undefined symbol: sqlite3session_patchset.
>>
>>    I'd have to see a more complete error log to guess properly. 
> 
> I've found a fix.  It seems that node24 requires sqlite3 built
> with the sessions compile option set.  For some reason, it was
> unset when I last built it on my system.  I suppose default
> options change over time.

Sounds like /usr/ports/UPDATING:20251130


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?SA1PR11MB8811F3226FA85F2D836AE4D2E6CC2>