Bug 265203 - databases/rrdtool: Fix build with PYTHON option on
Summary: databases/rrdtool: Fix build with PYTHON option on
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: Nuno Teixeira
URL: https://www.freshports.org/databases/...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-13 21:51 UTC by Sigi
Modified: 2023-01-05 09:13 UTC (History)
4 users (show)

See Also:
eduardo: merge-quarterly?


Attachments
patch for databases/rrdtool (11.72 KB, patch)
2022-12-07 11:01 UTC, Tatsuki Makino
no flags Details | Diff
patch for databases/rrdtool (12.66 KB, patch)
2022-12-07 11:07 UTC, Tatsuki Makino
grahamperrin: maintainer-approval? (eduardo)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sigi 2022-07-13 21:51:41 UTC
/usr/bin/strip /usr/ports/databases/rrdtool/work-py39/stage/usr/local/lib/perl5/site_perl/mach/5.32/auto/RRDs/RRDs.so
/usr/bin/strip /usr/ports/databases/rrdtool/work-py39/stage/usr/local/lib/python3.9/site-packages/rrdtool*.so
/usr/bin/strip /usr/ports/databases/rrdtool/work-py39/stage/usr/local/lib/ruby/site_ruby/3.0/amd64-freebsd13/RRD.so
====> Compressing man pages (compress-man)
===> Staging rc.d startup script(s)
===>  Installing for rrdtool-1.7.2_6
===>  Checking if rrdtool is already installed
===>   Registering installation for rrdtool-1.7.2_6
pkg-static: pkg_checksum_hash_sha256_file(read failed): Is a directory
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/databases/rrdtool
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/rrdtool
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/rrdtool
Comment 1 Kajetan 2022-07-14 11:11:57 UTC
Just stumbled upon the same issue while trying to install firefox.
I have exactly the same error log, so it might be affecting more people.
Comment 2 Kajetan 2022-07-14 11:43:15 UTC
I'd love to help to debug this, but I'm new to FreeBSD and Ports system.
Anyways this might be useful:

$ make check-plist
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info/PKG-INFO
Error: Orphaned: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info/SOURCES.txt
Error: Orphaned: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info/dependency_links.txt
Error: Orphaned: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info/top_level.txt
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info
===> Error: Plist issues found.
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/rrdtool
Comment 3 Sigi 2022-07-17 19:06:59 UTC
Ok,

since i have nonly python3.9 as executable, i modified the Makefile to direct to the correct version.

PYTHON_CONFIGURE_ENABLE=python
PYTHON_USES=            python39
PYTHON_USE=             python=flavors,optsuffix

As workaround ok. I do not found any hints how freebsd python sets (links) /usr/local/bin/python to the default version or if i have to do this manually...
Comment 4 Jekyll Chen 2022-08-10 11:28:41 UTC
Disabling "Build PYTHON bindings" with make config gets rid of this issue.
Please confirm.
Comment 5 Tatsuki Makino 2022-09-29 23:54:48 UTC
This cannot be reproduced after pkg delete -f py39-setuptools .
So, as a workaround, modify it to depend on py??-setuptools and rewrite pkg-plist.
Comment 6 Tatsuki Makino 2022-09-30 01:13:12 UTC
This is a memorandum of understanding for me :)

The difference in def finalize_options
between site-packages/setuptools/command/install_egg_info.py
and distutils/command/install_egg_info.py
(and site-packages/setuptools/_distutils/command/install_egg_info.py)
is what makes this different.
Comment 7 Tatsuki Makino 2022-12-07 11:01:05 UTC
Created attachment 238596 [details]
patch for databases/rrdtool

This is a patch that fixes all the areas related to python and all the areas of concern in pkg-plist.
lib/perllocal.pod is a file that conflicts with something else, so I modified it so that it is not installed.
I think this is correct that manpage will or will not be installed :)
Comment 8 Tatsuki Makino 2022-12-07 11:07:04 UTC
Created attachment 238597 [details]
patch for databases/rrdtool

There were files that were not included due to my mishandling of git :)
Comment 9 Graham Perrin freebsd_committer freebsd_triage 2023-01-03 02:24:50 UTC
Triage: 

