Feature #5: Compilation Step Failure
We'll cover the following...
Description
Large software consists of many source files and libraries. The software as a whole can only compile if all the constituent files compile successfully with the required libraries. The multi-file compilation is generally structured as a number of build steps that must be performed sequentially so that the dependencies of files and libraries are met. An individual build step can include the compilation of a source file or library.
Assume that we are working with a system that specifies the build as steps 1
through n
, and the steps must be performed in ascending order. If a build step fails, repeating all the build steps is inefficient. The successful steps should not be repeated. When a build fails, you get an error message, but you don’t know which step failed. You have access to an API call, is_failed_step(i)
, which returns true if build step i
failed. Otherwise, it will return false. If there was a total of forty steps and step 28 failed, the compilation will stop, and is_failed_step(i)
will return true as long as i >= 28
. You want to efficiently determine the first build step that must be repeated.
For instance, if you have n = 40
steps and the steps 28
to 40
fail. The API call is_failed_step(i)
will give True
for 28
to 40
. Your module should ...
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy