Bug 280883 - net/py-mpi4py: Update to 4.0.0
Summary: net/py-mpi4py: Update to 4.0.0
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: Vladimir Druzenko
URL: https://github.com/mpi4py/mpi4py/rele...
Keywords:
Depends on: 280879
Blocks:
  Show dependency treegraph
 
Reported: 2024-08-17 13:24 UTC by Laurent Chardon
Modified: 2024-09-02 01:49 UTC (History)
9 users (show)

See Also:
antoine: exp-run+


Attachments
Patch for mpi4py 4.0.0 (4.22 KB, patch)
2024-08-17 13:24 UTC, Laurent Chardon
laurent.chardon: maintainer-approval+
Details | Diff
Patch for mpi4py 4.0.0 v2 (4.21 KB, patch)
2024-08-17 14:41 UTC, Laurent Chardon
laurent.chardon: maintainer-approval+
Details | Diff
git patch 3 (4.44 KB, patch)
2024-08-18 16:50 UTC, Laurent Chardon
laurent.chardon: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Chardon 2024-08-17 13:24:16 UTC
Created attachment 252846 [details]
Patch for mpi4py 4.0.0

- Update to 4.0.0
- Move blocks to placate portlint
- Take maintainership

QA
portlint: OK
poudriere: OK
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-17 13:40:03 UTC
1. Sort options:
-USES=		python pkgconfig
-USE_PYTHON=	distutils cython autoplist concurrent
+USES=		pkgconfig python
+USE_PYTHON=	autoplist concurrent cython distutils

2. If you have USE_PYTHON=cython do you need:
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}cython3>3.0.0:lang/cython3@${PY_FLAVOR}
?
Comment 2 Laurent Chardon 2024-08-17 14:36:59 UTC
(In reply to Vladimir Druzenko from comment #1)

Thanks for the feedback.

1) OK
2) I need the BUILD_DEPENDS, otherwise py39-cython-0.29.37 is installed with only USE_PYTHON=cython, and cython > 3.0.0 is needed by the port. With the BUILD_DEPENDS, I can probably get rid of USE_PYTHON=cython.

I'll upload a new patch.
Comment 3 Laurent Chardon 2024-08-17 14:41:49 UTC
Created attachment 252848 [details]
Patch for mpi4py 4.0.0 v2

