Bug 200829

Summary: [PATCH] devel/avr-gdb: Add PYTHON option to make dependency explicit
Product: Ports & Packages Reporter: Craig Leres <leres>
Component: Individual Port(s)Assignee: Joerg Wunsch <joerg>
Status: Open ---    
Severity: Affects Only Me CC: w.schwarzenfeld
Priority: --- Keywords: patch
Version: LatestFlags: bugzilla: maintainer-feedback? (joerg)
Hardware: Any   
OS: Any   
Description Flags
Patchset for devel/avr-gdb
poudriere build log
poudriere build log (9.3-RELEASE)
poudriere build log (10.1-RELEASE)
poudriere build log (10.1-RELEASE)
revised patch
poudriere build log (10.3-RELEASE)
revised patch
poudriere build log (10.3-RELEASE)
revised patch leres: maintainer-approval?

Description Craig Leres freebsd_committer 2015-06-12 22:48:38 UTC
Created attachment 157692 [details]
Patchset for devel/avr-gdb

The avr-gdb package enables python support if it finds a python binary at configure time. This means an avr-gdb package built on a system with python will not run on a system that doesn't have python.

Make the dependency on python explicit by adding an option for it.
Comment 1 Craig Leres freebsd_committer 2015-06-12 22:51:49 UTC
Created attachment 157693 [details]
poudriere build log
Comment 2 Craig Leres freebsd_committer 2015-06-12 22:52:22 UTC
Created attachment 157694 [details]
poudriere build log (9.3-RELEASE)
Comment 3 Craig Leres freebsd_committer 2015-06-12 22:52:45 UTC
Created attachment 157695 [details]
poudriere build log (10.1-RELEASE)
Comment 4 Craig Leres freebsd_committer 2015-12-21 02:46:16 UTC
I was in the process of filing a new PR to fix this problem when I noticed that I already did so back in June.

Attached is an updated patch:

    - Make the dependency on python explicit by adding an option for it

    - Fix some portlint complaints
Comment 5 Craig Leres freebsd_committer 2015-12-21 02:47:23 UTC
Created attachment 164440 [details]
Comment 6 Craig Leres freebsd_committer 2015-12-21 02:49:03 UTC
Created attachment 164441 [details]
poudriere build log (10.1-RELEASE)
Comment 7 Craig Leres freebsd_committer 2016-09-17 23:39:43 UTC
Created attachment 174894 [details]
revised patch

This is still an issue.

Here's an updated patch that uses newer OPTIONS features. It also quiets some portlint complaints and eliminates pkg-plist (which should be removed).
Comment 8 Craig Leres freebsd_committer 2016-09-17 23:40:29 UTC
Created attachment 174895 [details]
poudriere build log (10.3-RELEASE)
Comment 9 Craig Leres freebsd_committer 2017-12-06 03:09:14 UTC
Created attachment 188573 [details]
revised patch

Here's the latest version of the patch:

 - Convert pkg-plist to use PLIST_FILES
 - Add PYTHON option to add USES=python:2.7

Note that my testing shows that gdb 7.3.1 does not build with python 3.

It might be better to default to PYTHON off since I believe that's what you get if you use poudriere to build the current devel/avr-gdb port (since python is not installed in this case and thus not auto-detected).
Comment 10 Craig Leres freebsd_committer 2017-12-06 03:09:57 UTC
Created attachment 188574 [details]
poudriere build log (10.3-RELEASE)
Comment 11 Walter Schwarzenfeld freebsd_triage 2018-03-04 08:44:58 UTC
Maintainer feedback, please!
Comment 12 Craig Leres freebsd_committer 2018-03-04 21:43:30 UTC
Here's some more info.

If I use poudriere to build/install avr-gdb (note -i) avr-gdb works normally:

    # poudriere testport -i -j 10lbl -p current-patched devel/avr-gdb
    @ avr-gdb --version
    GNU gdb (GDB) 7.3.1

While in the same poudriere jail: install python, uninstall avr-gdb, remove the work directory and rebuild/reinstall avr-gdb. Then uninstall python and avr-gdb fails to run:

    @ rm -rf /wrkdirs/usr/ports/devel/avr-gdb/work
    @ pkg delete -fy avr-gdb
    @ pkg install python27 python
    @ cd /usr/ports/devel/avr-gdb && make install
    @ pkg delete -fy python27 python
    @ avr-gdb --version
    Shared object "libpython2.7.so.1" not found, required by "avr-gdb"
Comment 13 Walter Schwarzenfeld freebsd_triage 2018-03-04 22:15:30 UTC
I got another error:
ibgdb.a(charset.o): In function `convert_between_encodings':
charset.c:(.text+0x2b8): undefined reference to `libiconv_open'
charset.c:(.text+0x360): undefined reference to `libiconv'
libgdb.a(charset.o): In function `cleanup_iconv':
charset.c:(.text+0x4f9): undefined reference to `libiconv_close'
libgdb.a(charset.o): In function `make_wchar_iterator':
charset.c:(.text+0x520): undefined reference to `libiconv_open'
libgdb.a(charset.o): In function `do_cleanup_iterator':
charset.c:(.text+0x5ad): undefined reference to `libiconv_close'
libgdb.a(charset.o): In function `wchar_iterate':
charset.c:(.text+0x64a): undefined reference to `libiconv'
libgdb.a(charset.o): In function `_initialize_charset':
charset.c:(.text+0x820): undefined reference to `libiconvlist'
libgdb.a(charset.o): In function `validate':
charset.c:(.text+0xd39): undefined reference to `libiconv_open'
charset.c:(.text+0xd47): undefined reference to `libiconv_close'
charset.c:(.text+0xd52): undefined libgdb.a(charset.o):r eIn fferunectnicoen ` toconvert_between_encodings '`:
(.text+charset.c:0(x.text+2b80): xundd60e)f: uindnefiend reed freerfeenrceen cteo  t`o libiconv_open`'

solved with added USES=iconv to the Makefile.
Comment 14 Walter Schwarzenfeld freebsd_triage 2019-08-28 09:51:03 UTC
Is this still relevant?
Comment 15 Craig Leres freebsd_committer 2019-08-28 16:28:01 UTC
(In reply to Walter Schwarzenfeld from comment #14)
I can no longer reproduce the issue shown in comment #12. But I think it's still worth adding a PYTHON option since there's currently no way to get python support if you want it. And the test I just ran built ok with python 3.7 (I use DEFAULT_VERSIONS=python3=3.7).

Getting rid of the trivial pkg-plist seems worth doing.

I'll attach a revised patch.
Comment 16 Craig Leres freebsd_committer 2019-08-28 16:31:21 UTC
Created attachment 206980 [details]
revised patch

Revised patch tested on 11.2-RELEASE-p14:

 - Add a PYTHON option
 - Convert trivial pkg-plist to use PLIST_FILES
Comment 17 Joerg Wunsch freebsd_committer 2019-08-29 20:22:23 UTC
The patch is fine with me, approved.