Hi,

I'm writing with a suggestion for development of the latest current stable LFS 
book. Version 7.8 at the time of writing.


I believe the addition of some simple custom unit tests at each stage in the 
build process could serve a double purpose a) educational b) prevention of 
error detection only later on in the build process.


Errors detected only later in the pipeline cause a number of problems:


a) the pain of having to figure out which stage contains an error or bug in the 
build process

b) then having to figure out whether you need to start again from scratch or 
can correct the errors in some way without having to scrap everything


Here is a recent thread which illustrates the point:


http://lists.linuxfromscratch.org/pipermail/lfs-support/2015-December/049297.html

http://lists.linuxfromscratch.org/pipermail/lfs-support/2015-December/049300.html


The above thread details how wrongly linked binaries and libraries were only 
detected after building Perl (a number of stages after the offending binaries 
and libraries were built). Binaries infected with host libraries dated back to 
the second pass of the binutils build. Libraries infected with host libraries 
dated back as far as the gcc build.


Perhaps we could come up with a list of easily testable assertions for each 
phase of the build and include some simple commands in an updated version of 
the book that will prevent the reader running into the same sort of 
difficulties.


e.g. in this example it seems that the assertion is that no binaries or 
libraries should be linked to any host libraries from the second build of 
binutils onwards.


Surely, this wouldn't be such a huge addition to the book. Early detection of 
these kinds of problems could smoothen the build process and prevent the 
complexity of trying to figure out what is going wrong later in the pipeline.


Another example,


At each stage of the build process perhaps it could be useful to have a 
complete listing of which files are expected to be in /tools


This would be another kind of assertion which would be trivial to test for at 
each stage of the build process.


I'm sure more useful assertions could be imagined to catch errors/bugs as early 
as possible in the pipeline. Further suggestions would be most welcome if 
anybody has any.


Daer Samej

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to