Bug 228268 - sysutils/ansible: Fix multiple Python version (and flavor) support
Summary: sysutils/ansible: Fix multiple Python version (and flavor) support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Nikolai Lifanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-15 08:52 UTC by Christopher Hall
Modified: 2020-07-23 15:20 UTC (History)
8 users (show)

See Also:
lifanov: maintainer-feedback+
koobs: merge-quarterly?


Attachments
patch to add py27-/py36- prefix (577 bytes, patch)
2018-05-15 08:52 UTC, Christopher Hall
no flags Details | Diff
patch v2 (1.76 KB, patch)
2018-05-15 11:15 UTC, Kubilay Kocak
no flags Details | Diff
patch v3 (1.92 KB, patch)
2018-05-16 23:18 UTC, Nikolai Lifanov
eadler: maintainer-approval+
Details | Diff
Fix symlinks to point to `ansible-${PYTHON_VER}` (not to `ansible`) (510 bytes, patch)
2018-07-20 09:06 UTC, Andreas Sommer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Hall 2018-05-15 08:52:38 UTC
Created attachment 193420 [details]
patch to add py27-/py36- prefix

patch to set PKGNAMEPREFIX and remove noflavors

to be able to produce both py27-ansible and py36-ansible packages
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2018-05-15 09:01:16 UTC
Will need to QA this for concurrent support and Python version specific dependencies (if any)
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2018-05-15 10:03:35 UTC
Slave ports ansible2[4]3 and ansible1 need to either be split into individual ports or have their version restricted to 2.7 as only 2.5+ supports Python 3
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2018-05-15 11:01:24 UTC
I have a patch in progress that adds TEST_DEPENDS and a test target to make QA easier / more thorough
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2018-05-15 11:15:10 UTC
Created attachment 193424 [details]
patch v2

- Use PYTHON_PKGNAMEPREFIX
- Enable USE_PYTHON=concurrent
- Add TEST_DEPENDS and test target
Comment 5 Nikolai Lifanov freebsd_committer freebsd_triage 2018-05-15 11:22:30 UTC
Hi Christopher, koobs!

I removed the flavor support in r455231 to unbreak slave ports because:

1) Ansible is a tool and not a library, so it doesn't matter which interpreter it's running with as long as it obeys PYTHON_DEFAULT
2) slave ports need to be adjusted with a unique suffix, and back then it was impossible to set PKGNAMESUFFIX if using FLAVORS

To point #2, I think this has been fixed since, so it's worth revisiting the issue. I'll make the conversion and get to testing!

Thanks koobs for the test target! This will make it a ton easier.
Comment 6 Christopher Hall 2018-05-16 01:21:40 UTC
Hello Nikolai, Koobs

  Thanks for your help in working on this, several of our playbooks just fail on Python2 Ansible and since other team members are using Mac or Linux (with Python3) I did a quick patch and have so far experienced no problems.
Comment 7 Nikolai Lifanov freebsd_committer freebsd_triage 2018-05-16 22:34:25 UTC
Hi Christopher,

I'm still in the middle of testing the whole support matrix.
Thanks for providing the use case for FLAVORS!
Comment 8 Nikolai Lifanov freebsd_committer freebsd_triage 2018-05-16 23:17:40 UTC
With small changes, enough tests pass with both Python 2 and 3 on Ansible 2.3, 2.4, and 2.5. I'm ready to commit this unless koobs would like to since he did most of the work.
Comment 9 Nikolai Lifanov freebsd_committer freebsd_triage 2018-05-16 23:18:31 UTC
Created attachment 193471 [details]
patch v3

added py-nose dependency, nuked problematic test
Comment 10 commit-hook freebsd_committer freebsd_triage 2018-05-18 13:46:03 UTC
A commit references this bug:

Author: lifanov
Date: Fri May 18 13:45:41 UTC 2018
New revision: 470293
URL: https://svnweb.freebsd.org/changeset/ports/470293

Log:
  add tests and FLAVORS to Ansible ports

  Most of the work was done by koobs. Thank you!

  PR:		228268
  Submitted by:	koobs
  Reported by:	Christopher Hall

Changes:
  head/UPDATING
  head/sysutils/ansible/Makefile
  head/sysutils/ansible1/Makefile
  head/sysutils/ansible23/Makefile
  head/sysutils/ansible24/Makefile
Comment 11 Nikolai Lifanov freebsd_committer freebsd_triage 2018-05-18 13:53:56 UTC
Committed, thanks!
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2018-05-19 02:05:42 UTC
Re-open for MFH (bugfix)

@Lifanov Also, the slave ports (ansible[23]) should have their USES=python value limtied to 2.7 (as they dont support Python 3.x). Please merge all commits if you could
Comment 13 Nikolai Lifanov freebsd_committer freebsd_triage 2018-05-19 02:28:32 UTC
The 2.3 and 2.4 versions include beta support for Python 3.
They were compatible with Python 3 already for easier testing.
There is a note to this effect in pkg-message.

Only Ansible 1 is not compatible with Python 3.

I'll MFH this and other commits. I previously was not MFH'ing them because there was only a single sysutils/ansible ports and not ports tracking stable branches.
Comment 14 Kubilay Kocak freebsd_committer freebsd_triage 2018-05-19 02:44:29 UTC
(In reply to Nikolai Lifanov from comment #13)

Ah gotcha. Thanks for clarifying :)
Comment 15 Goran Mekić 2018-06-05 13:29:28 UTC
When FLAVOR=py36 is chosen, all ansible-* files are symlinks to ansible, while only ansible-3.6 exists
Comment 16 Andreas Sommer 2018-07-20 09:05:05 UTC
(In reply to Goran Mekić from comment #15)
I'll post a patch here in a minute to fix `ansible-playbook-3.6 -> ansible` symlinks to correctly use `ansible-playbook-3.6 -> ansible-3.6`. Only fixes the issue – the committer has to adapt PORTREVISION accordingly.
Comment 17 Andreas Sommer 2018-07-20 09:06:23 UTC
Created attachment 195296 [details]
Fix symlinks to point to `ansible-${PYTHON_VER}` (not to `ansible`)
Comment 18 Kubilay Kocak freebsd_committer freebsd_triage 2018-07-20 11:58:41 UTC
(In reply to Goran Mekić from comment #15)

@Goran, Andreas 

This issue is effectively resolved/closed, as the change has already been committed, but is (apparently, still) pending MFH to the quarterll branch.

Please create a separate (new) issue to report any bugs against ansible ports, including the attached patch, so it can be independently reviewed/analyzed.

If the bug(s) are related to or caused by this change, please include this issue ID in the new issues 'See Also' field, and CC lifanov (as the original committer).
Comment 19 Jochen Neumeister freebsd_committer freebsd_triage 2019-02-15 18:26:00 UTC
what is the current status?
Does ports-secteam have to be active here?
Comment 20 Nikolai Lifanov freebsd_committer freebsd_triage 2019-02-17 02:23:18 UTC
Let me check what's in the quarterly branch right now.
I have more ansible updates pending first.
Comment 21 Walter Schwarzenfeld 2019-08-08 02:11:19 UTC
Is this still relevant?
Comment 22 Jochen Neumeister freebsd_committer freebsd_triage 2020-07-23 15:20:08 UTC
I'll close up here. If there are any problems with this P.R., please reopen.