spliced.predict.smeagle package
Submodules
spliced.predict.smeagle.asp module
- class spliced.predict.smeagle.asp.AspFunction(name, args=None)[source]
Bases:
object
An asp function
spliced.predict.smeagle.smeagle module
- class spliced.predict.smeagle.smeagle.SmeagleRunner[source]
Bases:
object
- compatible_test(lib, lib_set, lookup, detail=False, out=None)[source]
A set test scopes a library A (lib) to be compared against its space of dependencies (lib_set). To properly scope the output list of facts, we take a lookup that has key (the library facts json to load) and value as the set of symbols to include in the model
- generate_facts(lib=None, data=None, out=None, lib_basename=False, namespace=None)[source]
Generate facts for one entry.
spliced.predict.smeagle.solver module
- class spliced.predict.smeagle.solver.FactGenerator(lib, out=None, lib_basename=False, namespace=None)[source]
Bases:
SolverBase
Class to orchestrate fact generation (uses FactGeneratorSetup)
- class spliced.predict.smeagle.solver.FactGeneratorSetup(lib, lib_basename=False, namespace=None)[source]
Bases:
GeneratorBase
Class to accept one library and generate facts.
- class spliced.predict.smeagle.solver.GeneratorBase[source]
Bases:
object
The GeneratorBase is the base for any kind of Setup (fact generator or solve) Base functions to set up an ABI Stability and Compatability Solver.
- add_library(lib, identifier=None, symbols=None)[source]
Given a loaded Smeagle Model, generate facts for it.
If an identifier is given we are doing a comparison / diff between two libraries, and this is akin to a namespace, usually A and B. Otherwise we just output facts without one.
- add_location(libname, func, direction, param_type, location)[source]
Convenience function to print a location, ensuring to add identifier if defined
- generate_function(lib, func, identifier=None, callsite=False, symbols=None)[source]
Generate facts for a function
- lib_basename = False
- parse_aggregate(param, param_type, original, libname, top_name, variable=False, direction=None)[source]
Parse a struct or a class (and maybe union)
- parse_aggregate_by_value(param, libname, top_name, direction)[source]
Parse an aggregate by value.
When it’s by value the parser cle has already provided registers and we don’t need to worry about offsets
- parse_array(param, param_type, libname, top_name, variable=False, direction=None)[source]
Parse a struct or a class (and maybe union)
abi_typelocation(“example”,”_Z3fooiPP7Structy”,”Import”,”Array[5]”,”((%rsi))”).
- parse_empty_struct(libname, top_name, param, variable=False)[source]
Make up a fact for an empty struct
- class spliced.predict.smeagle.solver.SolverBase[source]
Bases:
object
Common base functions for some kind of solver. For stability, compatibility, or just fact generation.
- class spliced.predict.smeagle.solver.StabilitySetSolver(libA, libsB, lookup, out=None)[source]
Bases:
StabilitySolver
Class to orchestrate a Stability Set Solver.
- class spliced.predict.smeagle.solver.StabilitySetSolverSetup(libA, libsB, symbols)[source]
Bases:
GeneratorBase
Class to set up and run an ABI Stability and Compatability Solver using one library A, a set of symbols for it, and a set of dependency libraries B, under namespace B, also each with symbols.
- class spliced.predict.smeagle.solver.StabilitySolver(lib1, lib2, out=None)[source]
Bases:
SolverBase
Class to orchestrate a Stability Solver.
- class spliced.predict.smeagle.solver.StabilitySolverSetup(lib1, lib2)[source]
Bases:
GeneratorBase
Class to set up and run an ABI Stability and Compatability Solver.
Module contents
- class spliced.predict.smeagle.SmeaglePrediction[source]
Bases:
Prediction
- check_missing_symbols(splice, lib)[source]
Ensure no missing symbols as determined by elfcall off the bat.
- compatibility_test_lib(splice, lib, facts_path)[source]
Given an initial library (lib) that we have facts (facts_path) for, use the splice lookup to derive the exact dependency libraries (and set of symbols) that are needed. IF a dependency library fails to generate facts, we simply don’t include its symbols. We do this so we can still make a prediction on imperfect information.
- generate_smeagle_data(lib, prefix='smeagle')[source]
Given a library, run smeagle to generate facts and save to cache. Return key.
- predict(splice, predict_type=None)[source]
Run smeagle to add to the predictions # Testing command: # spliced splice –package swig@3.0.8 –splice pcre –runner spack –replace pcre –experiment experiment
splice is going to have libraries found and symbols and imported missing
If any imported missing, record splice fail (we need all the symbols)
Get list of associated paths from elfcall, generate facts for each
try to mamke cache based on the library fullpath
After facts are generated, spliced->smeagle runner should:
generate asp facts for main lib/binary for all symbols in the union set across dependencies
for each dependency, only genderate asp facts for the symbols that come from it
An entirely new ASP model that compares A (the single binary/lib) to B (symbols across deps) If no splice libs OR no tools, cut out early