Closed aaronmondal closed 9 months ago
Note to avoid confusion: This is not related to the bundled LLVM version that carbon itself uses. The host toolchain used to build the dependencies is the issue.
I wonder why I didn't see this immediately but the logs clearly show that this is an issue with __USE_FORTIFY_LEVEL
from the glibc header features.h
. The macro is set depending on the value of _FORTIFY_SOURCE
.
Seems like Bison 3.3.2 doesn't support _FORTIFY_SOURCE=2
. Setting it to 0 works but doesn't seem like a good way to solve this :disappointed:
I think @jonmeow was expecting still other issues with LLVM 16 and Bison, but maybe its just this issue?
I think he has tried to upgrade Bison but it looks .... difficult. Maybe he can relay current status there and what (if anything) next steps might look like.
There is also a discussion thread where Jon shared his attempt to move us to ANTLR which looks better supported but sadly had.... really challenging performance: https://github.com/carbon-language/carbon-lang/discussions/2574
Definitely something we're interested in figuring out, although I'm worried that Jon at least has already used up the time he could devote to this.
FWIW, I'm also happy for us to just force _FORTIFY_SOURCE
off in our builds. We're a long way from our libraries needing to work in a broader ecosystem where this would be a problem, especially the Bison parser. And fortify provides near zero value for us in the daily development of Carbon. If that's the only issue, I'd be happy for a patch to our toolchain configuration to just override this? (If its not clear where, let me know and I can help with that part.)
I think @jonmeow was expecting still other issues with LLVM 16 and Bison, but maybe its just this issue?
Just this.
I think he has tried to upgrade Bison but it looks .... difficult. Maybe he can relay current status there and what (if anything) next steps might look like.
Someone just needs to get Bison 3.8.2 building with Bazel, maybe by contributing patches to https://github.com/jmillikin/rules_bison. But the files changed at least a little that it's not just "add the new version", and it needs to be verified with llvm-16 which isn't straightforward for me to do, especially given it should really be verified on linux+mac+win.
Note, an alternative is to just stop providing a hermetic bison and flex, similar to clang/llvm. But I assume @chandlerc won't like that path.
Definitely something we're interested in figuring out, although I'm worried that Jon at least has already used up the time he could devote to this.
Yes, I'm going to let other priorities rise.
@jonmeow I intended to add bzlmod support to the bison/flex/m4 rules a while ago. Back then I dropped work on this for lack of time, but now I'm already familiar with the rules and how to update/modify them.
I'll try to find some time to send PRs to rules_{m4|flex|bison}. I can also test this with llvm16 on linux since this is what I'm doing all day every day anyways :smile:
What I can't do is test mac and Windows, but I'm sure once things work for linux adding the other platforms shouldn't be too hard.
I'm also all for sticking to the hermetic bundles. I feel like adapting dependencies is much less painful than having to deal with "doesn't work on my machine" type issues :relaxed:
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive
label. The long term
label can also be added for issues which are expected to take time. \n\n\n This issue is labeled inactive
because the last activity was over 90 days ago.
Closing explorer-specific issues as not-planned for now due to our decision to prioritize working on the toolchain over other implementation work in the near term: https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3532.md
Description of the bug:
I'm trying to build carbon with a more-or-less upstream Clang. The Bison dependency won't build. I'm not sure what exactly causes it, but the same toolchain is able to build Bison 3.8.2. I think something in clang has changed that makes the old Bison 3.3.2 build fail.
Edit: It's caused by glibc's
_FORTIFY_SOURCE
infeatures.h
.What did you do, or what's a simple way to reproduce the bug?
This happens with Gentoo, Kernel 6.1.8-gentoo, clang profile, LLVM toolchain from portage version
16.0.0_pre20230107
. Note that this is not yet intended for general use, but I'd expect the issue to hit users as soon as LLVM 16 is released.What did you expect to happen?
No errors.
What actually happened?
Many errors from the bison dependency, seemingly triggered by an issue with
gnulib/config-linux/config.h
:Any other information, logs, or outputs that you want to share?