* open, belated

* assign to eduardo@ (maintainer since 2022-08-03, 
  <https://cgit.freebsd.org/ports/commit/databases/rrdtool/Makefile?id=312867a8ea4359ee894678bcdd97c2d3d0c43520>
Comment 10 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-03 09:19:15 UTC
(In reply to Tatsuki Makino from comment #8)

It builds fine on {140,131}amd64 and 124{amd64,i386}, 
also I didn't receive any email from build servers about failure on this port.

Tested with ports@54df541db5b

Could you test it again?
Comment 11 Tatsuki Makino 2023-01-03 17:18:59 UTC
(In reply to Nuno Teixeira from comment #10)

To reproduce this problem, devel/py-setuptools must be installed and the PYTHON option of databases/rrdtool must be enabled.
Comment 12 Tatsuki Makino 2023-01-04 04:33:13 UTC
(In reply to Tatsuki Makino from comment #11)

For poudriere to reproduce this problem, /usr/local/etc/poudriere.d/make.conf must contain the following:

databases_rrdtool_SET+=	PYTHON
.if !empty(.CURDIR:tA:M/usr/ports/databases/rrdtool)
FETCH_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}setuptools>=63.1.0:devel/py-setuptools@${PY_FLAVOR}
.endif
Comment 13 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-04 08:29:41 UTC
(In reply to Tatsuki Makino from comment #12)

Ok, I can reproduce it in poudriere with:

BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR}

---
===> The following configuration options are available for rrdtool-1.8.0_1:
     DEJAVU=on: Use DejaVu fonts (requires X11)
     DOCS=on: Build and/or install documentation
     EXAMPLES=on: Build and/or install examples
     GRAPH=on: Enable the rrdtool graph command (needs cairo)
     LOCKTIMEOUT=off: Enable the patch for lock timeout
     MMAP=on: Use mmap in rrd_update
     NLS=on: Native Language Support
     PERL=on: Build PERL module
     PYTHON=on: Build PYTHON bindings
     RUBY=off: Build RUBY bindings
(...)

====> Running Q/A tests (stage-qa)
Error: /usr/local/bin/rrdcached is linked to /usr/local/lib/libharfbuzz.so.0 from print/harfbuzz but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libharfbuzz.so:print/harfbuzz
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info/PKG-INFO
Error: Orphaned: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info/SOURCES.txt
Error: Orphaned: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info/dependency_links.txt
Error: Orphaned: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info/top_level.txt
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: %%PYTHON_SITELIBDIR%%/rrdtool-0.1.10-py%%PYTHON_VER%%.egg-info
===> Error: Plist issues found.
---
Comment 14 Tatsuki Makino 2023-01-04 09:01:20 UTC
(In reply to Nuno Teixeira from comment #13)

This relates to the following error

> ====> Running Q/A tests (stage-qa)
> Error: /usr/local/bin/rrdcached is linked to /usr/local/lib/libharfbuzz.so.0 from print/harfbuzz but it is not declared as a dependency
> Warning: you need LIB_DEPENDS+=libharfbuzz.so:print/harfbuzz

rrdtool depends on pango by USE_GNOME.
(GRAPH_USE= GNOME=cairo,pango)
Pango installs /usr/local/libdata/pkgconfig/pango.pc, which is where Requires harfbuzz is written.
(Requires: gobject-2.0 >=  2.62, harfbuzz >=  2.6.0)
It would seem to link to libharfbuzz by that.

The following 2 lines are paired, although the writing style creates a funny atmosphere.

USE_GNOME= pango
LIB_DEPENDS= libharfbuzz.so:print/harfbuzz

Since USE_GNOME=pango changes with the option GRAPH, the following line should be added.

GRAPH_LIB_DEPENDS= libharfbuzz.so:print/harfbuzz
Comment 15 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-04 09:07:24 UTC
(In reply to Tatsuki Makino from comment #14)

I noticed that when I run test with only GRAPH option enabled.

I will commit your patch as is with GRAPH lib depends on harfbuzz.

Other thing, this port wasn't flavourized because of:

- PYTHON_USE= flavors,optsuffix
+ PYTHON_USE= PYTHON=flavors,optsuffix

I will test all flavours too.
Comment 16 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-04 09:25:40 UTC
Commit message:

---
- add py-setuptools build dependency to PYTHON option (Build PYTHON bindings)
- add harfbuzz lib depends to GRAPH option (Enable the rrdtool graph command)
- use configure helper for EXAMPLES option
---

Any change/add to commit message?
Comment 17 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-04 09:40:47 UTC
(In reply to Nuno Teixeira from comment #16)
(...)

 - define LICENSE_FILE

MFH: 2023Q1 (build fix)
Comment 18 commit-hook freebsd_committer freebsd_triage 2023-01-04 20:36:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=64bcfa1862df7eb01a7ac7cbc6a841b7b038cdc5

commit 64bcfa1862df7eb01a7ac7cbc6a841b7b038cdc5
Author:     Tatsuki Makino <tatsuki_makino@hotmail.com>
AuthorDate: 2023-01-04 20:28:58 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2023-01-04 20:35:48 +0000

    databases/rrdtool: Fix build with PYTHON option on

    - Add py-setuptools build dependency to PYTHON option (Build PYTHON bindings)
      to fix build when this option is used
    - Add harfbuzz lib depends to GRAPH option (Enable the rrdtool graph command)
    - Use configure helper for EXAMPLES option
    - Define LICENSE_FILE

    PR:             265203
    Reported by:    Sigi <freebsd-bt@beatsnet.com>
    MFH:            2023Q1 (build fixes)

 databases/rrdtool/Makefile                         |  17 ++--
 .../rrdtool/files/patch-bindings_Makefile.in (new) |  16 +++
 .../files/patch-bindings_python_setup.py (gone)    |  14 ---
 databases/rrdtool/files/patch-configure            |  16 +--
 .../rrdtool/files/patch-doc-Makefile.in (gone)     |  14 ---
 ...ples-Makefile.in => patch-examples_Makefile.in} |   4 +-
 .../files/patch-examples_rrdcached_Makefile.in     |   4 +-
 databases/rrdtool/pkg-plist                        | 109 +--------------------
 8 files changed, 35 insertions(+), 159 deletions(-)
Comment 19 Tatsuki Makino 2023-01-04 23:55:05 UTC
There seems to be no problem.
Thank you very much.
Comment 20 commit-hook freebsd_committer freebsd_triage 2023-01-05 09:07:04 UTC
A commit in branch 2023Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=20accdbf1f176aa7afeedf3c5c25791702bb843e

commit 20accdbf1f176aa7afeedf3c5c25791702bb843e
Author:     Tatsuki Makino <tatsuki_makino@hotmail.com>
AuthorDate: 2023-01-04 20:28:58 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2023-01-05 08:23:38 +0000

    databases/rrdtool: Fix build with PYTHON option on

    - Add py-setuptools build dependency to PYTHON option (Build PYTHON bindings)
      to fix build when this option is used
    - Add harfbuzz lib depends to GRAPH option (Enable the rrdtool graph command)
    - Use configure helper for EXAMPLES option
    - Define LICENSE_FILE

    PR:             265203
    Reported by:    Sigi <freebsd-bt@beatsnet.com>
    MFH:            2023Q1 (build fixes)

    (cherry picked from commit 64bcfa1862df7eb01a7ac7cbc6a841b7b038cdc5)

 databases/rrdtool/Makefile                         |  17 ++--
 .../rrdtool/files/patch-bindings_Makefile.in (new) |  16 +++
 .../files/patch-bindings_python_setup.py (gone)    |  14 ---
 databases/rrdtool/files/patch-configure            |  16 +--
 .../rrdtool/files/patch-doc-Makefile.in (gone)     |  14 ---
 ...ples-Makefile.in => patch-examples_Makefile.in} |   4 +-
 .../files/patch-examples_rrdcached_Makefile.in     |   4 +-
 databases/rrdtool/pkg-plist                        | 109 +--------------------
 8 files changed, 35 insertions(+), 159 deletions(-)
Comment 21 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-05 09:13:11 UTC
Nice work on this port.

Committed, thanks!