4 ms·
As 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
by mort96 3y ago
As 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.
- dzaima 3y agoThe two options of reproducible builds and prebuilt artifacts is still a significantly limiting situation. There are plenty of situations where the desired prebuilt artifacts aren't available, and you'd prefer to not have 5 clang-s and 7 gcc-s installed. There can be problems with updating toolchains, sure, and it's reasonable to write software assuming a specific one, but -Werror adding a very unnecessary roadblock is just not nice.
- charcircuit 3y ago>There are plenty of situations where the desired prebuilt artifacts aren't available, and you'd prefer to not have 5 clang-s and 7 gcc-s installed You don't need to install a toolchain to use it. The build tool should handle everything for you and should handle clearing caches of unsued toolchains that are no longer needed. >but -Werror adding a very unnecessary roadblock is just not nice. Warnings should be looked at. If the errors are not important you can add flags to silence them.
- dzaima 3y ago> You don't need to install a toolchain to use it. The build tool should handle everything for you and should handle clearing caches of unsued toolchains that are no longer needed. I don't want a dozen clangs and gccs wasting disk space (& increasing initial build times) regardless of who manages them! And I don't mean one project having a bunch of toolchains (I pray that never happens), I mean having dozens of random projects on my computer, most having been built just once and which won't be touched for an indeterminate amount of time. > Warnings should be looked at. If the errors are not important you can add flags to silence them. Yes, developers should look at them (and developers can look at them even without -Werror! or, as said elsewhere, it could be enabled conditionally). Users won't get much out of them, other than being annoyed at the project if they prevent the project from being built.
- charcircuit 3y ago>I mean having dozens of random projects on my computer, most having been built just once and which won't be touched for an indeterminate amount of time. You don't have to persist all of the build time dependencies forever. It can redownload them if you need to rebuild one of them.