Bug 260960 - lang/guile1: lang/guile2: support concurrent installations
Summary: lang/guile1: lang/guile2: support concurrent installations
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: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-05 18:29 UTC by Martin Neubauer
Modified: 2023-08-09 14:00 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (bofh)
m.ne: maintainer-feedback? (bofh)


Attachments
patch for guile1 and guile2 to coexist (7.30 KB, patch)
2022-01-05 18:29 UTC, Martin Neubauer
no flags Details | Diff
followup fix (2.10 KB, patch)
2023-08-01 17:44 UTC, Andrew "RhodiumToad" Gierth
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Neubauer 2022-01-05 18:29:01 UTC
Created attachment 230741 [details]
patch for guile1 and guile2 to coexist

There was some discussion[1] recently about the inability to install the lilypond package together with other software requiring guile2. I used this occasion to explore the work needed to enable concurrent installations. Attached is the result of my efforts so far.

Some notes:
- I haven't done anything with lang/guile yet, but there might be no conflict any longer with the patch applied.
- It might be preferable to only use the first part of the version number as program suffix. I just went for the first two because those were used already for the pkg-plist substitutions.
- The treatment of guile.m4 admittedly is a little hamfisted, but I wanted to have a demonstrable patch without spending much time digging through the build system.
- Before submitting there might be some work needed for the various consumers to pick the correct version if another is present as well. I already included changes for print/lilypond{,-devel}.

