Bug 224265 - misc/py-tqdm should be using USE_PYTHON=concurrent
Summary: misc/py-tqdm should be using USE_PYTHON=concurrent
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-12 09:19 UTC by Shane
Modified: 2018-03-03 19:06 UTC (History)
2 users (show)

See Also:
nc: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shane 2017-12-12 09:19:07 UTC
With FLAVOR support now in ports, a pkg repo can have multiple pkgs available for each origin, pkg install uses an unstable algorithm when choosing a pkg to install which leads to unwanted behaviour.

If multiple pkgs match the install parameters, either using partial name or origin, then repeated pkg installs will choose different flavours each time. This means if you use a list of pkg origins to install and update pkgs then software you use will continuously break.

As an example -

# pkg search tqdm
py27-tqdm-4.11.2               Fast, extensible progress bar for Python
py36-tqdm-4.11.2               Fast, extensible progress bar for Python

# pkg search misc/py-tqdm
misc/py-tqdm                   Fast, extensible progress bar for Python
misc/py-tqdm                   Fast, extensible progress bar for Python

# pkg install misc/py-tqdm
Updating HomeRepo repository catalogue...
HomeRepo repository is up to date.
All repositories are up to date.
Checking integrity... done (1 conflicting)
  - py36-tqdm-4.19.4 [HomeRepo] conflicts with py27-tqdm-4.19.4 [HomeRepo] on /usr/local/bin/tqdm
Cannot solve problem using SAT solver, trying another plan
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	py27-tqdm: 4.19.4 [HomeRepo]
...

# pkg install misc/py-tqdm
Updating HomeRepo repository catalogue...
HomeRepo repository is up to date.
All repositories are up to date.
Checking integrity... done (1 conflicting)
  - py36-tqdm-4.19.4 [HomeRepo] conflicts with py27-tqdm-4.19.4 [installed] on /usr/local/bin/tqdm
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
	py27-tqdm-4.19.4

New packages to be INSTALLED:
	py36-tqdm: 4.19.4 [HomeRepo]
...

# pkg install misc/py-tqdm
Updating HomeRepo repository catalogue...
HomeRepo repository is up to date.
All repositories are up to date.
Checking integrity... done (1 conflicting)
  - py27-tqdm-4.19.4 [HomeRepo] conflicts with py36-tqdm-4.19.4 [installed] on /usr/local/bin/tqdm
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
	py36-tqdm-4.19.4

New packages to be INSTALLED:
	py27-tqdm: 4.19.4 [HomeRepo]
Comment 1 Mathieu Arnold freebsd_committer 2017-12-12 12:13:54 UTC
Also, the bug, if there is one, is in misc/py-tqdm that should be using USE_PYTHON=concurrent.
Comment 2 Mathieu Arnold freebsd_committer 2017-12-12 12:17:52 UTC
(with the patch from bug 220214 to get the man page to not conflict)
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2017-12-12 14:48:55 UTC
Summary changed per comment from mat@.
Comment 4 Shane 2017-12-14 05:17:25 UTC
The real issue is that repeating the same pkg install command can produce different results.

py-tqdm is only one of many python ports that need updating to handle concurrent installs. It was a simple port with no deps that was only chosen as an example. Concurrent support is a different issue than the selection algorithm used by pkg.

Flavours support for python is a first step that appears to also have plans on being used by other ports (like ruby) that may or may not support concurrent pkg installs. Improving the selection algorithm used by pkg can only prevent other issues in the future.

A simple solution would be sorting found pkgs and installing the first, while a more advanced solution would consider DEFAULT_VERSIONS.

I'm sure others would argue that in the initial example only one port should be installed, the one matching the set default version, which may or may not sort into first place.
Comment 5 Neel Chauhan freebsd_committer 2017-12-18 19:59:04 UTC
Looks good to me.
Comment 6 Kurt Jaeger freebsd_committer 2018-03-03 19:06:48 UTC
Was committed with PR#226240