Bug 282756 - devel/root: Disable runtime_cxxmodules to avoid modulemap issues
Summary: devel/root: Disable runtime_cxxmodules to avoid modulemap issues
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:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-14 12:22 UTC by Erik Jensen
Modified: 2024-11-19 22:06 UTC (History)
2 users (show)

See Also:
eduardo: merge-quarterly+


Attachments
Port patch (42.20 KB, patch)
2024-11-14 12:22 UTC, Erik Jensen
erik: maintainer-approval+
Details | Diff
Additional fix of build on 15amd64 (1.40 KB, patch)
2024-11-18 17:49 UTC, Erik Jensen
erik: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Jensen 2024-11-14 12:22:47 UTC
Created attachment 255168 [details]
Port patch

In the attached diff, I have disabled the cmake flag 'runtime_cxxmodules' and 
accommodated the rest of the port files accordingly.

A recent change in LLVM/Clang modulemap handling has caused ROOT (which builds
its own patched version of LLVM/Clang for JIT C/C++ compilation, e.g. from the
ROOT terminal) in the upstream source code to hack modulemap definitions on a
case-by-case OS release-dependent basis on macOS, which also compiles ROOT with
a LLVM/Clang compiler.
Once a more robust solution has been found in the upstream code, we can revert
to enabling 'runtime_cxxmodules' in the port.
For now, my attempts at continually patching ROOT for FreeBSD 13.3+, 14.0+ and
15.0 have proven too error-prone, and a package built on 14.0, for example, and
distributed to both 14.0 and 14.1 would otherwise only work on 14.0 in the best
of cases.

I have tested building of the port on 14.1-amd64 with the default options 
enabled and with each individual port option enabled/disabled.
Comment 1 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-15 20:36:43 UTC
Hello Erik,

testport OK on 14.1 (amd64,i366) and 13.4 (amd64).
Fails on main-n273547-8eaeaf5c4678 amd64 so I will add BROKEN_FreeBSD_15.

Did you find better results if a specific compiler is choosed (USES=llvm:ver) related to avoid patching for several FreeBSD releases?

Cheers
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-11-16 08:33:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=867e49b82ad9850646f1c8114317ef50d38a1d2b

commit 867e49b82ad9850646f1c8114317ef50d38a1d2b
Author:     Erik Jensen <erik@tenku.dk>
AuthorDate: 2024-11-16 08:30:28 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-11-16 08:32:24 +0000

    devel/root: Disable runtime_cxxmodules to avoid modulemap issues

    A recent change in LLVM/Clang modulemap handling has caused ROOT (which builds
    its own patched version of LLVM/Clang for JIT C/C++ compilation, e.g. from the
    ROOT terminal) in the upstream source code to hack modulemap definitions on a
    case-by-case OS release-dependent basis on macOS, which also compiles ROOT with
    a LLVM/Clang compiler.
    Once a more robust solution has been found in the upstream code, we can revert
    to enabling 'runtime_cxxmodules' in the port.
    For now, my attempts at continually patching ROOT for FreeBSD 13.3+, 14.0+ and
    15.0 have proven too error-prone, and a package built on 14.0, for example, and
    distributed to both 14.0 and 14.1 would otherwise only work on 14.0 in the best
    of cases.

    PR:             282756

 devel/root/Makefile                                |  19 +-
 .../patch-core_clingutils_CMakeLists.txt (gone)    |  12 -
 ...atch-core_clingutils_src_TClingUtils.cxx (gone) |  18 -
 ...eter_cling_lib_Interpreter_CIFactory.cpp (gone) |  28 --
 devel/root/pkg-plist                               | 453 +++++++++++++++------
 5 files changed, 348 insertions(+), 182 deletions(-)
Comment 3 Erik Jensen 2024-11-18 12:25:08 UTC
Hi Nuno,

I did try with different compilers, including gcc, and from that I learned that the
issue is always related to the system modulemap files distributed with the individual
OS version/release.
This should in principle be fixable, as you suggest, by ensuring that the specifically
requested compiler and its modulemap files are used, but I did not have any success in
pursuing this.

For now, I think the answer is to wait for the upstream to invest some more resources
in finding a more robust solution (which they are bound to do at some point).

Could you share with me a build log for 15-Current?
I'd be interested in seeing how build failure differs from 13.4 and 14.1

