curry.toolchain.plans module
- class curry.toolchain.plans.Plan(interp, flags, stages)[source]
Bases:
objectA compilation plan.
Describes the sequence of stages that comprise compilation. Each stage consists of a set of file suffixes and a step function. The suffixes identify files at that stage. The step function implements the transition to the next stage.
- is_stale(filename, currypath=None)[source]
Tells whether a step of this plan refuses
filename. A step refuses a file through itsis_stalemethod, when it has one; seeJson2CppandCpp2Soof the C++ backend andcurry2icurryof the toolchain. The step of the file’s stage, which reads the file, is asked, and so is the step before it, which made the file. A step that answers for both its input and its output tells them apart by the suffix.currypathis the search path of the imports of the module (_findcurry.imports_path), for a step that imports them to answer (Cpp2So).
- prune_stale(filelist, currypath=None)[source]
Removes from
filelist, the files of one module in the order of this plan, every file that a step refuses, and every file after it. A file that does not exist is kept, because nothing can be read from it. Seeis_stale;currypathis the search path of the imports of the module (_findcurry.imports_path).
- restore(filename, currypath, **kwds)[source]
Asks the step that makes the final product of this plan to place a cached copy of the products of the module of
filenamebeside its files (the product cache; seeCpp2So.restoreof the C++ backend). Returns the file placed, or None when the step has norestoremethod, the cache is off, or the cache holds no entry.Maker.makeasks before each step, so a module whose products are cached is neither generated nor compiled.kwdsare the keywords of the plan (is_sourcefileamong them).
- property suffixes
Returns the sequence of file suffixes in this plan.
- class curry.toolchain.plans.Stage(suffixes, step)
Bases:
tuple- step
Alias for field number 1
- suffixes
Alias for field number 0
- curry.toolchain.plans.makeplan(interp=None, flags=0)[source]
Make a
Planobject, which describes the compilation pipeline.If
interpis None, then the plan can only go as far as building ICurry-JSON.- Parameters:
interp – An optional interpreter used to assist in building objects. This defines the backend and is needed to perform certain build steps, such as the conversion from JSON to target code.
flags – Indicates which build stages are enabled.