termux-packages icon indicating copy to clipboard operation
termux-packages copied to clipboard

RFE: build llvm / clang / lld / openmp with separate build scripts

Open tomty89 opened this issue 7 years ago • 4 comments

If you take a look at the file lists of the current libllvm subpackages, you will notice that the package split is a total chaos. It has been problematic during the 5.0-time and is now nothing but awful.

This is because the file names aren't always in straight forward patterns that makes it simple to "redivide" the packages, and because of how package split is done in Termux (that we can't have procedures to copy from different locations of the build but move files away from an already-merged source), it gets even nastier when files are accidentally left in the current single main package, libllvm.

If we build them with separate scripts, at worst the files will only be scattered around their own subpackage, which makes it way easier to fix (in terms of both identifying where the files should belong to and conflicts/replaces matter after the fix).

And we will have sane -dev package to main package dependency that way. (And probably sane auto -dev split)

Also it doesn't seem to me that having the "lib" package as the main package is a good idea for either llvm or clang, considering their nature and/or the hierarchy of their splits.

For clang, I am not even sure it should be split at all. Most likely we would at most want to split certain header files and static library (.a) to its dev packages (maybe it will be automatically done, idk), but not a silly "libclang" subpackage. (Though, as long as it's not the main package, it wouldn't be too ugly to have libclang.so split, but I really doubt that it has a point.)

I would love to fix this myself when I get regular access to a PC (currently an aarch64 android phone is all I have). It would be great if someone gets ahead of me though.

tomty89 avatar Mar 24 '18 20:03 tomty89

This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 18 '21 20:11 stale[bot]

This should be possible. Gentoo Portage has separate build recipes for these components (not exhaustive):

dev-util/lldb
sys-devel/clang
sys-devel/lld
sys-devel/llvm
sys-libs/compiler-rt
sys-libs/compiler-rt-sanitizers
sys-libs/libcxx
sys-libs/libcxxabi
sys-libs/libomp
sys-libs/llvm-libunwind

Rebuilding everything just for only one component (e.g. ~~lld~~ lldb after python bump) is nothing but ridiculous.

The only drawback that I think of is that it may be difficult to align the version among the components.

xtkoba avatar Feb 12 '23 12:02 xtkoba

I agree with this. Separating packages will not only save lots of build time but also make it easier to maintain. flang has already been separated from libllvm and it build successfully, I suppose clang will too.

Ping: @buttaface

licy183 avatar Feb 13 '23 09:02 licy183

It is possible, but as I just wrote in a comment on that closed mingw pull:

We would save build time building LLVM separately,
but it's more work setting all that up and maintaining it,
so I don't think it is worth it,
as build time is much cheaper than our time.

finagolfin avatar Feb 13 '23 10:02 finagolfin