4 ms·
> Although it adds to the code that must be maintained as part of the project, I think that having a custom build infrastructure that can grow with the project
by RcouF1uZ4gsC 9y ago
> Although it adds to the code that must be maintained as part of the project, I think that having a custom build infrastructure that can grow with the project is a good idea for medium-sized and larger projects.
Please don't do this for open source projects. Other people may want to use your code, but they generally don't want yet another build system. There are already a lot of build systems that are building very complicated projects. Surely, one of these existing, widely used build systems can be made to work for your project.
- jstimpfle 9y agoTBH I don't have many fond memories of open-source build systems. Any widely used build system (that probably <10% of the developers know very well, anyway) is not going to help if the build realized with it is broken (too flexible, too confusing, too optimistic about others' environments). And frankly most uses of those build systems in the wild are "give up control and pray". If it's about making it easy for uninitiated collaborators to add new source files, then the listed build description format is pretty self-explanatory to use. And the build script just needs to be run. It takes no arguments, so I don't think there is a problem with that.
- rout39574 9y agoI think that your build would be much more readable as make. Building object code and libraries from C is.. kind of well traveled ground? Making an idiosyncratic system is satisfying, but the usefulness of your work is decreased if it's decorated with locally invented barriers to comprehension. Rock on; scratch your itches.
- jstimpfle 9y agoI don't entirely disagree. If you only compile C files this is not for you. This is about exploring what building blocks it takes to also support building all the custom things you need besides that in a larger project.
- Ace17 9y ago> If it's about making it easy for uninitiated collaborators to add new source files, then the listed build description format is pretty self-explanatory to use. This misses the point IMHO. In practice, whatever complex the build system is, it's generally easy to add a new source file: simply grep for an existing source file name, find the build files that refers to it, and insert a similar line for your new file. > And the build script just needs to be run. It takes no arguments, so I don't think there is a problem with that. What about: cross compilation? ccache injection? verbose builds? parallelism control? installation prefix? Try being a package maintainer for a GNU/Linux distribution, where all of the above needs to be kept under control. You will despise custom build systems. Established build systems (like GNU Autoconf (e.g gcc), and, to some extent, custom Autoconf (ffmpeg, libvpx)) handle all these cases pretty well, and provide fixed commande-line options (--prefix, --host) to control them. This means the project author doesn't get to decide how the option will be named and how it will work. This make a huge difference if you're trying to packages for your distrib dozens of projects from dozens of various authors. With a custom build system, the best case scenario is you have to re-learn all these options for each project. The worst case scenario is: one project doesn't support some use case (e.g cross-compiling), so you have to maintain a patch that hacks into the build files to add the behavior your need.
- lolikoisuru 9y ago>What about: cross compilation? ccache injection? verbose builds? parallelism control? installation prefix? Try being a package maintainer for a GNU/Linux distribution, where all of the above needs to be kept under control. You will despise custom build systems. None of those are features that developers care about. They are only of interest to package maintainers, systems administrators and other lunatics.
- pleasecalllater 9y agoYea... how come that "I don't care" became a virtue.
- oblio 9y ago
- lolikoisuru 9y ago>If it's about making it easy for uninitiated collaborators to add new source files, then the listed build description format is pretty self-explanatory to use. If you write a generic makefile the uninitiated collaborator doesn't have to do anything to add new source files.
- jstimpfle 9y agoYou can setup any build that way (no need to use Make) but I don't think that's a good idea.
- MereInterest 9y agoI'd be interested to hear what you think that way. In my mind, if a file exists within the src directory but is not compiled as part of the project, its existence is lying to the developer. Keeping a separate list of files to be included makes it possible to lie to the developer. Therefore, wildcard builds should be used, so the list of files in the src directory and the list of files being compiled are one and the same.
- jstimpfle 9y agoI like to have an official place where the build rules and artifacts are clearly laid out. I don't think file system directories are a good place to put the truth. For one thing, parsing the information from the directory contents means relying on out-of-band data. For another, directories often contain files that "should not be there". Or maybe you accidentally delete an important file. The build couldn't detect the mistake.
- imtringued 9y agoThat's the problem with make and why there are so many build systems built on top of it. Make alone isn't enough. It actually doesn't handle this case at all unless you use a compiler (-MMD) or any other external tool to basically generate the makefile. Otherwise you have to manage the source files and header dependencies yourself.