[1]: https://lists.gnu.org/archive/html/lilypond-user/2021-12/msg00277.html
Comment 1 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-02-01 18:51:57 UTC
Currently we also have lang/guile so I will need some times to check this. This might break lots of stuffs.
Comment 2 Martin Neubauer 2022-02-10 04:43:16 UTC
(In reply to Muhammad Moinur Rahman from comment #1)
Thanks for looking into it. If you need help with checking/updating the dependent ports feel free to let me know. I should be able to put some time into this task. My main reason for only changing the ports present in the submitted patch was to ensure the approach chosen is acceptable before putting too much effort in. That said, even though I'd prefer having this done rather sooner than later, objectively it's not particularly urgent. After all there never was support for multiple installed guile versions (although, arguably, there probably should have been.)
Comment 3 Andrew "RhodiumToad" Gierth 2023-05-19 13:47:53 UTC
I have almost completed a patch to allow multiple guile versions to coexist, and allow flavorization of guile library ports (such as guile-lib, guile-cairo).

It needs more testing, and ideally guile1 needs to be incorporated too, but I can put it up sometime soon if there is interest?
Comment 4 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2023-05-20 09:42:11 UTC
(In reply to andrew from comment #3)
Currently I am busy with fixing builds for the port infrastructure with llvm15 and do not have too much time to improve things. But if you can submit a patch which is tested on at least one Tier-1 supported architecture and supported versions I will take a look into it.
Comment 5 Andrew "RhodiumToad" Gierth 2023-05-21 20:32:31 UTC
Testing is still ongoing (though the major functionality is working); I have put up the work so far at:

https://reviews.freebsd.org/D40194
Comment 6 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2023-05-22 08:08:42 UTC
(In reply to andrew from comment #5)
Currently I am mostly AFK until the of the next week. Will look into it once I come back home.
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2023-07-29 12:03:22 UTC
Will commit this one with my next batch.
bofh has approved via IRC.
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-07-30 23:00:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=94218d3a91189c7afea956e8905d5e5ecf879a2c

commit 94218d3a91189c7afea956e8905d5e5ecf879a2c
Author:     Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
AuthorDate: 2023-07-28 12:58:44 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-07-30 22:59:04 +0000

    Mk/Uses: Add guile.mk

    This patch adds USES=guile[:options], a framework to permit the
    concurrent installation of different guile versions, allowing
    ports to specify which guile they need.

    lang/guile is now a meta-port, installing the default guile version;
    guile 3 is now shipped in lang/guile3.

    A new port lang/guile-aclocal holds the guile.m4 file from guile3
    to permit ports written against guile1 or guile2 to avoid conflicts.

    PR:             260960
    Reported by:    Martin Neubauer <m.ne@gmx.net>
    Approved by:    bofh
    Differential Revision:  https://reviews.freebsd.org/D40194

 CHANGES                                            |   9 +
 MOVED                                              |   1 +
 Mk/Uses/guile.mk (new)                             | 263 +++++++
 Mk/bsd.default-versions.mk                         |   4 +-
 lang/Makefile                                      |   4 +-
 lang/guile-aclocal/Makefile (new)                  |  18 +
 lang/guile/Makefile                                | 100 +--
 .../files/extra-patch-bootstrap_Makefile.in (gone) |  11 -
 lang/guile/files/patch-doc-ref-guile.texi (gone)   |  10 -
 lang/guile/pkg-descr                               |   9 +-
 lang/guile1/Makefile                               |  53 +-
 lang/guile1/files/patch-scripts_Makefile.am (new)  |  12 +
 lang/guile1/pkg-plist                              | 231 +++---
 lang/guile2/Makefile                               |  57 +-
 lang/guile2/files/patch-libguile_Makefile.in (new) |  20 +
 lang/guile2/files/patch-libguile_gen-scmconfig.c   |  13 +-
 lang/guile2/files/patch-libguile_pthread-threads.h |   4 +-
 lang/guile2/pkg-plist                              |  19 +-
 lang/guile3/Makefile (new)                         | 100 +++
 lang/{guile => guile3}/distinfo                    |   2 +-
 .../files/extra-patch-upstream-fixes.patch (new)   | 789 +++++++++++++++++++++
 lang/guile3/files/patch-configure (new)            |  18 +
 lang/guile3/files/patch-libguile_Makefile.in (new) |  20 +
 .../files/patch-libguile_gen-scmconfig.c (new)     |  13 +
 lang/guile3/pkg-descr (new)                        |   6 +
 lang/{guile => guile3}/pkg-plist                   |  30 +-
 26 files changed, 1544 insertions(+), 272 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2023-07-30 23:01:06 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7edcfaeb079e3285b299ef619ab9d09d46c447a2

commit 7edcfaeb079e3285b299ef619ab9d09d46c447a2
Author:     Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
AuthorDate: 2023-07-28 13:23:52 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-07-30 22:59:04 +0000

    */*: adapt to new guile framework

     - change all ports using guile to USES=guile
     - flavorize guile-lib, guile-cairo, slib-guile

    PR:             260960
    Reported by:    Martin Neubauer <m.ne@gmx.net>
    Approved by:    bofh
    Differential Revision:  https://reviews.freebsd.org/D40194

 audio/denemo/Makefile                              |  11 +-
 audio/zplugins-lv2/Makefile                        |   3 +-
 audio/zrythm/Makefile                              |   6 +-
 cad/geda/Makefile                                  |  12 +-
 cad/lepton-eda/Makefile                            |   9 +-
 devel/autogen/Makefile                             |   6 +-
 devel/g-wrap/Makefile                              |  19 +-
 devel/g-wrap/pkg-plist                             |  38 +-
 devel/gdb/Makefile                                 |  11 +-
 devel/guile-lib/Makefile                           |  22 +-
 devel/guile-lib/files/patch-configure (new)        |  11 +
 devel/guile-lib/pkg-plist                          | 122 +++---
 devel/libmatheval/Makefile                         |   9 +-
 devel/libruin/Makefile                             |  10 +-
 editors/texmacs/Makefile                           |  10 +-
 finance/gnucash/Makefile                           |   7 +-
 games/aisleriot/Makefile                           |  14 +-
 games/fmars/Makefile                               |   6 +-
 games/gnubik/Makefile                              |   8 +-
 games/gnurobots/Makefile                           |   6 +-
 games/gnurobots/files/patch-configure (new)        |  11 +
 games/gnurobots/files/patch-configure.ac (gone)    |  11 -
 games/trackballs/Makefile                          |   6 +-
 graphics/graphviz/Makefile                         |   3 +-
 graphics/guile-cairo/Makefile                      |  45 ++-
 graphics/guile-cairo/distinfo                      |   6 +-
 .../files/extra-patch-upstream-fixes.patch (new)   | 439 +++++++++++++++++++++
 .../files/patch-guile-cairo.pc.in (new)            |   9 +
 graphics/guile-cairo/pkg-plist                     |  27 +-
 irc/weechat/Makefile                               |   3 +-
 irc/weechat/pkg-plist                              |   1 +
 lang/Makefile                                      |   2 -
 lang/mdk/Makefile                                  |   5 +-
 lang/slib-guile/Makefile                           |  17 +-
 lang/slib-guile/files/pkg-deinstall.in             |   4 +-
 lang/slib-guile/files/pkg-install.in               |   4 +-
 lang/slib-guile1/Makefile (gone)                   |  20 -
 lang/slib-guile1/files/pkg-deinstall.in (gone)     |   8 -
 lang/slib-guile1/files/pkg-install.in (gone)       |   8 -
 lang/slib-guile1/pkg-descr (gone)                  |   4 -
 lang/slib-guile2/Makefile (gone)                   |  20 -
 lang/slib-guile2/files/pkg-deinstall.in (gone)     |   8 -
 lang/slib-guile2/files/pkg-install.in (gone)       |   8 -
 lang/slib-guile2/pkg-descr (gone)                  |   4 -
 mail/anubis/Makefile                               |   6 +-
 mail/anubis/files/patch-src_Makefile.am            |   9 +
 mail/mailutils/Makefile                            |   4 +-
 mail/mu/Makefile                                   |   4 +-
 math/drgeo/Makefile                                |   8 +-
 math/drgeo/files/patch-geo_Makefile.in (new)       |  12 +
 math/nlopt/Makefile                                |   7 +-
 net-im/freetalk/Makefile                           |   9 +-
 net/dico/Makefile                                  |   6 +-
 net/gnu-radius/Makefile                            |   4 +-
 net/serveez/Makefile                               |   6 +-
 print/lilypond-devel/Makefile                      |   6 +-
 print/lilypond/Makefile                            |  13 +-
 science/harminv/Makefile                           |   4 +-
 science/libctl/Makefile                            |   7 +-
 science/mpb/Makefile                               |   6 +-
 sysutils/mcron/Makefile                            |   9 +-
 textproc/scss/Makefile                             |   2 +-
 textproc/sdom/Makefile                             |   7 +-
 www/elinks/Makefile                                |   3 +-
 www/guile-www/Makefile                             |   4 +-
 x11-toolkits/guile-gnome-platform/Makefile         |  22 +-
 x11-toolkits/guile-gnome-platform/pkg-plist        |   2 +-
 x11/xbindkeys/Makefile                             |   7 +-
 x11/xbindkeys/distinfo                             |   5 +-
 69 files changed, 804 insertions(+), 381 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-07-30 23:01:07 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=08691f29f5c8d5040ccdda864e174ef1db529ca3

commit 08691f29f5c8d5040ccdda864e174ef1db529ca3
Author:     Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
AuthorDate: 2023-07-28 12:55:15 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-07-30 22:59:04 +0000

    Mk/Uses/pkgconfig.mk: add support for PKGCONFIG_PATHS

    USES=pkgconfig now allows you to specify PKGCONFIG_PATHS to allow
    management of PKG_CONFIG_PATHS in a cooperative fashion.

    PR:             260960
    Reported by:    Martin Neubauer <m.ne@gmx.net>
    Approved by:    bofh
    Differential Revision:  https://reviews.freebsd.org/D40194

 Mk/Uses/pkgconfig.mk | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Comment 11 Andrew "RhodiumToad" Gierth 2023-08-01 17:44:38 UTC
Created attachment 243778 [details]
followup fix

followup patch:

    lang/guile*: prefer long over long long for scm_off_t
    
    When long and long long are both the same size as off_t, prefer long
    for scm_off_t even though it should make no difference, because llvm16
    seems to consider them distinct types as arguments in function pointer
    types. Also it seems cleaner.

fixes mailutils with GUILE=on on llvm16 on amd64 (function pointer type error)
Comment 12 commit-hook freebsd_committer freebsd_triage 2023-08-09 13:05:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=85fe592a0ce9c0d22d19696b0cc915f55f6203d8

commit 85fe592a0ce9c0d22d19696b0cc915f55f6203d8
Author:     Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
AuthorDate: 2023-08-06 22:00:30 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-08-09 13:01:14 +0000

    lang/guile[23]: prefer long over long long for scm_off_t

    When long and long long are both the same size as off_t, prefer long
    for scm_off_t even though it should make no difference, because llvm16
    seems to consider them distinct types as arguments in function pointer
    types. Also it seems cleaner.

    fixes mailutils with GUILE=on on llvm16 on amd64.

    Fixes:          94218d3a91189c7afea956e8905d5e5ecf879a2c
    PR:             260960

 lang/guile2/Makefile                             | 2 +-
 lang/guile2/files/patch-libguile_gen-scmconfig.c | 2 +-
 lang/guile3/Makefile                             | 1 +
 lang/guile3/files/patch-libguile_gen-scmconfig.c | 6 +++---
 4 files changed, 6 insertions(+), 5 deletions(-)
Comment 13 Robert Clausecker freebsd_committer freebsd_triage 2023-08-09 14:00:23 UTC
Thank you for your contribution.