spack.analyzers package¶
Submodules¶
spack.analyzers.analyzer_base module¶
An analyzer base provides basic functions to run the analysis, save results, and (optionally) interact with a Spack Monitor
- class spack.analyzers.analyzer_base.AnalyzerBase(spec, dirname=None)[source]¶
Bases:
object
- property output_dir¶
The full path to the output directory.
This includes the nested analyzer directory structure. This function does not create anything.
- save_result(result, overwrite=False)[source]¶
Save a result to the associated spack monitor, if defined.
This function is on the level of the analyzer because it might be the case that the result is large (appropriate for a single request) or that the data is organized differently (e.g., more than one request per result). If an analyzer subclass needs to over-write this function with a custom save, that is appropriate to do (see abi).
- spack.analyzers.analyzer_base.get_analyzer_dir(spec, analyzer_dir=None)[source]¶
Given a spec, return the directory to save analyzer results.
We create the directory if it does not exist. We also check that the spec has an associated package. An analyzer cannot be run if the spec isn’t associated with a package. If the user provides a custom analyzer_dir, we use it over checking the config and the default at ~/.spack/analyzers
spack.analyzers.config_args module¶
A configargs analyzer is a class of analyzer that typically just uploads already existing metadata about config args from a package spec install directory.
spack.analyzers.environment_variables module¶
An environment analyzer will read and parse the environment variables file in the installed package directory, generating a json file that has an index of key, value pairs for environment variables.
- class spack.analyzers.environment_variables.EnvironmentVariables(spec, dirname=None)[source]¶
Bases:
spack.analyzers.analyzer_base.AnalyzerBase
- description = 'environment variables parsed from spack-build-env.txt'¶
- name = 'environment_variables'¶
- outfile = 'spack-analyzer-environment-variables.json'¶
spack.analyzers.install_files module¶
The install files json file (install_manifest.json) already exists in the package install folder, so this analyzer simply moves it to the user analyzer folder for further processing.
spack.analyzers.libabigail module¶
- class spack.analyzers.libabigail.Libabigail(spec, dirname=None)[source]¶
Bases:
spack.analyzers.analyzer_base.AnalyzerBase
- description = 'Application Binary Interface (ABI) features for objects'¶
- name = 'libabigail'¶
- outfile = 'spack-analyzer-libabigail.json'¶
- run()[source]¶
Run libabigail, and save results to filename.
This run function differs in that we write as we generate and then return a dict with the analyzer name as the key, and the value of a dict of results, where the key is the object name, and the value is the output file written to.
- save_result(result, overwrite=False)[source]¶
Read saved ABI results and upload to monitor server.
ABI results are saved to individual files, so each one needs to be read and uploaded. Result here should be the lookup generated in run(), the key is the analyzer name, and each value is the result file. We currently upload the entire xml as text because libabigail can’t easily read gzipped xml, but this will be updated when it can.
Module contents¶
This package contains code for creating analyzers to extract Application Binary Interface (ABI) information, along with simple analyses that just load existing metadata.