Bug 264807 - sysutils/py-psutil: Fix broken __FreeBSD_version check
Summary: sysutils/py-psutil: Fix broken __FreeBSD_version check
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: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks: 264701
  Show dependency treegraph
 
Reported: 2022-06-21 13:28 UTC by Torsten Blum
Modified: 2022-06-24 02:03 UTC (History)
2 users (show)

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


Attachments
Adding patch to psutil/arch/freebsd/mem.c and increasing the ports revision (1.62 KB, application/mbox)
2022-06-21 13:28 UTC, Torsten Blum
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Blum 2022-06-21 13:28:21 UTC
Created attachment 234837 [details]
Adding patch to psutil/arch/freebsd/mem.c and increasing the ports revision

psutil 5.9.1 doesn't include <sys/param.h>, causing __FreeBSD_version check for > 702101 in arch/freebsd/mem.c to not work properly and thus breaking the port on systems without COMPAT_FREEBSD7.
Comment 1 Torsten Blum 2022-06-21 13:30:23 UTC
(In reply to Torsten Blum from comment #0)

As an alumni I used my project mail inside the patch as I'm already in the contributors list as an alumni and don't need to be listed under "Additional FreeBSD Contributors" as well.
If you feel this is not appropriate, feel free to use my private one by applying s/FreeBSD/vmunix/
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-06-21 21:01:14 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=030111b816ead69e62d5243b845450bc9cce3457

commit 030111b816ead69e62d5243b845450bc9cce3457
Author:     Torsten Blum <torstenb@FreeBSD.org>
AuthorDate: 2022-06-21 20:58:58 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-06-21 20:58:58 +0000

    sysutils/py-psutil: Fix failing __FreeBSD_version check

    - Bump PORTREVISION for package change

    psutil 5.9.1 does not include <sys/param.h> in arch/freebsd/mem.c, causing the
    __FreeBSD_version check there not not work properly and thus breaking the port
    on systems without COMPAT_FREEBSD7.

    PR:             264807
    Reference:      https://github.com/giampaolo/psutil/issues/2113

 sysutils/py-psutil/Makefile                                    |  1 +
 sysutils/py-psutil/files/patch-psutil_arch_freebsd_mem.c (new) | 10 ++++++++++
 2 files changed, 11 insertions(+)
Comment 3 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-06-21 21:02:18 UTC
Committed. Thanks!
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2022-06-22 00:08:37 UTC
Quarterly users are affected, can we merge this please?
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2022-06-22 00:10:14 UTC
^Triage: This also resolves bug 264701 once merged
Comment 6 Torsten Blum 2022-06-22 05:59:29 UTC
(In reply to Kubilay Kocak from comment #4)

Are you sure it affects quarterly? A quick grep on packagesite.yaml indicates none of the quarterly repositories has version 5.9.1 of psutil:

for r in 12:i386 12:amd64 12:aarch64 13:i386 13:amd64 13:aarch64 14:i386 14:amd64 14:aarch64 12:armv6 12:armv7 12:mips64 12:powerpc64 13:armv6 13:armv7 13:mips64 13:powerpc64 13:riscv64 14:armv6 14:armv7 14:mips64 14:powerpc64 14:riscv64 ; do ; echo FreeBSD:$r >/dev/stderr ;  curl -s --show-error "http://pkg.freebsd.org/FreeBSD:$r/quarterly/packagesite.txz" | tar xzOf - packagesite.yaml 2>/dev/null | jq -rc '[.origin, .name, .version]' | grep sysutils/py-psutil\" ; echo ; done
FreeBSD:12:i386
["sysutils/py-psutil","py38-psutil","5.9.0"]

FreeBSD:12:amd64
["sysutils/py-psutil","py38-psutil","5.9.0"]

FreeBSD:12:aarch64
["sysutils/py-psutil","py38-psutil","5.9.0"]

FreeBSD:13:i386
["sysutils/py-psutil","py38-psutil","5.9.0"]

FreeBSD:13:amd64
["sysutils/py-psutil","py38-psutil","5.9.0"]

FreeBSD:13:aarch64
["sysutils/py-psutil","py38-psutil","5.9.0"]

FreeBSD:14:i386

FreeBSD:14:amd64

FreeBSD:14:aarch64

FreeBSD:12:armv6
["sysutils/py-psutil","py27-psutil","5.7.2"]
["sysutils/py-psutil","py37-psutil","5.7.2"]

FreeBSD:12:armv7
["sysutils/py-psutil","py27-psutil","5.7.2"]
["sysutils/py-psutil","py37-psutil","5.7.2"]

FreeBSD:12:mips64
["sysutils/py-psutil","py27-psutil","5.7.0"]
["sysutils/py-psutil","py37-psutil","5.7.0"]

FreeBSD:12:powerpc64
["sysutils/py-psutil","py37-psutil","5.8.0"]

FreeBSD:13:armv6
["sysutils/py-psutil","py38-psutil","5.9.0"]

FreeBSD:13:armv7
["sysutils/py-psutil","py38-psutil","5.9.0"]

FreeBSD:13:mips64

FreeBSD:13:powerpc64
["sysutils/py-psutil","py38-psutil","5.8.0"]

FreeBSD:13:riscv64
["sysutils/py-psutil","py38-psutil","5.9.0"]

FreeBSD:14:armv6

FreeBSD:14:armv7

FreeBSD:14:mips64

FreeBSD:14:powerpc64

FreeBSD:14:riscv64
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2022-06-23 01:43:09 UTC
(In reply to Torsten Blum from comment #6)

If this was a 5.9.1 only regression caused by PR #2059 [1], sure...

[1] https://github.com/giampaolo/psutil/pull/2059
Comment 8 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-06-23 12:30:55 UTC
(In reply to Kubilay Kocak from comment #4)

This file (arch/freebsd/mem.c) does not exist in earlier versions (e.g. 5.9.0), therefore quarterly branch is not affected.