Update patch according to comments
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-17 15:22:20 UTC
(In reply to Laurent Chardon from comment #2)
> otherwise py39-cython-0.29.37
Default python in ports is 3.11.
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-17 15:25:41 UTC
(In reply to Laurent Chardon from comment #2)
USES=cython => lang/cython
Maybe you don't need USES=cython?
Comment 6 Laurent Chardon 2024-08-17 15:29:23 UTC
(In reply to Vladimir Druzenko from comment #4)
Sorry, that was a typo. I meant py311-cython-0.29.37.
Comment 7 Laurent Chardon 2024-08-17 15:31:11 UTC
(In reply to Vladimir Druzenko from comment #5)

I'm not sure what you mean
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-17 16:40:14 UTC
(In reply to Laurent Chardon from comment #7)
Can we remove cython from USES?
Comment 9 Laurent Chardon 2024-08-18 00:43:23 UTC
(In reply to Vladimir Druzenko from comment #8)

That's what I thought you meant. I removed it already from USE_PYTHON. I've tested that it works.
It's not in USES.  

From my second patch: 
>+USES=		pkgconfig python 
>+USE_PYTHON=	autoplist concurrent distutils
Comment 10 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-18 02:10:33 UTC
$ grep mpi4py /usr/ports/INDEX-14 | wc -l
      65

Are you sure 4.0.0 is fully compatible with 3.1.6?
And we don't need exp-run?
Comment 11 Laurent Chardon 2024-08-18 16:50:30 UTC
Created attachment 252888 [details]
git patch 3

Two changes:

- BSD2CLAUSE -> BSD3CLAUSE, to reflect upstream change
- Update CONFLICTS_INSTALLs for current version
Comment 12 Laurent Chardon 2024-08-18 16:56:57 UTC
(In reply to Vladimir Druzenko from comment #10)

I did some simple tests, but I can't be sure that it won't break anything. I'm OK with an exp-run if you are willing to set it up, but I don't know how useful it will really be, because a lot of the dependencies are run-time. That being said, it won't hurt to do an exp-run and have a look.
Comment 13 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-18 20:47:18 UTC
(In reply to Laurent Chardon from comment #12)
What upstream write about back compatibility?

Also, why do we need line "SLAVEDIRS=net/py-mpi4py-mpich"?
Can't find how and where it used.
Comment 14 Laurent Chardon 2024-08-18 22:05:19 UTC
(In reply to Vladimir Druzenko from comment #13)

I'm not sure what SLAVESDIR is used for. I see that other ports have it. It seems that this line was added recently in Bug 272949. I've cc'd the author.

As for the changes, upstream mentions that they are not all backward-compatible. However they have some mitigations in place, and the rest seems fairly edge-case to me, but I could be wrong. See "Backward-incompatible changes" in URL.
Comment 15 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-19 00:23:31 UTC
(In reply to Laurent Chardon from comment #14)
I already found this commit, but I don't see there SLAVEDIRS used. Ports framework don't know this option/variable either. I removed this line and build both ports net/py-mpi4py-mpich and net/py-mpi4py without errors.

It looks scary to me, who is not in the know:
Backward-incompatible changes:
  * Python 2 is no longer supported, Python 3.6+ is required, but
    typing stubs are supported for Python 3.8+.
  * The Intracomm.Create_group() method is no longer defined in the
    base Comm class.
  * Group.Compare() and Comm.Compare() are no longer class methods
    but instance methods. Existing codes using the former class
    methods are expected to continue working.
  * Group.Translate_ranks() is no longer a class method but an
    instance method. Existing codes using the former class method are
    expected to continue working.
  * The LB and UB datatypes are no longer available, use
    Datatype.Create_resized() instead.
  * The HOST predefined attribute key is no longer available.
  * The MPI.memory class has been renamed to MPI.buffer. The old
    name is still available as an alias to the new name.
  * The mpi4py.dl module is no longer available.
  * The mpi4py.get_config function returns an empty dictionary.
Comment 16 Thierry Thomas freebsd_committer freebsd_triage 2024-08-19 16:18:22 UTC
(In reply to Laurent Chardon from comment #14)
Hello,
SLAVESDIR is not a macro, just a warning.
It means that this is a MASTER port, and if you modify it, the ports referenced by SLAVESDIR will be affected.
Comment 17 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-19 19:05:41 UTC
(In reply to Thierry Thomas from comment #16)
So this is some kind of comment?
Comment 18 Thierry Thomas freebsd_committer freebsd_triage 2024-08-19 19:30:42 UTC
(In reply to Vladimir Druzenko from comment #17)
Yes, it is.
Comment 19 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-19 20:45:28 UTC
(In reply to Thierry Thomas from comment #18)
Thanks.

But what can we do with compatibility with other ports?…
In most cases, exp-run can only handle build failures.
On the other hand, it's better than nothing.
Comment 20 Antoine Brodin freebsd_committer freebsd_triage 2024-08-19 20:52:51 UTC
If you want an exp-run ,  assign this PR to portmgr
Comment 21 Thierry Thomas freebsd_committer freebsd_triage 2024-08-19 20:56:17 UTC
(In reply to Vladimir Druzenko from comment #19)
Usually Python programs set limits if they might fail with a too recent version (resp. too old) of their dependencies, and the ports would stop at the configure stage. If they build, we can only hope that all goes well!
Comment 22 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-19 21:33:19 UTC
(In reply to Thierry Thomas from comment #21)
We are in middle of Q3 - have time to fix consumers till Q4.
Even if the exp-run is successful, we commit, and then runtime errors are discovered in consumers, we can always roll back the version update.

(In reply to Antoine Brodin from comment #20)
Done. Thanks!
Comment 23 Antoine Brodin freebsd_committer freebsd_triage 2024-08-25 19:18:09 UTC
Exp-run looks fine
Comment 24 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-25 21:45:30 UTC
(In reply to Antoine Brodin from comment #23)
Thanks, Antoine!

yuri, cmt, mr, thierry, sunpoet, stephen, henrik@gulbra.net, teodorsigaev@gmail.com, your ports depends on this port. If you have the opportunity, please check how your ports work with net/py-mpi4py version 4.0.
They are build fine, but it's python - many errors can only be seen at runtime.
If no one has any objections, I plan to commit within the next 2-3 days.

Full list (grep mpi4py INDEX-14 | awk -F'[/|]' '{print $5"/"$6}'):
cad/PrusaSlicer
cad/appcsxcad
cad/csxcad
cad/freecad
cad/gmsh
cad/horizon-eda
cad/kicad
cad/kicad-devel
cad/kicad-doc
cad/kicad-library-footprints
cad/kicad-library-footprints-devel
cad/kicad-library-packages3d
cad/kicad-library-packages3d-devel
cad/kicad-library-symbols
cad/kicad-library-symbols-devel
cad/kicad-library-templates
cad/kicad-library-templates-devel
cad/librepcb
cad/opencascade
cad/py-gmsh
cad/py-pygmsh
cad/qcsxcad
devel/py-pyina
french/aster
french/homard
graphics/alizams
graphics/cloudcompare
graphics/elastix
graphics/f3d
graphics/mirtk
graphics/pcl-pointclouds
graphics/py-f3d
graphics/py-fury
graphics/py-mayavi
graphics/py-pyvista
graphics/simpleitk
math/deal.ii
math/hyperdeal
math/octave-forge
math/octave-forge-bim
math/octave-forge-msh
math/octave-forge-secs1d
math/octave-forge-secs3d
math/octave-forge-sole
math/py-topologic
math/topologic
math/vtk9
misc/adios2
misc/visp
science/InsightToolkit
science/code_saturne
science/elmerfem
science/liggghts
science/mmg
science/openems
science/paraview
science/py-PyFR
science/py-boutdata
science/py-boututils
science/py-pyprecice
science/py-vedo
science/py-xbout
science/ttk
Comment 25 Vladimir Druzenko freebsd_committer freebsd_triage 2024-09-01 15:45:37 UTC
(In reply to Vladimir Druzenko from comment #24)
Ok. Commiting…
Comment 26 commit-hook freebsd_committer freebsd_triage 2024-09-01 15:58:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=907f3f00bc41d3cc836425afc8eba4bc5510da65

commit 907f3f00bc41d3cc836425afc8eba4bc5510da65
Author:     Laurent Chardon <laurent.chardon@gmail.com>
AuthorDate: 2024-09-01 15:48:07 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-09-01 15:57:59 +0000

    net/py-mpi4py: Update 3.1.6 → 4.0.0

    Backward-incompatible changes:
      * Python 2 is no longer supported, Python 3.6+ is required, but
        typing stubs are supported for Python 3.8+.
      * The Intracomm.Create_group() method is no longer defined in the
        base Comm class.
      * Group.Compare() and Comm.Compare() are no longer class methods
        but instance methods. Existing codes using the former class
        methods are expected to continue working.
      * Group.Translate_ranks() is no longer a class method but an
        instance method. Existing codes using the former class method are
        expected to continue working.
      * The LB and UB datatypes are no longer available, use
        Datatype.Create_resized() instead.
      * The HOST predefined attribute key is no longer available.
      * The MPI.memory class has been renamed to MPI.buffer. The old
        name is still available as an alias to the new name.
      * The mpi4py.dl module is no longer available.
      * The mpi4py.get_config function returns an empty dictionary.

    Changelog:
    https://github.com/mpi4py/mpi4py/releases/tag/4.0.0

    Exp-run looks fine.

    Take maintainership.

    PR:     280883

 net/py-mpi4py/Makefile                    | 51 +++++++++++++++----------------
 net/py-mpi4py/distinfo                    |  6 ++--
 net/py-mpi4py/files/patch-setup.py (gone) | 25 ---------------
 3 files changed, 27 insertions(+), 55 deletions(-)
Comment 27 Vladimir Druzenko freebsd_committer freebsd_triage 2024-09-01 15:59:32 UTC
Thanks!
Comment 28 Laurent Chardon 2024-09-02 01:49:03 UTC
Thank you!