Closed kloczek closed 10 months ago
Are you trying to build libc++ outside the monorepo? If yes: it's not supported anymore. If it doesn't work inside the monorepo layout could you clarify what the problem is?
Issue is that for both LLVM components are created official dist source tar balls so it suggest that it should be possible to do that. It wold be really good to have proper separation between LLVM components. This project already is huge and IMO sooner or later it will be necessary to divide it into separated subprojects. Because everything is in single repo it is really hard to across all activities like issues, PRs commits, discussions. Currently everything lands on single pile and only that I'm guessing maintenance must be harder and harder ..
That is indeed weird. @ldionne should the separate sources still exist? Or should there be a runtimes download? It looks like there is currently no way to build libc++ without downloading all of the LLVM project, since there is no way to get the runtimes/
subdirectory otherwise.
gentle ping .. π
Gentle ping .. issue still is around π
We shouldn't be distributing individual sources anymore, no. In fact I don't think it makes sense to distribute any sources that is a subset of the whole monorepo since most parts of LLVM use shared infrastructure.
So for example, there's no hope of being able to build libc++ without libcxxabi/
, runtimes/
, cmake/
, llvm/utils/lit
and probably others I am forgetting. I am not sure what generates these source tarballs during releases.
@tru @tstellar Do you know what controls the generation of source tarballs during releases? https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.0 has a bunch of small tarballs for libcxx
, libcxxabi
and others, and they don't really make any sense IMO.
Hmm, I just read the comment in https://discourse.llvm.org/t/building-llvm-out-of-per-subproject-tar-balls-still-is-not-working/72829/8:
The per sub-project tar balls are really meant to be used the same way one would use sparse checkouts from the git repository. There are still dependencies between sub-projects that make it impossible to build some of the sub-projects with a single tarball. For llvm, clang, and lld, the required sub-directories are documented here.
If the goal of providing those tarballs in the release is sparse checkouts, then I think this can be closed as NTBF (but also I think that the intent isn't super clear).
We shouldn't be distributing individual sources anymore, no. In fact I don't think it makes sense to distribute any sources that is a subset of the whole monorepo since most parts of LLVM use shared infrastructure.
I cannot agree with above.
LLVM as the project is HUGE.
In case if it will be something to fix by apply single small patch on clang code it wille be possible to rebuild only clang
without wasting time on rebuilding everything.
Issue is only with libcxx and libcxxabi which requires each other on build stage so it makes sense to merge them. Such project even combined will be still one of the smallest chunks of the LLVM.
You don't need to build everything just because you have all the source, so I don't see your point. (Most) libc++ developers only build libc++/libc++abi/libunwind but have all the sources available. There is no need to build anything else.
You don't need to build everything just because you have all the source, so I don't see your point. (Most) libc++ developers only build libc++/libc++abi/libunwind but have all the sources available. There is no need to build anything else.
Yes it is possible to do that however each such sub package will have included like in case of Fedora llvm-bolt FULL LLVM source tree tar ball. In other words all what you rote it is only trying to find kind of excuse to not solve that issue in civilised way. Problem will not disappear if it will be not treated as the issue. Dependency between those two components is on build stage and separating them into two separated source tar balls CREATES problem.
The same situation is with llvm, third-party and llvm-cmake source dist tar balls. llvm is effectively first LLVM component which needs to be build and forming additional llvm-cmake and third-party source tar balls does not solve any problems but it ONLY CREATES new ones complication packaging procedures.
libunwind is well isolated and so far nothing needs to be changed here.
In other words all what you rote it is only trying to find kind of excuse to not solve that issue in civilised way. Problem will not disappear if it will be not treated as the issue.
As it was pointed out to you in the Discourse thread, standalone builds are not working because of some accident. Here are past discussions of this: Streamlining support for standalone builds, Standalone build for clang & lld, fix or remove?.
Maybe @mgorny can chime in and share his experience, since he expressed interest in maintaining standalone builds.
Also be mindful of our Code of Conduct.
As it was pointed out to you in the Discourse thread, standalone builds are not working because of some accident. Here are past discussions of this: Streamlining support for standalone builds, Standalone build for clang & lld, fix or remove?.
If that was accident why since May no one have been trying to solve that issue? π€ Is it any problem with fixing that? π€ (I'm really only honestly asking because I don't see any changes in 16.x branch and 17.x as well .. but maybe I've lost some commits)
I'm sorry for not being clear enough. I meant that it's not an accident that there are troubles with standalone builds.
Just FTR: samples of use those per sub project dist tar balls it is possible to find across many Linux distributions so even LLVM is not (probably) testing those tar balls it is IMO enough sources details about what still needs to be fixed.
In https://github.com/llvm/llvm-project/issues/61502#issuecomment-1605297704 I've even proposed some set of minimal changes to fix some most obvious issues and so far (sorry so maybe a bit rude wording) no one even farted about that. That is really discouraging .. π
In #61502 (comment) I've even proposed some set of minimal changes to fix some most obvious issues and so far
Try to submit it as diff in Phabricator and you might get a review. Adding a diff to a issue is probably easily going to be missed by the people that would review something like that.
May I ask for some instruction how to do that? π€ (I'm not familiar with LLVN PR workflow) Will try to do that ASP π
Maybe you can wait until later this week, we are currently migrating to GitHub Pull Requests and it might be more familiar to you.
OK will wait π π
We have no problems with standalone builds in Gentoo. You just have to unpack a bunch of directories from the big tarball and run cmake from runtimes
directory these days. A little hackery may be required, especially if you want to run tests and avoid cyclic dependencies but nothing very hard.
Here's our logic: https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/libcxx/libcxx-17.0.0_rc3.ebuild?id=d29628d23bc1b4f988fbbde0c6ab16b87d1292f3 https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/libcxxabi/libcxxabi-17.0.0_rc3.ebuild?id=0c2ab945dd43a0b441f9237fb96a4a2ee73eecba
So for example, there's no hope of being able to build libc++ without libcxxabi/, runtimes/, cmake/, llvm/utils/lit
Since it is possible to use libc++
with GCC, it certainly makes sense to allow building it without LLVM and Clang.
We have no problems with standalone builds in Gentoo. You just have to unpack a bunch of directories from the big tarball and run cmake from runtimes directory these days. A little hackery may be required, especially if you want to run tests and avoid cyclic dependencies but nothing very hard.
What you've described is nothing more than just classic JFDI solution. Again: as long as between those two LLVM components is circular dependency does not make to much sense keep that code separately.
FWIW I think one solution here might be to merge libcxxabi into libcxx (just their CMake projects -- this doesn't have any bearing on whether we should be able to swap a different C++ ABI library under libc++). We run into many problems because of that, from this here to code duplication problems to bugs in a few cases.
However, at the end of the day we currently do not support building libc++ and libc++abi as standalone projects. We used to and we removed that a while back because there was way too much complexity around the 16 different ways you could build the runtimes. Nowadays we support few of them but we (try to) support them well.
I am going to close this because this "behaves correctly" w.r.t. our intent not to support standalone builds. Like I said, in the future this will hopefully become easier if we end up merging libcxx and libcxxabi (which is not an easy task, just to set the expectations).
@ldionne Could you refer to some sensible procedure to build current/recent versions of libc++
and libc++abi
without the rest of LLVM software? (I understand it is not supported presently, so I am not gonna open extra tickets if something fails, but I reckon it cannot be impossible, given that it worked before.)
To be honest I still do not understand propose of creating LLVM per subproject dist tar balls and keeping them in unusable state for quite long timeπ
Currently useability of those archives is limited because there are lots of inter submodules dependencies like:
project()
call)On top of that since at least 13.0.x actually nothing has been done to address all those issues and looks like there is no to much intention to even review what already has been submitted (which is odd). From one side slicing into subprojects should allow and actually allows now (after apply some patches) to not waste hours to build whole LLVM stack again in case of any build/testing issues in the middle. I can submit batch of my fixes .. but many of these fixes would be worthless if installed by llvm/ cmake files would be correctly integrated into cmake/ submodule or better if cmake/ would be integrated under llvm/.
In other words .. currently except cmake/ NONE of the per subproject dist tar balls are useable without patching or using with other dist tar balls.
I'm not expecting to have all those (and few other minor) issues solved for yesterday however it would be really good to have from LLVM core maintainers some sketch of plan of how all those issues LLVM are going to be addressed.
Than with that plan would be possible to apply proper set of consistent solutions in which I'm 100% sure different distros maintainers would be able actively participate reusing at lease partially already used patches.
I fully understand as well that all possible fixes needs to preserve mono repo build as highest priority.
To be honest I still do not understand propose of creating LLVM per subproject dist tar balls
Neither do I, to be honest. That's why I suggested that shipping the separate tarballs was misleading and we should stop doing that.
In other words .. currently except cmake/ NONE of the per subproject dist tar balls are useable without patching or using with other dist tar balls.
That's cause you're swimming against the current. We are in a monorepo now, and that's the way we build stuff. If you do things differently, you're on your own and as you noticed it's not a well supported path.
@ldionne Could you refer to some sensible procedure to build current/recent versions of
libc++
andlibc++abi
without the rest of LLVM software? (I understand it is not supported presently, so I am not gonna open extra tickets if something fails, but I reckon it cannot be impossible, given that it worked before.)
I think things should mostly work if you ensure you have the following paths in their respective monorepo-like locations:
libcxx
libcxxabi
llvm/cmake
llvm/utils/llvm-lit
llvm/utils/lit
runtimes
cmake
third-party/benchmark
I think our builds don't really touch other parts of the monorepo so I think it should work. But none of this is officially supported, everything is subject to change at any time, etc.
That's cause you're swimming against the current. We are in a monorepo now, and that's the way we build stuff. If you do things differently, you're on your own and as you noticed it's not a well supported path.
Sooner or later someone will find this as much more problematic as same as it was with XFree86/X11.
Number of issue tickets in this repo makes LLVM ALREADY driven all to the state in which controlling all those tickets in single repo is unsustainable.
If you want to change things, I would recommend directing your energy towards producing a well-written RFC to post on discourse.llvm.org. I'm certain you're not the only one who has issues with the monorepo. I'm not 100% sold myself, it definitely causes difficulties in a few cases, but it's what we have right now.
Number of issue tickets in this repo makes LLVM ALREADY driven all to the state in which controlling all those tickets in single repo is unsustainable.
I'd say lack of manpower at least some projects experience is what makes this unsustainable, same goes for long review queues. I think standalone builds are in a sorry state for the same reason. I don't see how splitting the monorepo is going to address any of that.
@Endilll As often, what matters is βnot seenβ. The current mono setup creates troubles which developers have to solve for themselves and projects they maintain. This results in duplicate efforts, less time to contribute and ultimately less motivation either.
I don't think this issue is the right place to discuss the monorepos "be or not to be", it would have to go to the discourse and be exposed to the wider community in order to get any movement, so anyone that want to argue for a change in the LLVM infrastructure should post there instead.
If you want to change things
As I wrote I really want however if none of the core LLVM core maintainers would want such change my effort would be worthless.
I would recommend directing your energy towards producing a well-written RFC
Issue is that exact change can vary depends on some goals which ae in case of LLV unclear. This is why I've asked to clarify few things about general goals. If those goals will be clear THAN it would be possible to propose exact change.
So far I don't see any comment from anyone who could plot direction of exact change.
In other words I'm not going to write all possible permutations of RFCs.
I'd say lack of manpower at least some projects experience is what makes this unsustainable, same goes for long review queues
Situations is more and more like in old communist time Polish joke. "A guy walking over the street found a very strange situation on roadside construction. Construction workers have been running in the loop with empty barrels between constructed buildings and piles of bricks. He asked one of the workers resting for a few minutes "What you are doing here?". The worker answered that that they don't know but they were so busy that they had no time to load and unload the bricks."
IIRC a year ago number of LLVM opened issue tickets was ~16k. Now that number is approaching to 20k. Number of issue tickets labels grew as well.
IMO dividing whole llvm/llvm repo into smaller pieces, delegate exact maintainers to each repo and create at least second layer chain of command, solving problems etc. would help:
Other things which IMO would be good to do to save preciouses time:
[1] currently testing per subproject does not work as well.
Just in case if someone would be asking .. create subprojects with its own repos does not mean instant abandoning mono repo build and testing. IMO it is possible to reorganise whole code to use parent for example llvm/monorepo in which other subprojects will by imported as git submodules to be able on transition time reuse current set of build and testing methodologies.
BTW: divide whole LLVM into set of subprojects will DRAMATICALLY improve visibility of the git changes because it will be no longer one gigantic git log.
Trying to build unpatched
libcxx
it fails because it requires being built in a monorepo layout with libcxxabi:I found fedora patch
However it did not helped and looks like on building
libcxx
andlibcxxabi
usign non-nomo repo tar ballslibcxx
cmake passes without installedlibcxxabi
devel resourcesHowever after that build fails on
On building
libcxxabi
cmake requires-D LIBCXXABI_LIBCXX_INCLUDES
so in that case that requires to have installedlibcxx
devel resources. In other words there is circular dependency between those two when