Cheers from
Erik
Comment 4 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-18 12:45:20 UTC
(In reply to Erik Jensen from comment #3)

All logs from amd64 at https://people.freebsd.org/~eduardo/logs/root-6.32.04_2/

I have my rpi4 online again, I will test it in there too and share links.

Cheers
Comment 5 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-18 12:57:39 UTC
(In reply to Nuno Teixeira from comment #4)

(...)

http://freebsdrpi4.hopto.org/build.html?mastername=15aarch64-main&build=2024-11-18_12h54m09s

141 and 134 aarch64 builds will follow if rpi4 fan can live more days :)
Comment 6 Erik Jensen 2024-11-18 17:49:45 UTC
Created attachment 255284 [details]
Additional fix of build on 15amd64

I am fairly confident the attached patch will fix building on 15amd64.

Looking forward to seeing the result on aarch64 - hope the little rpi hangs in there!

Cheers from
Erik
Comment 7 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-19 08:42:18 UTC
(In reply to Erik Jensen from comment #6)

The following diff

```diff
+#ifdef __FreeBSD__
-+// atexit-like commands need 'throw()' specifier on FreeBSD 15 aarch64
-+#if defined(__aarch64__) && __FreeBSD_cc_version >= 1500000
++// atexit-like commands need 'throw()' specifier on FreeBSD 15
++#if __FreeBSD_cc_version >= 1500000
```

explains why it (portrevision 2) builded fine on main aarch64.

I will let testports finish and then commit.

Cheers
Comment 8 Erik Jensen 2024-11-19 11:14:45 UTC
Nice to see the port becoming functional again!

Maybe merge-quarterly, so the pkg build servers can be liberated a bit?
(Cf. https://portsfallout.com/port/33584)
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-11-19 21:22:13 UTC
A commit in branch main references this bug:

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

commit 7cfcd90ff06a60593b5b8498af3f555aeeb651cb
Author:     Erik Jensen <erik@tenku.dk>
AuthorDate: 2024-11-19 21:18:29 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-11-19 21:21:06 +0000

    devel/root: Unbreak FreeBSD 15

    PR:             282756
    MFH:            2024Q4

 devel/root/Makefile                                                   | 4 +---
 .../files/patch-interpreter_cling_lib_Interpreter_Interpreter.cpp     | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2024-11-19 22:02:19 UTC
A commit in branch 2024Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1704cd381b18c93c101085e1dee2a66222948405

commit 1704cd381b18c93c101085e1dee2a66222948405
Author:     Erik Jensen <erik@tenku.dk>
AuthorDate: 2024-11-19 21:18:29 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-11-19 21:23:11 +0000

    devel/root: Unbreak FreeBSD 15

    PR:             282756
    MFH:            2024Q4

    (cherry picked from commit 7cfcd90ff06a60593b5b8498af3f555aeeb651cb)

 devel/root/Makefile                                                   | 4 +---
 .../files/patch-interpreter_cling_lib_Interpreter_Interpreter.cpp     | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2024-11-19 22:02:20 UTC
A commit in branch 2024Q4 references this bug:

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

commit d145ae7b5e34bb259b3027d5863dc69e749ab403
Author:     Erik Jensen <erik@tenku.dk>
AuthorDate: 2024-11-16 08:30:28 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-11-19 21:22:34 +0000

    devel/root: Disable runtime_cxxmodules to avoid modulemap issues

    A recent change in LLVM/Clang modulemap handling has caused ROOT (which builds
    its own patched version of LLVM/Clang for JIT C/C++ compilation, e.g. from the
    ROOT terminal) in the upstream source code to hack modulemap definitions on a
    case-by-case OS release-dependent basis on macOS, which also compiles ROOT with
    a LLVM/Clang compiler.
    Once a more robust solution has been found in the upstream code, we can revert
    to enabling 'runtime_cxxmodules' in the port.
    For now, my attempts at continually patching ROOT for FreeBSD 13.3+, 14.0+ and
    15.0 have proven too error-prone, and a package built on 14.0, for example, and
    distributed to both 14.0 and 14.1 would otherwise only work on 14.0 in the best
    of cases.

    PR:             282756

    (cherry picked from commit 867e49b82ad9850646f1c8114317ef50d38a1d2b)

 devel/root/Makefile                                |  19 +-
 .../patch-core_clingutils_CMakeLists.txt (gone)    |  12 -
 ...atch-core_clingutils_src_TClingUtils.cxx (gone) |  18 -
 ...eter_cling_lib_Interpreter_CIFactory.cpp (gone) |  28 --
 devel/root/pkg-plist                               | 453 +++++++++++++++------
 5 files changed, 348 insertions(+), 182 deletions(-)
Comment 12 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-19 22:06:31 UTC
Committed, thanks!