Book: Software Engineering at Google
Chapter: 18 - Build Systems and Build Philosophy
Summary:
Having a scalable, fast and correct build system is crucial in ensuring high developer productivity, due to their frequent usage. A declarative build system is much more scalable than an imperative, script-based build system due to incremental builds and greater parallelism.
Declarative vs Imperative Build Systems
Imperative build system is one where a developer would write specific scripts that contains the exact commands to build the source code
While it is extremely flexible, it does not scale well
This is because of various reasons: the build scripts may be non-deterministic or it may contain certain assumptions about the implementation of certain libraries
As such, task-based build system tend to only execute on a single core
A declarative build system effectively only allows the developer to specific the source code to be built as well as its dependencies
The exact build commands and the sequence in which the they are executed are all handled by the build system
Able to leverage incremental builds and greater parallelism
Fine-grained vs Coarse-grained Modules
Fine-grained modules refer to build targets that are made up of relatively lesser source code than coarse-grained modules
Fine-grained modules are much more preferable than coarse-grained modules since it allows the build system to harness more benefits from incremental builds
If a source file in a coarse-grained module is modified, the entire module has to be rebuilt
Whereas if the coarse-grained module is split into multiple fine-grained modules, then it is possible to save some work since not all of the fine-grained modules have to be rebuilt
External Dependency Management
Manually managing the dependency versions is better than automatic versioning
It prevents any breaking changes in the external dependency from affecting the application
A hash of the external dependency should be stored as well to detect malicious external artifacts
Relevance to Markbind
Good to explore replacing Lerna, the current monorepo build tool, with npm workspaces, so as to take advantage of incremental builds on local machine as well as in CI tests
Good to explore manually specifying specific versions for core dependencies so as to lower the chances of introducing a breaking change to Markbind
Book: Software Engineering at Google Chapter: 18 - Build Systems and Build Philosophy
Summary:
Having a scalable, fast and correct build system is crucial in ensuring high developer productivity, due to their frequent usage. A declarative build system is much more scalable than an imperative, script-based build system due to incremental builds and greater parallelism.
Declarative vs Imperative Build Systems
Fine-grained vs Coarse-grained Modules
External Dependency Management
Relevance to Markbind