Bug 256893 - editors/emacs-devel: Improve settings about NATIVECOMP option
Summary: editors/emacs-devel: Improve settings about NATIVECOMP option
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: emacs@FreeBSD.org (Nobody)
URL: https://reviews.freebsd.org/D31011
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-29 18:58 UTC by Yasuhiro Kimura
Modified: 2021-09-07 02:48 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (emacs)


Attachments
Patch file (1.79 KB, patch)
2021-06-29 18:58 UTC, Yasuhiro Kimura
no flags Details | Diff
Updated patch file (2.08 KB, patch)
2021-08-26 10:18 UTC, Yasuhiro Kimura
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yasuhiro Kimura freebsd_committer freebsd_triage 2021-06-29 18:58:05 UTC
Created attachment 226120 [details]
Patch file

Improve settings about NATIVECOMP option by replacing the combination of NATIVECOMP_LIB_DEPENDS, NATIVECOMP_CFLAGS and NATIVECOMP_LDFLAGS with NATIVECOMP_USE.

Currently it only means lang/gcc11 is used instead of lang/gcc11-devel and there isn't much difference. But when newer versions of GCC are released in the future, it will bring following benefits.

* Multiple versions of GCC can be used to build this port with NATIVECOMP option enabled.
* If default version of GCC is switched to 11 or later, or changed by adding "DEFAULT_VERSIONS+=gcc=11", "DEFAULT_VERSIONS+=gcc=12", ... in make.conf, then default one can be used for NATIVECOMP option. It means you need not build and install non-default one to build this port with NATIVECOMP option enabled.
Comment 1 Joseph Mingrone freebsd_committer freebsd_triage 2021-06-30 13:18:21 UTC
(In reply to Yasuhiro Kimura from comment #0)

Thanks for submitting.

> Improve settings about NATIVECOMP option by replacing the combination of NATIVECOMP_LIB_DEPENDS, NATIVECOMP_CFLAGS and NATIVECOMP_LDFLAGS with NATIVECOMP_USE.

This has a side-effect that emacs will also be built with GCC.  We would prefer to continue to build emacs with the default compiler.

It makes sense not to force a dependency on gcc1-devel though.  When the NATIVECOMP knob was first added, only gcc11-devel supported libgccjit.  We will see if bsd.gcc.mk can be modified, so that only a LIB_DEPENDS on an appropriate GCC version can be added.
Comment 2 Joseph Mingrone freebsd_committer freebsd_triage 2021-06-30 13:18:58 UTC
We'll keep this report open until we have a solution.
Comment 3 Yasuhiro Kimura freebsd_committer freebsd_triage 2021-08-26 10:18:22 UTC
Created attachment 227445 [details]
Updated patch file

Use `make -V _GCC_PORT USE_GCC=11+` to determine which version of GCC to be used as dependency for libgccjit. This command returns default version of GCC if it is 11 or newer and 11 otherwise. So if default version of GCC is switched to 11 or later in the future, or user explicitly changed it to 11, 12, ..., then he can build this port with NATIVCOMP option enabled without install non-default version of GCC.
Comment 4 Ashish SHUKLA freebsd_committer freebsd_triage 2021-08-28 12:33:02 UTC
(In reply to Yasuhiro Kimura from comment #3)

Hi,

Our apologies for not letting you know, we have a solution in works to resolve this problem: https://reviews.freebsd.org/D31011 (waiting to be reviewed).

If you have any feedback about this, then please share.

Thank you!
Comment 5 Joseph Mingrone freebsd_committer freebsd_triage 2021-09-05 21:26:01 UTC
I beginning to believe that the patch here would be better than what's proposed in https://reviews.freebsd.org/D31011.  I left a comment on the review stating this.
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-09-07 02:47:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=49a60393fc80385a88038b4cf34cfb88bb5992b0

commit 49a60393fc80385a88038b4cf34cfb88bb5992b0
Author:     Yasuhiro Kimura <yasu@utahime.org>
AuthorDate: 2021-09-06 22:16:08 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2021-09-07 02:44:59 +0000

    editors/emacs-devel: Improve gcc port selection for NATIVECOMP

    PR:             256893
    Differential Revision:  https://reviews.freebsd.org/D31011

 editors/emacs-devel/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Comment 7 Joseph Mingrone freebsd_committer freebsd_triage 2021-09-07 02:48:21 UTC
Committed with minor modifications. Thanks for submitting and sorry for the delay.