5 ms·
That's fine if you're not writing open source code and don't plan on updating your toolchain frequently. For the rest of us? -Werror is not our friend.
by mort96 3y ago
That's fine if you're not writing open source code and don't plan on updating your toolchain frequently.
For the rest of us? -Werror is not our friend.
- deleted 3y ago[deleted]
- charcircuit 3y agoIt works the same with open source. If your open source library is always built with clang 16 then it will never fail to compile. If people want to use an unsupported toolchain they can figure out how to get it working themselves.
- mort96 3y agoAs an author of open source software, you must expect people to use their system's toolchain. You can define minimum versions sure, but if you use Clang 16, you really ought to not break when a user tries to compile with Clang 17, unless your build system actually automatically downloads and uses the right clang version automatically. Most of us aren't using such a build system.
- charcircuit 3y ago>you must expect people to use their system's toolchain Why? I don't expect people to build against their system libraries. >unless your build system actually automatically downloads and uses the right clang version automatically Nix, bazel, buck, etc all support defining the toolchain for your build. Reproducable builds are useful. You are supporting a known configuration. Crashes can all be collected an easily analyzed. You can be sure you have a properly compiled version by verifying the hash. >Most of us aren't using such a build system. That's okay. You can just ingest a prebuilt artifact if you aren't capable of tying it into your build system.
- aflag 3y ago> Why? Because that's what people do. One of the big reasons that build open source software is to have fun and work together with other hobbyists, some of each don't even write software professionally at all. If you want to have fun with open source you really want to keep things simple and keep the entry barrier low. Otherwise, it'll just feel like an unpaid job.
- charcircuit 3y agoSome people want to develop open source software in a professional manner. Having to support the output of a single toolchain is the definition of keeping things simple.
- mort96 3y agoTo be honest I don't understand what your goal is. Use one toolchain to produce the binaries you distribute, sure. Only provide support for those official binaries or binaries compiled with the officially supported toolchain, why not. And use -Werror with that standardized toolchain in CI to ensure builds with warnings don't get committed, I think that's great. But why are you hell bent on making it harder for your users to build from source?
- charcircuit 3y ago>But why are you hell bent on making it harder for your users to build from source? Building from source would use the toolchain you designed the source code for meaning that it will always succeed. If someone wants to fork the project and add support for a different toolchain they are free to do so. If they want to get rid of the requirement to have no compiler errors they are free to remove -Werror or disable the new warnings.
- mort96 3y agoHonestly the only code base I've seen which does this is Google's Chromium stuff; by default, it will download a pre-built Clang as well as a Debian sysroot. IMO, it's completely insane and has always been a giant pain in the ass. Maybe it's warranted for something as complex as Chromium but I really don't think it's the right choice for some 10kLOC FOSS project.