Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2018 13:33:21 -0800
From:      John Baldwin <jhb@FreeBSD.org>
To:        ports@FreeBSD.org
Subject:   Package names and flavors for python (and php?)
Message-ID:  <469b896f-6d65-17bf-9bd9-034b65d8eb88@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
The devel/gdb port supports optional python integration (so that you can
write python scripts that work with gdb internals to define custom commands,
pretty printers, etc.).  This means gdb can be linked against different
python versions.  I decided to add flavors to the gdb port to handle the
different python versions (diff is at D18534).  However, I chose to do
something with the package name suffixes that apparently is at odds with
best practice, but seems to be more user friendly.  Specifically, I did not
add the python flavor as a suffix for the "default" package.  Had I done so,
the two packages would have been named 'gdb-py27' and 'gdb-py36' and
'pkg install gdb' would no longer work.  So, I instead dropped the suffix
when the default python version was used so that the results are 'gdb'
and 'gdb-py36' (or if you python3 as your default you will get 'gdb' and
'gdb-py27').  I could have just used 'USE_PYTHON=optsuffix' for this, but
that currently emits a warning, so I ended up doing it via a 'homegrown'
way.  I do think it's important that 'pkg install gdb' still works since
that is splatted in various places now like the release notes for 12.0
and src/UPDATING, etc.  If having the equivalent of 'optsuffix' really is
terrible then I'd rather drop the python flavors than break 'pkg install gdb'.

On a related note, I installed a new box with 12.0 last week and wanted to
install arcanist.  Trying to use 'pkg install arcanist' failed because
there is no longer a package named 'arcanist'.  Trying to use
'pkg install devel/arcanist' was a separate fail because it wanted to
install all four flavors (along with 4 sets of php packages).  I ended up
using 'pkg install arcanist-php72'.  However, as a user I was just guessing
that 'php72' is the default version of php, and I would probably prefer to
not have to think about that.  It would be great if 'pkg install arcanist'
just installed the default flavor with the default version of PHP.

Also related to this, I upgraded a different box from 11.2-ish to 12.0 two
weeks ago and rebuilt all its packages using a local poudriere.  It also
tripped over the flavors package names because the old arcanist package I
had installed (php5-arcanist-20161003 from devel/arcanist) wasn't upgraded
by 'pkg upgrade -f' to the php72 version.  I ended up explicitly deleting
it and installing the new version.  I'm not sure what the right solution is,
but it seems like 'pkg upgrade' of the previous default flavor should
upgrade to the new default flavor if the default flavor changes rather than
getting stuck on an old version (that in my case my poudriere build didn't
rebuild).

-- 
John Baldwin

                                                                            



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?469b896f-6d65-17bf-9bd9-034b65d8eb88>