Bug 286433 - lang/dotnet8: allow building with newer clang
Summary: lang/dotnet8: allow building with newer clang
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: Gleb Popov
URL: https://git.amick.us/alpine/aports/sr...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-29 04:59 UTC by Mikhail T.
Modified: 2025-05-29 05:44 UTC (History)
0 users

See Also:
arrowd: maintainer-feedback+


Attachments
The patch (1.93 KB, patch)
2025-04-29 04:59 UTC, Mikhail T.
no flags Details | Diff
The patch (2.58 KB, patch)
2025-05-26 02:41 UTC, Mikhail T.
freebsd-2024: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail T. 2025-04-29 04:59:58 UTC
Created attachment 259983 [details]
The patch

The port currently limits llvm to version 17, which requires users seeking to us it to build/install the old compiler first.

The attached patch, gratefully copied from Alpine Linux, backports the #ifdefs already found in newer dotent (such as 9) so that version 8 can also be built with newer compiler.
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2025-04-29 05:04:54 UTC
Can you please point me to an URL where you obtained this patch?
Comment 2 Gleb Popov freebsd_committer freebsd_triage 2025-04-29 18:05:44 UTC
The build now fails for me with

      CMake Error at /wrkdirs/usr/ports/lang/dotnet8/work/dotnet-8.0.6/src/runtime/artifacts/source-build/self/src/eng/native/configuretools.cmake:38 (message):
        Unable to find toolchain executable.  Name: 'link', Prefix: 'llvm-'
Comment 3 Mikhail T. 2025-04-29 18:22:48 UTC
(In reply to Gleb Popov from comment #2)
I tested on a recently-updated 13.5-STABLE with base clang-19.1.7 and llvm19-19.1.7_1...

Does this help any?
Comment 4 Gleb Popov freebsd_committer freebsd_triage 2025-04-30 04:40:06 UTC
Nope, I get the same failure on 13.4. Are you building in Poudriere?
Comment 5 Mikhail T. 2025-04-30 08:36:12 UTC
> Are you building in Poudriere?

Nope. Can you compare the dependencies between dotnet9 and dotnet8?
Comment 6 Gleb Popov freebsd_committer freebsd_triage 2025-04-30 19:13:56 UTC
I don't have motivation to do that research. If you want to move this issue forward, please provide a patch that works in the Poudriere context.
Comment 7 Mikhail T. 2025-05-26 02:41:17 UTC
Created attachment 260716 [details]
The patch

A minor change to building environment was necessary in addition to patching the code itself.
Comment 8 Gleb Popov freebsd_committer freebsd_triage 2025-05-28 18:44:10 UTC
LGTM, but why did you remove llvm:noexport? It builds fine with base Clang on both FreeBSD 13 and 14.
Comment 9 Mikhail T. 2025-05-28 18:45:55 UTC
> LGTM, but why did you remove llvm:noexport?

Was trying to reduce differences with dotnet (10.x) and forgot to put it back.
Comment 10 commit-hook freebsd_committer freebsd_triage 2025-05-29 05:44:29 UTC
A commit in branch main references this bug:

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

commit eefbbb1a5809e1dc0b1e507bed7cfa96a79290c1
Author:     Mikhail T. <freebsd-2024@virtual-estates.net>
AuthorDate: 2025-05-28 06:47:29 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-05-29 05:43:29 +0000

    lang/dotnet8: Relax LLVM requirement

    PR:             286433

 lang/dotnet8/Makefile                  |  7 ++++---
 lang/dotnet8/files/patch-clang19 (new) | 31 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 3 deletions(-)
Comment 11 Gleb Popov freebsd_committer freebsd_triage 2025-05-29 05:44:49 UTC
Thank you for the patch.