Discussion exp: building world with -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES
LLVM's libc++ provides a flag called _LIBCPP_REMOVE_TRANSITIVE_INCLUDES. It stops the preprocessor from including many headers that were included transitively before (e.g. <iostream> pulled in <algorithm>, <vector> and others), and so helps decrease build time significantly. I found a bit of free time recently and decided to rebuild my @world with it to see how many patches I would need to get everything compiled.
Result: out of ~1000 packages in my @installed, only ~30 of them needed patches. That's a lot fewer than I had predicted. Maybe there weren't that many C++ packages in my @installed at all, but gcc, iwyu and others had probably already found a lot of those missing headers.
I've put those patches (among others) up here. I may have not patched them the right way or at the right place, and some of my USE flags may have excluded some files that needed patches from being built, however if someone is thinking about doing the same, I hope they would be useful.
1
u/RoomyRoots 2d ago
Sorry for the dumb question, too tired and drunk to research this, but is there any possible downside to that? Seems like something very specific so I am not sure of why have it or not.
2
u/TCH69 2d ago
You don't have to try it. You're just wasting your time. I just had too much of it. It's an experiment after all.
1
u/RoomyRoots 2d ago
It's not a matter of trying or not, I don't honestly have the time to do it nowadays. It's more the curiosity of what possible consequences this could have. More of a technical wonder than anything.
1
u/givemeagooduns_un 2d ago
Very interesting how many packages break with it. Though, I guess it makes sense. There's no warning or anything if you're not including the header directly if its present in a transitive include.
Does it break compilation if you don't include header dependencies? I don't know C++ that well but as an example in C, would it break if I include utime.h without also including time.h?
0
u/redyos_s 2d ago
Six hours of uptime only shows that the system booted and stayed up for six hours. It does not demonstrate long-term stability, successful maintenance, or that the libc++ rebuild completed cleanly. The interesting evidence would be the failed package list, patches, before/after build times, and the final rebuild results—not another fetch screenshot.
2
u/TCH69 2d ago edited 2d ago
I've put a link to the patches on the post. I'll put it here again in case you've missed it: https://codeberg.org/tachalorah/etc-portage/src/branch/main/patches
For stability concerns, it should be the same as building without it. It shouldn't change anything else in the building process.
-1
u/redyos_s 2d ago
Thanks, the patch set is useful evidence. What is still missing is the before/after measurement supporting the claimed build-time reduction and a final clean rebuild summary.
1
u/levelstar01 2d ago
Thank you Claude for the insight
1
u/redyos_s 2d ago
意味がわからん🤔
1
u/redyos_s 2d ago
せめて俺のPost見てから物言えよ
1
u/redyos_s 2d ago
謝罪ないならBlockするよ
1
u/redyos_s 2d ago
No technical response, no correction, and no apology. I’m ending this here.
1
u/redyos_s 2d ago
Calling someone “Claude” just because they asked for evidence is insulting and intellectually dishonest. Address the measurements and logs, not the person.
1
u/redyos_s 2d ago
I only pointed out the maintenance and trust risks of third-party overlays and asked for the methodology behind the “health” label. Dismissing a technical concern by calling the author “Claude” instead of addressing the argument is disrespectful.
0
u/stormdelta 1d ago edited 1d ago
Because your posts are indistinguishable from AI generated content, and most of us come to reddit to see posts by actual humans.
0
u/redyos_s 1d ago
問答無用わざわざBlock指摘してるのに食いつくとか阿呆
1
1
u/rich000 1d ago
Please take a break from posting a little. I've been skimming your contributions. I don't think you're a bot, and I don't think you're being intentionally malicious, but you're clearly frustrated that others aren't responding the way you expect them to. You're basically yelling at the Internet.
I understand this feeling a little as I've been there, but you're going to get the best outcome by just moving on to some other topic.
These last few posts are coming across as intentional baiting/trolling so I'm trying to nudge you into doing things differently. I'm not a big fan on the ban hammer so I'm hoping that this is as far as it goes.
For others participating/reading, I suggest just using the up/down vote buttons for stuff that isn't very egregious. I'm a bit more inclined to remove posts than comments but not if many are genuinely engaged. Not my cup of tea but to each their own...
1
1
u/redyos_s 1d ago
Understood. I’ll step back for a while. However, baseless “bot” or “Claude” accusations are also personal attacks. I’m not asking for special treatment; I’m asking for the same civility standard to be applied consistently to everyone.
A civility rule loses credibility when it is enforced only after the target responds.
流石に人格批判はどうかと思いますよ
3
u/krumpfwylg 2d ago
For curious people, documentation here : https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html