gentoo / dlang

[MIRROR] D programming language ebuild repository
https://gitweb.gentoo.org/repo/user/dlang.git
GNU General Public License v2.0
30 stars 25 forks source link

Add ldc2-1.30 #105

Closed the-horo closed 2 years ago

the-horo commented 2 years ago

A new version for ldc.

In the release article it says that:

All LLVM targets are enabled now (=> more targets for cross-compilation).

I am not sure how I can, if I should, translate this to dlang-compilers.eclass. Am I to take LLVM_TARGETS and convert that?

mleise commented 2 years ago

That's what I would try.

the-horo commented 2 years ago

And, for example, when llvm:13 doesn't support llvm_targets_ve but llvm:14 does, should I go with the more recent variant?

mleise commented 2 years ago

What happens if we support llvm:13? If you are worried about installing LDC2 on the NEC SX-Aurora TSUBASA and then lacking LLVM 14 support to compile anything, that's just a PCIe that can't boot operating systems.

the-horo commented 2 years ago

I meant how do I distinguish between what targets to include in dlang-compilers.eclass. Do I take the ones that also appear in /var/db/repos/gentoo/profiles/arch.list?

Another question, looking over llvm.org.eclass I can see ALL_LLVM_PRODUCTION_TARGETS and ALL_LLVM_EXPERIMENTAL_TARGETS. I imagine these are the 2 that I would want to convert, the production becoming arch and the experimental becoming ~arch. Is that correct?

the-horo commented 2 years ago

And the biggest thing. Isn't ldc's capacity to compile to a specific target tied to what LLVM has been built with? Wouldn't we have to dynamically extract that information instead of hard-coding it into dlang-compilers.eclass?

mleise commented 2 years ago

I meant how do I distinguish between what targets to include in dlang-compilers.eclass. Do I take the ones that also appear in /var/db/repos/gentoo/profiles/arch.list?

We put in dlang-compilers.eclass a copy of the KEYWORDS from the LDC ebuild. It's just for easier dependency calculation on the host system vs. discovering where the repositories are, finding D compiler packages and reading through their KEYWORDS list. It has nothing to do with the target architectures. So the KEYWORDS (and thus dlang-compilers.eclass) would contain the archs that upstream says LDC can run on.

mleise commented 2 years ago

A Dlang package will have a compiler USE-flag, if dlang-compilers.eclass says that compiler has the same or higher stability. E.g. running on amd64 with a package that has "~amd64", it will look for compilers that have either "amd64" or "~amd64" in them. A package that is "amd64" will only show compilers that are also stable ("amd64").

the-horo commented 2 years ago

Oh, so dlang-compiler.eclass is for what architectures a compiler can run on, not what architectures it can compile for. Got it. Sorry for misunderstanding

mleise commented 2 years ago

No problem! I'll merge it probably tomorrow. Feel free to add any host architectures that should be supported. We just wont be able to mark them stable if we don't have them to test on.