SCons package#
Module contents#
Subpackages#
- SCons.Node package
- Module contents
Annotate()
BuildInfoBase
BuildInfoBase.__getstate__()
BuildInfoBase.__setstate__()
BuildInfoBase.bact
BuildInfoBase.bactsig
BuildInfoBase.bdepends
BuildInfoBase.bdependsigs
BuildInfoBase.bimplicit
BuildInfoBase.bimplicitsigs
BuildInfoBase.bsources
BuildInfoBase.bsourcesigs
BuildInfoBase.current_version_id
BuildInfoBase.merge()
Node
Node.Attrs
Node.BuildInfo
Node.Decider()
Node.GetTag()
Node.NodeInfo
Node.Tag()
Node._add_child()
Node._children_get()
Node._children_reset()
Node._func_exists
Node._func_get_contents
Node._func_is_derived
Node._func_rexists
Node._func_target_from_source
Node._get_scanner()
Node._memo
Node._specific_sources
Node._tags
Node.add_dependency()
Node.add_ignore()
Node.add_prerequisite()
Node.add_source()
Node.add_to_implicit()
Node.add_to_waiting_parents()
Node.add_to_waiting_s_e()
Node.add_wkid()
Node.all_children()
Node.alter_targets()
Node.always_build
Node.attributes
Node.binfo
Node.build()
Node.builder
Node.builder_set()
Node.built()
Node.cached
Node.changed()
Node.changed_since_last_build
Node.check_attributes()
Node.children()
Node.children_are_up_to_date()
Node.clear()
Node.clear_memoized_values()
Node.del_binfo()
Node.depends
Node.depends_set
Node.disambiguate()
Node.env
Node.env_set()
Node.executor
Node.executor_cleanup()
Node.exists()
Node.explain()
Node.for_signature()
Node.get_abspath()
Node.get_binfo()
Node.get_build_env()
Node.get_build_scanner_path()
Node.get_builder()
Node.get_cachedir_csig()
Node.get_contents()
Node.get_csig()
Node.get_env()
Node.get_env_scanner()
Node.get_executor()
Node.get_found_includes()
Node.get_implicit_deps()
Node.get_ninfo()
Node.get_source_scanner()
Node.get_state()
Node.get_stored_implicit()
Node.get_stored_info()
Node.get_string()
Node.get_subst_proxy()
Node.get_suffix()
Node.get_target_scanner()
Node.has_builder()
Node.has_explicit_builder()
Node.ignore
Node.ignore_set
Node.implicit
Node.implicit_set
Node.includes
Node.is_conftest()
Node.is_derived()
Node.is_explicit
Node.is_literal()
Node.is_sconscript()
Node.is_up_to_date()
Node.linked
Node.make_ready()
Node.missing()
Node.multiple_side_effect_has_builder()
Node.new_binfo()
Node.new_ninfo()
Node.ninfo
Node.nocache
Node.noclean
Node.postprocess()
Node.precious
Node.prepare()
Node.prerequisites
Node.pseudo
Node.push_to_cache()
Node.ref_count
Node.release_target_info()
Node.remove()
Node.render_include_tree()
Node.reset_executor()
Node.retrieve_from_cache()
Node.rexists()
Node.scan()
Node.scanner_key()
Node.select_scanner()
Node.set_always_build()
Node.set_executor()
Node.set_explicit()
Node.set_nocache()
Node.set_noclean()
Node.set_precious()
Node.set_pseudo()
Node.set_specific_source()
Node.set_state()
Node.side_effect
Node.side_effects
Node.sources
Node.sources_set
Node.state
Node.store_info
Node.target_peers
Node.visited()
Node.waiting_parents
Node.waiting_s_e
Node.wkids
NodeInfoBase
NodeList
Walker
changed_since_last_build_alias()
changed_since_last_build_entry()
changed_since_last_build_node()
changed_since_last_build_python()
changed_since_last_build_state_changed()
classname()
decide_source()
decide_target()
do_nothing()
do_nothing_node()
exists_always()
exists_base()
exists_entry()
exists_file()
exists_none()
get_children()
get_contents_dir()
get_contents_entry()
get_contents_file()
get_contents_none()
ignore_cycle()
is_derived_node()
is_derived_none()
rexists_base()
rexists_node()
rexists_none()
store_info_file()
store_info_pass()
target_from_source_base()
target_from_source_none()
- Submodules
- SCons.Node.Alias module
Alias
Alias.Attrs
Alias.BuildInfo
Alias.Decider()
Alias.GetTag()
Alias.NodeInfo
Alias.Tag()
Alias._add_child()
Alias._children_get()
Alias._children_reset()
Alias._func_exists
Alias._func_get_contents
Alias._func_is_derived
Alias._func_rexists
Alias._func_target_from_source
Alias._get_scanner()
Alias._memo
Alias._specific_sources
Alias._tags
Alias.add_dependency()
Alias.add_ignore()
Alias.add_prerequisite()
Alias.add_source()
Alias.add_to_implicit()
Alias.add_to_waiting_parents()
Alias.add_to_waiting_s_e()
Alias.add_wkid()
Alias.all_children()
Alias.alter_targets()
Alias.always_build
Alias.attributes
Alias.binfo
Alias.build()
Alias.builder
Alias.builder_set()
Alias.built()
Alias.cached
Alias.changed()
Alias.changed_since_last_build
Alias.check_attributes()
Alias.children()
Alias.children_are_up_to_date()
Alias.clear()
Alias.clear_memoized_values()
Alias.convert()
Alias.del_binfo()
Alias.depends
Alias.depends_set
Alias.disambiguate()
Alias.env
Alias.env_set()
Alias.executor
Alias.executor_cleanup()
Alias.exists()
Alias.explain()
Alias.for_signature()
Alias.get_abspath()
Alias.get_binfo()
Alias.get_build_env()
Alias.get_build_scanner_path()
Alias.get_builder()
Alias.get_cachedir_csig()
Alias.get_contents()
Alias.get_csig()
Alias.get_env()
Alias.get_env_scanner()
Alias.get_executor()
Alias.get_found_includes()
Alias.get_implicit_deps()
Alias.get_ninfo()
Alias.get_source_scanner()
Alias.get_state()
Alias.get_stored_implicit()
Alias.get_stored_info()
Alias.get_string()
Alias.get_subst_proxy()
Alias.get_suffix()
Alias.get_target_scanner()
Alias.has_builder()
Alias.has_explicit_builder()
Alias.ignore
Alias.ignore_set
Alias.implicit
Alias.implicit_set
Alias.includes
Alias.is_conftest()
Alias.is_derived()
Alias.is_explicit
Alias.is_literal()
Alias.is_sconscript()
Alias.is_under()
Alias.is_up_to_date()
Alias.linked
Alias.make_ready()
Alias.missing()
Alias.multiple_side_effect_has_builder()
Alias.new_binfo()
Alias.new_ninfo()
Alias.ninfo
Alias.nocache
Alias.noclean
Alias.postprocess()
Alias.precious
Alias.prepare()
Alias.prerequisites
Alias.pseudo
Alias.push_to_cache()
Alias.really_build()
Alias.ref_count
Alias.release_target_info()
Alias.remove()
Alias.render_include_tree()
Alias.reset_executor()
Alias.retrieve_from_cache()
Alias.rexists()
Alias.scan()
Alias.scanner_key()
Alias.sconsign()
Alias.select_scanner()
Alias.set_always_build()
Alias.set_executor()
Alias.set_explicit()
Alias.set_nocache()
Alias.set_noclean()
Alias.set_precious()
Alias.set_pseudo()
Alias.set_specific_source()
Alias.set_state()
Alias.side_effect
Alias.side_effects
Alias.sources
Alias.sources_set
Alias.state
Alias.store_info
Alias.str_for_display()
Alias.target_peers
Alias.visited()
Alias.waiting_parents
Alias.waiting_s_e
Alias.wkids
AliasBuildInfo
AliasBuildInfo.__getstate__()
AliasBuildInfo.__setstate__()
AliasBuildInfo.bact
AliasBuildInfo.bactsig
AliasBuildInfo.bdepends
AliasBuildInfo.bdependsigs
AliasBuildInfo.bimplicit
AliasBuildInfo.bimplicitsigs
AliasBuildInfo.bsources
AliasBuildInfo.bsourcesigs
AliasBuildInfo.current_version_id
AliasBuildInfo.merge()
AliasNameSpace
AliasNameSpace.Alias()
AliasNameSpace._abc_impl
AliasNameSpace.clear()
AliasNameSpace.copy()
AliasNameSpace.fromkeys()
AliasNameSpace.get()
AliasNameSpace.items()
AliasNameSpace.keys()
AliasNameSpace.lookup()
AliasNameSpace.pop()
AliasNameSpace.popitem()
AliasNameSpace.setdefault()
AliasNameSpace.update()
AliasNameSpace.values()
AliasNodeInfo
- SCons.Node.FS module
Base
Base.Attrs
Base.BuildInfo
Base.Decider()
Base.GetTag()
Base.NodeInfo
Base.RDirs()
Base.Rfindalldirs()
Base.Tag()
Base._Rfindalldirs_key()
Base.__getattr__()
Base.__lt__()
Base.__str__()
Base._abspath
Base._add_child()
Base._children_get()
Base._children_reset()
Base._func_exists
Base._func_get_contents
Base._func_is_derived
Base._func_rexists
Base._func_sconsign
Base._func_target_from_source
Base._get_scanner()
Base._get_str()
Base._glob1()
Base._labspath
Base._local
Base._memo
Base._path
Base._path_elements
Base._proxy
Base._save_str()
Base._specific_sources
Base._tags
Base._tpath
Base.add_dependency()
Base.add_ignore()
Base.add_prerequisite()
Base.add_source()
Base.add_to_implicit()
Base.add_to_waiting_parents()
Base.add_to_waiting_s_e()
Base.add_wkid()
Base.all_children()
Base.alter_targets()
Base.always_build
Base.attributes
Base.binfo
Base.build()
Base.builder
Base.builder_set()
Base.built()
Base.cached
Base.changed()
Base.changed_since_last_build
Base.check_attributes()
Base.children()
Base.children_are_up_to_date()
Base.clear()
Base.clear_memoized_values()
Base.cwd
Base.del_binfo()
Base.depends
Base.depends_set
Base.dir
Base.disambiguate()
Base.duplicate
Base.env
Base.env_set()
Base.executor
Base.executor_cleanup()
Base.exists()
Base.explain()
Base.for_signature()
Base.fs
Base.get_abspath()
Base.get_binfo()
Base.get_build_env()
Base.get_build_scanner_path()
Base.get_builder()
Base.get_cachedir_csig()
Base.get_contents()
Base.get_csig()
Base.get_dir()
Base.get_env()
Base.get_env_scanner()
Base.get_executor()
Base.get_found_includes()
Base.get_implicit_deps()
Base.get_internal_path()
Base.get_labspath()
Base.get_ninfo()
Base.get_path()
Base.get_path_elements()
Base.get_relpath()
Base.get_source_scanner()
Base.get_state()
Base.get_stored_implicit()
Base.get_stored_info()
Base.get_string()
Base.get_subst_proxy()
Base.get_suffix()
Base.get_target_scanner()
Base.get_tpath()
Base.getmtime()
Base.getsize()
Base.has_builder()
Base.has_explicit_builder()
Base.ignore
Base.ignore_set
Base.implicit
Base.implicit_set
Base.includes
Base.is_conftest()
Base.is_derived()
Base.is_explicit
Base.is_literal()
Base.is_sconscript()
Base.is_under()
Base.is_up_to_date()
Base.isdir()
Base.isfile()
Base.islink()
Base.linked
Base.lstat()
Base.make_ready()
Base.missing()
Base.multiple_side_effect_has_builder()
Base.must_be_same()
Base.name
Base.new_binfo()
Base.new_ninfo()
Base.ninfo
Base.nocache
Base.noclean
Base.postprocess()
Base.precious
Base.prepare()
Base.prerequisites
Base.pseudo
Base.push_to_cache()
Base.ref_count
Base.release_target_info()
Base.remove()
Base.render_include_tree()
Base.rentry()
Base.reset_executor()
Base.retrieve_from_cache()
Base.rexists()
Base.rfile()
Base.rstr()
Base.sbuilder
Base.scan()
Base.scanner_key()
Base.select_scanner()
Base.set_always_build()
Base.set_executor()
Base.set_explicit()
Base.set_local()
Base.set_nocache()
Base.set_noclean()
Base.set_precious()
Base.set_pseudo()
Base.set_specific_source()
Base.set_src_builder()
Base.set_state()
Base.side_effect
Base.side_effects
Base.sources
Base.sources_set
Base.src_builder()
Base.srcnode()
Base.stat()
Base.state
Base.store_info
Base.str_for_display()
Base.target_from_source()
Base.target_peers
Base.visited()
Base.waiting_parents
Base.waiting_s_e
Base.wkids
Dir
Dir.Attrs
Dir.BuildInfo
Dir.Decider()
Dir.Dir()
Dir.Entry()
Dir.File()
Dir.GetTag()
Dir.NodeInfo
Dir.RDirs()
Dir.Rfindalldirs()
Dir.Tag()
Dir._Rfindalldirs_key()
Dir.__clearRepositoryCache()
Dir.__getattr__()
Dir.__lt__()
Dir.__resetDuplicate()
Dir.__str__()
Dir._abspath
Dir._add_child()
Dir._children_get()
Dir._children_reset()
Dir._create()
Dir._func_exists
Dir._func_get_contents
Dir._func_is_derived
Dir._func_rexists
Dir._func_sconsign
Dir._func_target_from_source
Dir._get_scanner()
Dir._get_str()
Dir._glob1()
Dir._labspath
Dir._local
Dir._memo
Dir._morph()
Dir._path
Dir._path_elements
Dir._proxy
Dir._rel_path_key()
Dir._save_str()
Dir._sconsign
Dir._specific_sources
Dir._srcdir_find_file_key()
Dir._tags
Dir._tpath
Dir.addRepository()
Dir.add_dependency()
Dir.add_ignore()
Dir.add_prerequisite()
Dir.add_source()
Dir.add_to_implicit()
Dir.add_to_waiting_parents()
Dir.add_to_waiting_s_e()
Dir.add_wkid()
Dir.all_children()
Dir.alter_targets()
Dir.always_build
Dir.attributes
Dir.binfo
Dir.build()
Dir.builder
Dir.builder_set()
Dir.built()
Dir.cached
Dir.cachedir_csig
Dir.cachesig
Dir.changed()
Dir.changed_since_last_build
Dir.check_attributes()
Dir.children()
Dir.children_are_up_to_date()
Dir.clear()
Dir.clear_memoized_values()
Dir.contentsig
Dir.cwd
Dir.del_binfo()
Dir.depends
Dir.depends_set
Dir.dir
Dir.dir_on_disk()
Dir.dirname
Dir.disambiguate()
Dir.diskcheck_match()
Dir.do_duplicate()
Dir.duplicate
Dir.entries
Dir.entry_abspath()
Dir.entry_exists_on_disk()
Dir.entry_labspath()
Dir.entry_path()
Dir.entry_tpath()
Dir.env
Dir.env_set()
Dir.executor
Dir.executor_cleanup()
Dir.exists()
Dir.explain()
Dir.file_on_disk()
Dir.for_signature()
Dir.fs
Dir.getRepositories()
Dir.get_abspath()
Dir.get_all_rdirs()
Dir.get_binfo()
Dir.get_build_env()
Dir.get_build_scanner_path()
Dir.get_builder()
Dir.get_cachedir_csig()
Dir.get_contents()
Dir.get_csig()
Dir.get_dir()
Dir.get_env()
Dir.get_env_scanner()
Dir.get_executor()
Dir.get_found_includes()
Dir.get_implicit_deps()
Dir.get_internal_path()
Dir.get_labspath()
Dir.get_ninfo()
Dir.get_path()
Dir.get_path_elements()
Dir.get_relpath()
Dir.get_source_scanner()
Dir.get_state()
Dir.get_stored_implicit()
Dir.get_stored_info()
Dir.get_string()
Dir.get_subst_proxy()
Dir.get_suffix()
Dir.get_target_scanner()
Dir.get_text_contents()
Dir.get_timestamp()
Dir.get_tpath()
Dir.getmtime()
Dir.getsize()
Dir.glob()
Dir.has_builder()
Dir.has_explicit_builder()
Dir.ignore
Dir.ignore_set
Dir.implicit
Dir.implicit_set
Dir.includes
Dir.is_conftest()
Dir.is_derived()
Dir.is_explicit
Dir.is_literal()
Dir.is_sconscript()
Dir.is_under()
Dir.is_up_to_date()
Dir.isdir()
Dir.isfile()
Dir.islink()
Dir.link()
Dir.linked
Dir.lstat()
Dir.make_ready()
Dir.missing()
Dir.multiple_side_effect_has_builder()
Dir.must_be_same()
Dir.name
Dir.new_binfo()
Dir.new_ninfo()
Dir.ninfo
Dir.nocache
Dir.noclean
Dir.on_disk_entries
Dir.postprocess()
Dir.precious
Dir.prepare()
Dir.prerequisites
Dir.pseudo
Dir.push_to_cache()
Dir.rdir()
Dir.ref_count
Dir.rel_path()
Dir.release_target_info()
Dir.released_target_info
Dir.remove()
Dir.render_include_tree()
Dir.rentry()
Dir.rentry_exists_on_disk()
Dir.repositories
Dir.reset_executor()
Dir.retrieve_from_cache()
Dir.rexists()
Dir.rfile()
Dir.root
Dir.rstr()
Dir.sbuilder
Dir.scan()
Dir.scanner_key()
Dir.scanner_paths
Dir.sconsign()
Dir.searched
Dir.select_scanner()
Dir.set_always_build()
Dir.set_executor()
Dir.set_explicit()
Dir.set_local()
Dir.set_nocache()
Dir.set_noclean()
Dir.set_precious()
Dir.set_pseudo()
Dir.set_specific_source()
Dir.set_src_builder()
Dir.set_state()
Dir.side_effect
Dir.side_effects
Dir.sources
Dir.sources_set
Dir.src_builder()
Dir.srcdir
Dir.srcdir_duplicate()
Dir.srcdir_find_file()
Dir.srcdir_list()
Dir.srcnode()
Dir.stat()
Dir.state
Dir.store_info
Dir.str_for_display()
Dir.target_from_source()
Dir.target_peers
Dir.up()
Dir.variant_dirs
Dir.visited()
Dir.waiting_parents
Dir.waiting_s_e
Dir.walk()
Dir.wkids
DirBuildInfo
DirNodeInfo
DiskChecker
Entry
Entry.Attrs
Entry.BuildInfo
Entry.Decider()
Entry.GetTag()
Entry.NodeInfo
Entry.RDirs()
Entry.Rfindalldirs()
Entry.Tag()
Entry._Rfindalldirs_key()
Entry.__getattr__()
Entry.__lt__()
Entry.__str__()
Entry._abspath
Entry._add_child()
Entry._children_get()
Entry._children_reset()
Entry._func_exists
Entry._func_get_contents
Entry._func_is_derived
Entry._func_rexists
Entry._func_sconsign
Entry._func_target_from_source
Entry._get_scanner()
Entry._get_str()
Entry._glob1()
Entry._labspath
Entry._local
Entry._memo
Entry._path
Entry._path_elements
Entry._proxy
Entry._save_str()
Entry._sconsign
Entry._specific_sources
Entry._tags
Entry._tpath
Entry.add_dependency()
Entry.add_ignore()
Entry.add_prerequisite()
Entry.add_source()
Entry.add_to_implicit()
Entry.add_to_waiting_parents()
Entry.add_to_waiting_s_e()
Entry.add_wkid()
Entry.all_children()
Entry.alter_targets()
Entry.always_build
Entry.attributes
Entry.binfo
Entry.build()
Entry.builder
Entry.builder_set()
Entry.built()
Entry.cached
Entry.cachedir_csig
Entry.cachesig
Entry.changed()
Entry.changed_since_last_build
Entry.check_attributes()
Entry.children()
Entry.children_are_up_to_date()
Entry.clear()
Entry.clear_memoized_values()
Entry.contentsig
Entry.cwd
Entry.del_binfo()
Entry.depends
Entry.depends_set
Entry.dir
Entry.dirname
Entry.disambiguate()
Entry.diskcheck_match()
Entry.duplicate
Entry.entries
Entry.env
Entry.env_set()
Entry.executor
Entry.executor_cleanup()
Entry.exists()
Entry.explain()
Entry.for_signature()
Entry.fs
Entry.get_abspath()
Entry.get_binfo()
Entry.get_build_env()
Entry.get_build_scanner_path()
Entry.get_builder()
Entry.get_cachedir_csig()
Entry.get_contents()
Entry.get_csig()
Entry.get_dir()
Entry.get_env()
Entry.get_env_scanner()
Entry.get_executor()
Entry.get_found_includes()
Entry.get_implicit_deps()
Entry.get_internal_path()
Entry.get_labspath()
Entry.get_ninfo()
Entry.get_path()
Entry.get_path_elements()
Entry.get_relpath()
Entry.get_source_scanner()
Entry.get_state()
Entry.get_stored_implicit()
Entry.get_stored_info()
Entry.get_string()
Entry.get_subst_proxy()
Entry.get_suffix()
Entry.get_target_scanner()
Entry.get_text_contents()
Entry.get_tpath()
Entry.getmtime()
Entry.getsize()
Entry.has_builder()
Entry.has_explicit_builder()
Entry.ignore
Entry.ignore_set
Entry.implicit
Entry.implicit_set
Entry.includes
Entry.is_conftest()
Entry.is_derived()
Entry.is_explicit
Entry.is_literal()
Entry.is_sconscript()
Entry.is_under()
Entry.is_up_to_date()
Entry.isdir()
Entry.isfile()
Entry.islink()
Entry.linked
Entry.lstat()
Entry.make_ready()
Entry.missing()
Entry.multiple_side_effect_has_builder()
Entry.must_be_same()
Entry.name
Entry.new_binfo()
Entry.new_ninfo()
Entry.ninfo
Entry.nocache
Entry.noclean
Entry.on_disk_entries
Entry.postprocess()
Entry.precious
Entry.prepare()
Entry.prerequisites
Entry.pseudo
Entry.push_to_cache()
Entry.ref_count
Entry.rel_path()
Entry.release_target_info()
Entry.released_target_info
Entry.remove()
Entry.render_include_tree()
Entry.rentry()
Entry.repositories
Entry.reset_executor()
Entry.retrieve_from_cache()
Entry.rexists()
Entry.rfile()
Entry.root
Entry.rstr()
Entry.sbuilder
Entry.scan()
Entry.scanner_key()
Entry.scanner_paths
Entry.searched
Entry.select_scanner()
Entry.set_always_build()
Entry.set_executor()
Entry.set_explicit()
Entry.set_local()
Entry.set_nocache()
Entry.set_noclean()
Entry.set_precious()
Entry.set_pseudo()
Entry.set_specific_source()
Entry.set_src_builder()
Entry.set_state()
Entry.side_effect
Entry.side_effects
Entry.sources
Entry.sources_set
Entry.src_builder()
Entry.srcdir
Entry.srcnode()
Entry.stat()
Entry.state
Entry.store_info
Entry.str_for_display()
Entry.target_from_source()
Entry.target_peers
Entry.variant_dirs
Entry.visited()
Entry.waiting_parents
Entry.waiting_s_e
Entry.wkids
EntryProxy
EntryProxy.__get_abspath()
EntryProxy.__get_base_path()
EntryProxy.__get_dir()
EntryProxy.__get_file()
EntryProxy.__get_filebase()
EntryProxy.__get_posix_path()
EntryProxy.__get_relpath()
EntryProxy.__get_rsrcdir()
EntryProxy.__get_rsrcnode()
EntryProxy.__get_srcdir()
EntryProxy.__get_srcnode()
EntryProxy.__get_suffix()
EntryProxy.__get_windows_path()
EntryProxy.dictSpecialAttrs
EntryProxy.get()
EntryProxyAttributeError
FS
FS.Dir()
FS.Entry()
FS.File()
FS.Glob()
FS.PyPackageDir()
FS.Repository()
FS.VariantDir()
FS._lookup()
FS.chdir()
FS.chmod()
FS.copy()
FS.copy2()
FS.exists()
FS.get_max_drift()
FS.get_root()
FS.getcwd()
FS.getmtime()
FS.getsize()
FS.isdir()
FS.isfile()
FS.islink()
FS.link()
FS.listdir()
FS.lstat()
FS.makedirs()
FS.mkdir()
FS.open()
FS.readlink()
FS.rename()
FS.scandir()
FS.set_SConstruct_dir()
FS.set_max_drift()
FS.stat()
FS.symlink()
FS.unlink()
FS.variant_dir_target_climb()
File
File.Attrs
File.BuildInfo
File.Decider()
File.Dir()
File.Dirs()
File.Entry()
File.File()
File.GetTag()
File.NodeInfo
File.RDirs()
File.Rfindalldirs()
File.Tag()
File._Rfindalldirs_key()
File.__dmap_cache
File.__dmap_sig_cache
File.__getattr__()
File.__lt__()
File.__str__()
File._abspath
File._add_child()
File._add_strings_to_dependency_map()
File._build_dependency_map()
File._children_get()
File._children_reset()
File._createDir()
File._func_exists
File._func_get_contents
File._func_is_derived
File._func_rexists
File._func_sconsign
File._func_target_from_source
File._get_found_includes_key()
File._get_previous_signatures()
File._get_scanner()
File._get_str()
File._glob1()
File._labspath
File._local
File._memo
File._morph()
File._path
File._path_elements
File._proxy
File._rmv_existing()
File._save_str()
File._sconsign
File._specific_sources
File._tags
File._tpath
File.add_dependency()
File.add_ignore()
File.add_prerequisite()
File.add_source()
File.add_to_implicit()
File.add_to_waiting_parents()
File.add_to_waiting_s_e()
File.add_wkid()
File.all_children()
File.alter_targets()
File.always_build
File.attributes
File.binfo
File.build()
File.builder
File.builder_set()
File.built()
File.cached
File.cachedir_csig
File.cachesig
File.changed()
File.changed_content()
File.changed_since_last_build
File.changed_state()
File.changed_timestamp_match()
File.changed_timestamp_newer()
File.changed_timestamp_then_content()
File.check_attributes()
File.children()
File.children_are_up_to_date()
File.clear()
File.clear_memoized_values()
File.contentsig
File.convert_copy_attrs
File.convert_old_entry()
File.convert_sig_attrs
File.cwd
File.del_binfo()
File.depends
File.depends_set
File.dir
File.dirname
File.disambiguate()
File.diskcheck_match()
File.do_duplicate()
File.duplicate
File.entries
File.env
File.env_set()
File.executor
File.executor_cleanup()
File.exists()
File.explain()
File.find_repo_file()
File.find_src_builder()
File.for_signature()
File.fs
File.get_abspath()
File.get_binfo()
File.get_build_env()
File.get_build_scanner_path()
File.get_builder()
File.get_cachedir_bsig()
File.get_cachedir_csig()
File.get_content_hash()
File.get_contents()
File.get_contents_sig()
File.get_csig()
File.get_dir()
File.get_env()
File.get_env_scanner()
File.get_executor()
File.get_found_includes()
File.get_implicit_deps()
File.get_internal_path()
File.get_labspath()
File.get_max_drift_csig()
File.get_ninfo()
File.get_path()
File.get_path_elements()
File.get_relpath()
File.get_size()
File.get_source_scanner()
File.get_state()
File.get_stored_implicit()
File.get_stored_info()
File.get_string()
File.get_subst_proxy()
File.get_suffix()
File.get_target_scanner()
File.get_text_contents()
File.get_timestamp()
File.get_tpath()
File.getmtime()
File.getsize()
File.has_builder()
File.has_explicit_builder()
File.has_src_builder()
File.hash_chunksize
File.ignore
File.ignore_set
File.implicit
File.implicit_set
File.includes
File.is_conftest()
File.is_derived()
File.is_explicit
File.is_literal()
File.is_sconscript()
File.is_under()
File.is_up_to_date()
File.isdir()
File.isfile()
File.islink()
File.linked
File.lstat()
File.make_ready()
File.missing()
File.multiple_side_effect_has_builder()
File.must_be_same()
File.name
File.new_binfo()
File.new_ninfo()
File.ninfo
File.nocache
File.noclean
File.on_disk_entries
File.postprocess()
File.precious
File.prepare()
File.prerequisites
File.pseudo
File.push_to_cache()
File.ref_count
File.rel_path()
File.release_target_info()
File.released_target_info
File.remove()
File.render_include_tree()
File.rentry()
File.repositories
File.reset_executor()
File.retrieve_from_cache()
File.rexists()
File.rfile()
File.root
File.rstr()
File.sbuilder
File.scan()
File.scanner_key()
File.scanner_paths
File.searched
File.select_scanner()
File.set_always_build()
File.set_executor()
File.set_explicit()
File.set_local()
File.set_nocache()
File.set_noclean()
File.set_precious()
File.set_pseudo()
File.set_specific_source()
File.set_src_builder()
File.set_state()
File.side_effect
File.side_effects
File.sources
File.sources_set
File.src_builder()
File.srcdir
File.srcnode()
File.stat()
File.state
File.store_info
File.str_for_display()
File.target_from_source()
File.target_peers
File.variant_dirs
File.visited()
File.waiting_parents
File.waiting_s_e
File.wkids
FileBuildInfo
FileBuildInfo.__getstate__()
FileBuildInfo.__setstate__()
FileBuildInfo.bact
FileBuildInfo.bactsig
FileBuildInfo.bdepends
FileBuildInfo.bdependsigs
FileBuildInfo.bimplicit
FileBuildInfo.bimplicitsigs
FileBuildInfo.bsources
FileBuildInfo.bsourcesigs
FileBuildInfo.convert_from_sconsign()
FileBuildInfo.convert_to_sconsign()
FileBuildInfo.current_version_id
FileBuildInfo.dependency_map
FileBuildInfo.format()
FileBuildInfo.merge()
FileBuildInfo.prepare_dependencies()
FileBuildInfoFileToCsigMappingError
FileFinder
FileNodeInfo
FileNodeInfo.__getstate__()
FileNodeInfo.__setstate__()
FileNodeInfo.convert()
FileNodeInfo.csig
FileNodeInfo.current_version_id
FileNodeInfo.field_list
FileNodeInfo.format()
FileNodeInfo.fs
FileNodeInfo.merge()
FileNodeInfo.size
FileNodeInfo.str_to_node()
FileNodeInfo.timestamp
FileNodeInfo.update()
LinkFunc()
LocalFS
LocalFS.chmod()
LocalFS.copy()
LocalFS.copy2()
LocalFS.exists()
LocalFS.getmtime()
LocalFS.getsize()
LocalFS.isdir()
LocalFS.isfile()
LocalFS.islink()
LocalFS.link()
LocalFS.listdir()
LocalFS.lstat()
LocalFS.makedirs()
LocalFS.mkdir()
LocalFS.open()
LocalFS.readlink()
LocalFS.rename()
LocalFS.scandir()
LocalFS.stat()
LocalFS.symlink()
LocalFS.unlink()
LocalString()
MkdirFunc()
RootDir
RootDir.Attrs
RootDir.BuildInfo
RootDir.Decider()
RootDir.Dir()
RootDir.Entry()
RootDir.File()
RootDir.GetTag()
RootDir.NodeInfo
RootDir.RDirs()
RootDir.Rfindalldirs()
RootDir.Tag()
RootDir._Rfindalldirs_key()
RootDir.__getattr__()
RootDir.__lt__()
RootDir._abspath
RootDir._add_child()
RootDir._children_get()
RootDir._children_reset()
RootDir._create()
RootDir._func_exists
RootDir._func_get_contents
RootDir._func_is_derived
RootDir._func_rexists
RootDir._func_sconsign
RootDir._func_target_from_source
RootDir._get_scanner()
RootDir._get_str()
RootDir._glob1()
RootDir._labspath
RootDir._local
RootDir._lookupDict
RootDir._lookup_abs()
RootDir._memo
RootDir._morph()
RootDir._path
RootDir._path_elements
RootDir._proxy
RootDir._rel_path_key()
RootDir._save_str()
RootDir._sconsign
RootDir._specific_sources
RootDir._srcdir_find_file_key()
RootDir._tags
RootDir._tpath
RootDir.abspath
RootDir.addRepository()
RootDir.add_dependency()
RootDir.add_ignore()
RootDir.add_prerequisite()
RootDir.add_source()
RootDir.add_to_implicit()
RootDir.add_to_waiting_parents()
RootDir.add_to_waiting_s_e()
RootDir.add_wkid()
RootDir.all_children()
RootDir.alter_targets()
RootDir.always_build
RootDir.attributes
RootDir.binfo
RootDir.build()
RootDir.builder
RootDir.builder_set()
RootDir.built()
RootDir.cached
RootDir.cachedir_csig
RootDir.cachesig
RootDir.changed()
RootDir.changed_since_last_build
RootDir.check_attributes()
RootDir.children()
RootDir.children_are_up_to_date()
RootDir.clear()
RootDir.clear_memoized_values()
RootDir.contentsig
RootDir.cwd
RootDir.del_binfo()
RootDir.depends
RootDir.depends_set
RootDir.dir
RootDir.dir_on_disk()
RootDir.dirname
RootDir.disambiguate()
RootDir.diskcheck_match()
RootDir.do_duplicate()
RootDir.duplicate
RootDir.entries
RootDir.entry_abspath()
RootDir.entry_exists_on_disk()
RootDir.entry_labspath()
RootDir.entry_path()
RootDir.entry_tpath()
RootDir.env
RootDir.env_set()
RootDir.executor
RootDir.executor_cleanup()
RootDir.exists()
RootDir.explain()
RootDir.file_on_disk()
RootDir.for_signature()
RootDir.fs
RootDir.getRepositories()
RootDir.get_abspath()
RootDir.get_all_rdirs()
RootDir.get_binfo()
RootDir.get_build_env()
RootDir.get_build_scanner_path()
RootDir.get_builder()
RootDir.get_cachedir_csig()
RootDir.get_contents()
RootDir.get_csig()
RootDir.get_dir()
RootDir.get_env()
RootDir.get_env_scanner()
RootDir.get_executor()
RootDir.get_found_includes()
RootDir.get_implicit_deps()
RootDir.get_internal_path()
RootDir.get_labspath()
RootDir.get_ninfo()
RootDir.get_path()
RootDir.get_path_elements()
RootDir.get_relpath()
RootDir.get_source_scanner()
RootDir.get_state()
RootDir.get_stored_implicit()
RootDir.get_stored_info()
RootDir.get_string()
RootDir.get_subst_proxy()
RootDir.get_suffix()
RootDir.get_target_scanner()
RootDir.get_text_contents()
RootDir.get_timestamp()
RootDir.get_tpath()
RootDir.getmtime()
RootDir.getsize()
RootDir.glob()
RootDir.has_builder()
RootDir.has_explicit_builder()
RootDir.ignore
RootDir.ignore_set
RootDir.implicit
RootDir.implicit_set
RootDir.includes
RootDir.is_conftest()
RootDir.is_derived()
RootDir.is_explicit
RootDir.is_literal()
RootDir.is_sconscript()
RootDir.is_under()
RootDir.is_up_to_date()
RootDir.isdir()
RootDir.isfile()
RootDir.islink()
RootDir.link()
RootDir.linked
RootDir.lstat()
RootDir.make_ready()
RootDir.missing()
RootDir.multiple_side_effect_has_builder()
RootDir.must_be_same()
RootDir.name
RootDir.new_binfo()
RootDir.new_ninfo()
RootDir.ninfo
RootDir.nocache
RootDir.noclean
RootDir.on_disk_entries
RootDir.path
RootDir.postprocess()
RootDir.precious
RootDir.prepare()
RootDir.prerequisites
RootDir.pseudo
RootDir.push_to_cache()
RootDir.rdir()
RootDir.ref_count
RootDir.rel_path()
RootDir.release_target_info()
RootDir.released_target_info
RootDir.remove()
RootDir.render_include_tree()
RootDir.rentry()
RootDir.rentry_exists_on_disk()
RootDir.repositories
RootDir.reset_executor()
RootDir.retrieve_from_cache()
RootDir.rexists()
RootDir.rfile()
RootDir.root
RootDir.rstr()
RootDir.sbuilder
RootDir.scan()
RootDir.scanner_key()
RootDir.scanner_paths
RootDir.sconsign()
RootDir.searched
RootDir.select_scanner()
RootDir.set_always_build()
RootDir.set_executor()
RootDir.set_explicit()
RootDir.set_local()
RootDir.set_nocache()
RootDir.set_noclean()
RootDir.set_precious()
RootDir.set_pseudo()
RootDir.set_specific_source()
RootDir.set_src_builder()
RootDir.set_state()
RootDir.side_effect
RootDir.side_effects
RootDir.sources
RootDir.sources_set
RootDir.src_builder()
RootDir.srcdir
RootDir.srcdir_duplicate()
RootDir.srcdir_find_file()
RootDir.srcdir_list()
RootDir.srcnode()
RootDir.stat()
RootDir.state
RootDir.store_info
RootDir.str_for_display()
RootDir.target_from_source()
RootDir.target_peers
RootDir.up()
RootDir.variant_dirs
RootDir.visited()
RootDir.waiting_parents
RootDir.waiting_s_e
RootDir.walk()
RootDir.wkids
UnlinkFunc()
_Null
_classEntry
_copy_func()
_hardlink_func()
_my_normcase()
_softlink_func()
diskcheck_types()
do_diskcheck_match()
find_file()
get_MkdirBuilder()
get_default_fs()
has_glob_magic()
ignore_diskcheck_match()
initialize_do_splitdrive()
invalidate_node_memos()
needs_normpath_match()
save_strings()
sconsign_dir()
sconsign_none()
set_diskcheck()
set_duplicate()
- SCons.Node.Python module
Value
Value.Attrs
Value.BuildInfo
Value.Decider()
Value.GetTag()
Value.NodeInfo
Value.Tag()
Value._add_child()
Value._children_get()
Value._children_reset()
Value._func_exists
Value._func_get_contents
Value._func_is_derived
Value._func_rexists
Value._func_target_from_source
Value._get_scanner()
Value._memo
Value._specific_sources
Value._tags
Value.add_dependency()
Value.add_ignore()
Value.add_prerequisite()
Value.add_source()
Value.add_to_implicit()
Value.add_to_waiting_parents()
Value.add_to_waiting_s_e()
Value.add_wkid()
Value.all_children()
Value.alter_targets()
Value.always_build
Value.attributes
Value.binfo
Value.build()
Value.builder
Value.builder_set()
Value.built()
Value.cached
Value.changed()
Value.changed_since_last_build
Value.check_attributes()
Value.children()
Value.children_are_up_to_date()
Value.clear()
Value.clear_memoized_values()
Value.del_binfo()
Value.depends
Value.depends_set
Value.disambiguate()
Value.env
Value.env_set()
Value.executor
Value.executor_cleanup()
Value.exists()
Value.explain()
Value.for_signature()
Value.get_abspath()
Value.get_binfo()
Value.get_build_env()
Value.get_build_scanner_path()
Value.get_builder()
Value.get_cachedir_csig()
Value.get_contents()
Value.get_csig()
Value.get_env()
Value.get_env_scanner()
Value.get_executor()
Value.get_found_includes()
Value.get_implicit_deps()
Value.get_ninfo()
Value.get_source_scanner()
Value.get_state()
Value.get_stored_implicit()
Value.get_stored_info()
Value.get_string()
Value.get_subst_proxy()
Value.get_suffix()
Value.get_target_scanner()
Value.get_text_contents()
Value.has_builder()
Value.has_explicit_builder()
Value.ignore
Value.ignore_set
Value.implicit
Value.implicit_set
Value.includes
Value.is_conftest()
Value.is_derived()
Value.is_explicit
Value.is_literal()
Value.is_sconscript()
Value.is_under()
Value.is_up_to_date()
Value.linked
Value.make_ready()
Value.missing()
Value.multiple_side_effect_has_builder()
Value.new_binfo()
Value.new_ninfo()
Value.ninfo
Value.nocache
Value.noclean
Value.postprocess()
Value.precious
Value.prepare()
Value.prerequisites
Value.pseudo
Value.push_to_cache()
Value.read()
Value.ref_count
Value.release_target_info()
Value.remove()
Value.render_include_tree()
Value.reset_executor()
Value.retrieve_from_cache()
Value.rexists()
Value.scan()
Value.scanner_key()
Value.select_scanner()
Value.set_always_build()
Value.set_executor()
Value.set_explicit()
Value.set_nocache()
Value.set_noclean()
Value.set_precious()
Value.set_pseudo()
Value.set_specific_source()
Value.set_state()
Value.side_effect
Value.side_effects
Value.sources
Value.sources_set
Value.state
Value.store_info
Value.str_for_display()
Value.target_peers
Value.visited()
Value.waiting_parents
Value.waiting_s_e
Value.wkids
Value.write()
ValueBuildInfo
ValueBuildInfo.__getstate__()
ValueBuildInfo.__setstate__()
ValueBuildInfo.bact
ValueBuildInfo.bactsig
ValueBuildInfo.bdepends
ValueBuildInfo.bdependsigs
ValueBuildInfo.bimplicit
ValueBuildInfo.bimplicitsigs
ValueBuildInfo.bsources
ValueBuildInfo.bsourcesigs
ValueBuildInfo.current_version_id
ValueBuildInfo.merge()
ValueNodeInfo
ValueWithMemo()
- Module contents
- SCons.Platform package
- Module contents
- Submodules
- SCons.Platform.aix module
- SCons.Platform.cygwin module
- SCons.Platform.darwin module
- SCons.Platform.hpux module
- SCons.Platform.irix module
- SCons.Platform.mingw module
- SCons.Platform.os2 module
- SCons.Platform.posix module
- SCons.Platform.sunos module
- SCons.Platform.virtualenv module
- SCons.Platform.win32 module
- SCons.Scanner package
- Module contents
- Submodules
- SCons.Scanner.C module
CConditionalScanner()
CScanner()
SConsCPPConditionalScanner
SConsCPPConditionalScanner.__call__()
SConsCPPConditionalScanner._do_if_else_condition()
SConsCPPConditionalScanner._match_tuples()
SConsCPPConditionalScanner._parse_tuples()
SConsCPPConditionalScanner._process_tuples()
SConsCPPConditionalScanner.all_include()
SConsCPPConditionalScanner.do_define()
SConsCPPConditionalScanner.do_elif()
SConsCPPConditionalScanner.do_else()
SConsCPPConditionalScanner.do_endif()
SConsCPPConditionalScanner.do_if()
SConsCPPConditionalScanner.do_ifdef()
SConsCPPConditionalScanner.do_ifndef()
SConsCPPConditionalScanner.do_import()
SConsCPPConditionalScanner.do_include()
SConsCPPConditionalScanner.do_include_next()
SConsCPPConditionalScanner.do_nothing()
SConsCPPConditionalScanner.do_undef()
SConsCPPConditionalScanner.eval_expression()
SConsCPPConditionalScanner.finalize_result()
SConsCPPConditionalScanner.find_include_file()
SConsCPPConditionalScanner.initialize_result()
SConsCPPConditionalScanner.process_contents()
SConsCPPConditionalScanner.process_file()
SConsCPPConditionalScanner.read_file()
SConsCPPConditionalScanner.resolve_include()
SConsCPPConditionalScanner.restore()
SConsCPPConditionalScanner.save()
SConsCPPConditionalScanner.scons_current_file()
SConsCPPConditionalScanner.start_handling_includes()
SConsCPPConditionalScanner.stop_handling_includes()
SConsCPPConditionalScanner.tupleize()
SConsCPPConditionalScannerWrapper
SConsCPPScanner
SConsCPPScanner.__call__()
SConsCPPScanner._do_if_else_condition()
SConsCPPScanner._match_tuples()
SConsCPPScanner._parse_tuples()
SConsCPPScanner._process_tuples()
SConsCPPScanner.all_include()
SConsCPPScanner.do_define()
SConsCPPScanner.do_elif()
SConsCPPScanner.do_else()
SConsCPPScanner.do_endif()
SConsCPPScanner.do_if()
SConsCPPScanner.do_ifdef()
SConsCPPScanner.do_ifndef()
SConsCPPScanner.do_import()
SConsCPPScanner.do_include()
SConsCPPScanner.do_include_next()
SConsCPPScanner.do_nothing()
SConsCPPScanner.do_undef()
SConsCPPScanner.eval_expression()
SConsCPPScanner.finalize_result()
SConsCPPScanner.find_include_file()
SConsCPPScanner.initialize_result()
SConsCPPScanner.process_contents()
SConsCPPScanner.process_file()
SConsCPPScanner.read_file()
SConsCPPScanner.resolve_include()
SConsCPPScanner.restore()
SConsCPPScanner.save()
SConsCPPScanner.scons_current_file()
SConsCPPScanner.start_handling_includes()
SConsCPPScanner.stop_handling_includes()
SConsCPPScanner.tupleize()
SConsCPPScannerWrapper
dictify_CPPDEFINES()
- SCons.Scanner.D module
- SCons.Scanner.Dir module
- SCons.Scanner.Fortran module
- SCons.Scanner.IDL module
- SCons.Scanner.Java module
- SCons.Scanner.LaTeX module
FindENVPathDirs
LaTeX
LaTeX.__call__()
LaTeX._latex_names()
LaTeX._recurse_all_nodes()
LaTeX._recurse_no_nodes()
LaTeX.add_scanner()
LaTeX.add_skey()
LaTeX.canonical_text()
LaTeX.env_variables
LaTeX.find_include()
LaTeX.get_skeys()
LaTeX.keyword_paths
LaTeX.path()
LaTeX.scan()
LaTeX.scan_recurse()
LaTeX.select()
LaTeX.sort_key()
LaTeX.two_arg_commands
LaTeXScanner()
PDFLaTeXScanner()
_Null
_null
modify_env_var()
- SCons.Scanner.Prog module
- SCons.Scanner.RC module
- SCons.Scanner.SWIG module
- SCons.Script package
- Module contents
HelpFunction()
TargetList
TargetList._abc_impl
TargetList._add_Default()
TargetList._clear()
TargetList._do_nothing()
TargetList.append()
TargetList.clear()
TargetList.copy()
TargetList.count()
TargetList.extend()
TargetList.index()
TargetList.insert()
TargetList.pop()
TargetList.remove()
TargetList.reverse()
TargetList.sort()
Variables()
_Add_Arguments()
_Add_Targets()
_Get_Default_Targets()
_Set_Default_Targets()
_Set_Default_Targets_Has_Been_Called()
_Set_Default_Targets_Has_Not_Been_Called()
set_missing_sconscript_error()
- Submodules
- SCons.Script.Interactive module
SConsInteractiveCmd
SConsInteractiveCmd._do_one_help()
SConsInteractiveCmd._doc_to_help()
SConsInteractiveCmd._strip_initial_spaces()
SConsInteractiveCmd.cmdloop()
SConsInteractiveCmd.columnize()
SConsInteractiveCmd.complete()
SConsInteractiveCmd.complete_help()
SConsInteractiveCmd.completedefault()
SConsInteractiveCmd.completenames()
SConsInteractiveCmd.default()
SConsInteractiveCmd.do_EOF()
SConsInteractiveCmd.do_build()
SConsInteractiveCmd.do_clean()
SConsInteractiveCmd.do_exit()
SConsInteractiveCmd.do_help()
SConsInteractiveCmd.do_shell()
SConsInteractiveCmd.do_version()
SConsInteractiveCmd.doc_header
SConsInteractiveCmd.doc_leader
SConsInteractiveCmd.emptyline()
SConsInteractiveCmd.get_names()
SConsInteractiveCmd.identchars
SConsInteractiveCmd.intro
SConsInteractiveCmd.lastcmd
SConsInteractiveCmd.misc_header
SConsInteractiveCmd.nohelp
SConsInteractiveCmd.onecmd()
SConsInteractiveCmd.parseline()
SConsInteractiveCmd.postcmd()
SConsInteractiveCmd.postloop()
SConsInteractiveCmd.precmd()
SConsInteractiveCmd.preloop()
SConsInteractiveCmd.print_topics()
SConsInteractiveCmd.prompt
SConsInteractiveCmd.ruler
SConsInteractiveCmd.synonyms
SConsInteractiveCmd.undoc_header
SConsInteractiveCmd.use_rawinput
interact()
- SCons.Script.Main module
AddOption()
BuildTask
BuildTask.LOGGER
BuildTask._abc_impl
BuildTask._exception_raise()
BuildTask._no_exception_to_raise()
BuildTask.display()
BuildTask.do_failed()
BuildTask.exc_clear()
BuildTask.exc_info()
BuildTask.exception_set()
BuildTask.execute()
BuildTask.executed()
BuildTask.executed_with_callbacks()
BuildTask.executed_without_callbacks()
BuildTask.fail_continue()
BuildTask.fail_stop()
BuildTask.failed()
BuildTask.get_target()
BuildTask.make_ready()
BuildTask.make_ready_all()
BuildTask.make_ready_current()
BuildTask.needs_execute()
BuildTask.postprocess()
BuildTask.prepare()
BuildTask.trace_message()
CleanTask
CleanTask.LOGGER
CleanTask._abc_impl
CleanTask._clean_targets()
CleanTask._exception_raise()
CleanTask._get_files_to_clean()
CleanTask._no_exception_to_raise()
CleanTask.display()
CleanTask.exc_clear()
CleanTask.exc_info()
CleanTask.exception_set()
CleanTask.execute()
CleanTask.executed()
CleanTask.executed_with_callbacks()
CleanTask.executed_without_callbacks()
CleanTask.fail_continue()
CleanTask.fail_stop()
CleanTask.failed()
CleanTask.fs_delete()
CleanTask.get_target()
CleanTask.make_ready()
CleanTask.make_ready_all()
CleanTask.make_ready_current()
CleanTask.needs_execute()
CleanTask.postprocess()
CleanTask.prepare()
CleanTask.remove()
CleanTask.show()
CleanTask.trace_message()
DebugOptions()
FakeOptionParser
GetBuildFailures()
GetOption()
PrintHelp()
Progress()
Progressor
QuestionTask
QuestionTask.LOGGER
QuestionTask._abc_impl
QuestionTask._exception_raise()
QuestionTask._no_exception_to_raise()
QuestionTask.display()
QuestionTask.exc_clear()
QuestionTask.exc_info()
QuestionTask.exception_set()
QuestionTask.execute()
QuestionTask.executed()
QuestionTask.executed_with_callbacks()
QuestionTask.executed_without_callbacks()
QuestionTask.fail_continue()
QuestionTask.fail_stop()
QuestionTask.failed()
QuestionTask.get_target()
QuestionTask.make_ready()
QuestionTask.make_ready_all()
QuestionTask.make_ready_current()
QuestionTask.needs_execute()
QuestionTask.postprocess()
QuestionTask.prepare()
QuestionTask.trace_message()
SConsPrintHelpException
SetOption()
TreePrinter
ValidateOptions()
_SConstruct_exists()
_build_targets()
_create_path()
_exec_main()
_load_all_site_scons_dirs()
_load_site_scons_dir()
_main()
_scons_internal_error()
_scons_internal_warning()
_scons_syntax_error()
_scons_user_error()
_scons_user_warning()
_set_debug_values()
find_deepest_user_frame()
main()
path_string()
python_version_deprecated()
python_version_string()
python_version_unsupported()
revert_io()
test_load_all_site_scons_dirs()
version_string()
- SCons.Script.SConsOptions module
Parser()
SConsBadOptionError
SConsIndentedHelpFormatter
SConsIndentedHelpFormatter.NO_DEFAULT_VALUE
SConsIndentedHelpFormatter._format_text()
SConsIndentedHelpFormatter.dedent()
SConsIndentedHelpFormatter.expand_default()
SConsIndentedHelpFormatter.format_description()
SConsIndentedHelpFormatter.format_epilog()
SConsIndentedHelpFormatter.format_heading()
SConsIndentedHelpFormatter.format_option()
SConsIndentedHelpFormatter.format_option_strings()
SConsIndentedHelpFormatter.format_usage()
SConsIndentedHelpFormatter.indent()
SConsIndentedHelpFormatter.set_long_opt_delimiter()
SConsIndentedHelpFormatter.set_parser()
SConsIndentedHelpFormatter.set_short_opt_delimiter()
SConsIndentedHelpFormatter.store_local_option_strings()
SConsIndentedHelpFormatter.store_option_strings()
SConsOption
SConsOption.ACTIONS
SConsOption.ALWAYS_TYPED_ACTIONS
SConsOption.ATTRS
SConsOption.CHECK_METHODS
SConsOption.CONST_ACTIONS
SConsOption.STORE_ACTIONS
SConsOption.TYPED_ACTIONS
SConsOption.TYPES
SConsOption.TYPE_CHECKER
SConsOption._check_action()
SConsOption._check_callback()
SConsOption._check_choice()
SConsOption._check_const()
SConsOption._check_dest()
SConsOption._check_nargs()
SConsOption._check_nargs_optional()
SConsOption._check_opt_strings()
SConsOption._check_type()
SConsOption._set_attrs()
SConsOption._set_opt_strings()
SConsOption.check_value()
SConsOption.convert_value()
SConsOption.get_opt_string()
SConsOption.process()
SConsOption.take_action()
SConsOption.takes_value()
SConsOptionGroup
SConsOptionGroup._check_conflict()
SConsOptionGroup._create_option_list()
SConsOptionGroup._create_option_mappings()
SConsOptionGroup._share_option_mappings()
SConsOptionGroup.add_option()
SConsOptionGroup.add_options()
SConsOptionGroup.destroy()
SConsOptionGroup.format_description()
SConsOptionGroup.format_help()
SConsOptionGroup.format_option_help()
SConsOptionGroup.get_description()
SConsOptionGroup.get_option()
SConsOptionGroup.has_option()
SConsOptionGroup.remove_option()
SConsOptionGroup.set_conflict_handler()
SConsOptionGroup.set_description()
SConsOptionGroup.set_title()
SConsOptionParser
SConsOptionParser._add_help_option()
SConsOptionParser._add_version_option()
SConsOptionParser._check_conflict()
SConsOptionParser._create_option_list()
SConsOptionParser._create_option_mappings()
SConsOptionParser._get_all_options()
SConsOptionParser._get_args()
SConsOptionParser._init_parsing_state()
SConsOptionParser._match_long_opt()
SConsOptionParser._populate_option_list()
SConsOptionParser._process_args()
SConsOptionParser._process_long_opt()
SConsOptionParser._process_short_opts()
SConsOptionParser._share_option_mappings()
SConsOptionParser.add_local_option()
SConsOptionParser.add_option()
SConsOptionParser.add_option_group()
SConsOptionParser.add_options()
SConsOptionParser.check_values()
SConsOptionParser.destroy()
SConsOptionParser.disable_interspersed_args()
SConsOptionParser.enable_interspersed_args()
SConsOptionParser.error()
SConsOptionParser.exit()
SConsOptionParser.expand_prog_name()
SConsOptionParser.format_description()
SConsOptionParser.format_epilog()
SConsOptionParser.format_help()
SConsOptionParser.format_local_option_help()
SConsOptionParser.format_option_help()
SConsOptionParser.get_default_values()
SConsOptionParser.get_description()
SConsOptionParser.get_option()
SConsOptionParser.get_option_group()
SConsOptionParser.get_prog_name()
SConsOptionParser.get_usage()
SConsOptionParser.get_version()
SConsOptionParser.has_option()
SConsOptionParser.parse_args()
SConsOptionParser.preserve_unknown_options
SConsOptionParser.print_help()
SConsOptionParser.print_local_option_help()
SConsOptionParser.print_usage()
SConsOptionParser.print_version()
SConsOptionParser.raise_exception_on_error
SConsOptionParser.remove_option()
SConsOptionParser.reparse_local_options()
SConsOptionParser.set_conflict_handler()
SConsOptionParser.set_default()
SConsOptionParser.set_defaults()
SConsOptionParser.set_description()
SConsOptionParser.set_process_default_values()
SConsOptionParser.set_usage()
SConsOptionParser.standard_option_list
SConsValues
diskcheck_convert()
- SCons.Script.SConscript module
BuildDefaultGlobals()
Configure()
DefaultEnvironmentCall
Frame
Return()
SConsEnvironment
SConsEnvironment.Action()
SConsEnvironment.AddMethod()
SConsEnvironment.AddPostAction()
SConsEnvironment.AddPreAction()
SConsEnvironment.Alias()
SConsEnvironment.AlwaysBuild()
SConsEnvironment.Append()
SConsEnvironment.AppendENVPath()
SConsEnvironment.AppendUnique()
SConsEnvironment.Builder()
SConsEnvironment.CacheDir()
SConsEnvironment.Clean()
SConsEnvironment.Clone()
SConsEnvironment.Command()
SConsEnvironment.Configure()
SConsEnvironment.Decider()
SConsEnvironment.Default()
SConsEnvironment.Depends()
SConsEnvironment.Detect()
SConsEnvironment.Dictionary()
SConsEnvironment.Dir()
SConsEnvironment.Dump()
SConsEnvironment.EnsurePythonVersion()
SConsEnvironment.EnsureSConsVersion()
SConsEnvironment.Entry()
SConsEnvironment.Environment()
SConsEnvironment.Execute()
SConsEnvironment.Exit()
SConsEnvironment.Export()
SConsEnvironment.File()
SConsEnvironment.FindFile()
SConsEnvironment.FindInstalledFiles()
SConsEnvironment.FindIxes()
SConsEnvironment.FindSourceFiles()
SConsEnvironment.Flatten()
SConsEnvironment.GetBuildPath()
SConsEnvironment.GetLaunchDir()
SConsEnvironment.GetOption()
SConsEnvironment.GetSConsVersion()
SConsEnvironment.Glob()
SConsEnvironment.Help()
SConsEnvironment.Ignore()
SConsEnvironment.Import()
SConsEnvironment.Literal()
SConsEnvironment.Local()
SConsEnvironment.MergeFlags()
SConsEnvironment.NoCache()
SConsEnvironment.NoClean()
SConsEnvironment.Override()
SConsEnvironment.ParseConfig()
SConsEnvironment.ParseDepends()
SConsEnvironment.ParseFlags()
SConsEnvironment.Platform()
SConsEnvironment.Precious()
SConsEnvironment.Prepend()
SConsEnvironment.PrependENVPath()
SConsEnvironment.PrependUnique()
SConsEnvironment.Pseudo()
SConsEnvironment.PyPackageDir()
SConsEnvironment.RemoveMethod()
SConsEnvironment.Replace()
SConsEnvironment.ReplaceIxes()
SConsEnvironment.Repository()
SConsEnvironment.Requires()
SConsEnvironment.SConscript()
SConsEnvironment.SConscriptChdir()
SConsEnvironment.SConsignFile()
SConsEnvironment.Scanner()
SConsEnvironment.SetDefault()
SConsEnvironment.SetOption()
SConsEnvironment.SideEffect()
SConsEnvironment.Split()
SConsEnvironment.Tool()
SConsEnvironment.Value()
SConsEnvironment.VariantDir()
SConsEnvironment.WhereIs()
SConsEnvironment._canonicalize()
SConsEnvironment._changed_build()
SConsEnvironment._changed_content()
SConsEnvironment._changed_timestamp_match()
SConsEnvironment._changed_timestamp_newer()
SConsEnvironment._changed_timestamp_then_content()
SConsEnvironment._find_toolpath_dir()
SConsEnvironment._get_SConscript_filenames()
SConsEnvironment._get_major_minor_revision()
SConsEnvironment._gsm()
SConsEnvironment._init_special()
SConsEnvironment._update()
SConsEnvironment._update_onlynew()
SConsEnvironment.arg2nodes()
SConsEnvironment.backtick()
SConsEnvironment.get()
SConsEnvironment.get_CacheDir()
SConsEnvironment.get_builder()
SConsEnvironment.get_factory()
SConsEnvironment.get_scanner()
SConsEnvironment.gvars()
SConsEnvironment.items()
SConsEnvironment.keys()
SConsEnvironment.lvars()
SConsEnvironment.scanner_map_delete()
SConsEnvironment.setdefault()
SConsEnvironment.subst()
SConsEnvironment.subst_kw()
SConsEnvironment.subst_list()
SConsEnvironment.subst_path()
SConsEnvironment.subst_target_source()
SConsEnvironment.validate_CacheDir_class()
SConsEnvironment.values()
SConscriptReturn
SConscript_exception()
_SConscript()
annotate()
compute_exports()
get_DefaultEnvironmentProxy()
get_calling_namespaces()
handle_missing_SConscript()
- Module contents
- SCons.Taskmaster package
- Module contents
AlwaysTask
AlwaysTask.LOGGER
AlwaysTask._abc_impl
AlwaysTask._exception_raise()
AlwaysTask._no_exception_to_raise()
AlwaysTask.display()
AlwaysTask.exc_clear()
AlwaysTask.exc_info()
AlwaysTask.exception_set()
AlwaysTask.execute()
AlwaysTask.executed()
AlwaysTask.executed_with_callbacks()
AlwaysTask.executed_without_callbacks()
AlwaysTask.fail_continue()
AlwaysTask.fail_stop()
AlwaysTask.failed()
AlwaysTask.get_target()
AlwaysTask.make_ready()
AlwaysTask.make_ready_all()
AlwaysTask.make_ready_current()
AlwaysTask.needs_execute()
AlwaysTask.postprocess()
AlwaysTask.prepare()
AlwaysTask.trace_message()
OutOfDateTask
OutOfDateTask.LOGGER
OutOfDateTask._abc_impl
OutOfDateTask._exception_raise()
OutOfDateTask._no_exception_to_raise()
OutOfDateTask.display()
OutOfDateTask.exc_clear()
OutOfDateTask.exc_info()
OutOfDateTask.exception_set()
OutOfDateTask.execute()
OutOfDateTask.executed()
OutOfDateTask.executed_with_callbacks()
OutOfDateTask.executed_without_callbacks()
OutOfDateTask.fail_continue()
OutOfDateTask.fail_stop()
OutOfDateTask.failed()
OutOfDateTask.get_target()
OutOfDateTask.make_ready()
OutOfDateTask.make_ready_all()
OutOfDateTask.make_ready_current()
OutOfDateTask.needs_execute()
OutOfDateTask.postprocess()
OutOfDateTask.prepare()
OutOfDateTask.trace_message()
Stats
Task
Task.LOGGER
Task._abc_impl
Task._exception_raise()
Task._no_exception_to_raise()
Task.display()
Task.exc_clear()
Task.exc_info()
Task.exception_set()
Task.execute()
Task.executed()
Task.executed_with_callbacks()
Task.executed_without_callbacks()
Task.fail_continue()
Task.fail_stop()
Task.failed()
Task.get_target()
Task.make_ready()
Task.make_ready_all()
Task.make_ready_current()
Task.needs_execute()
Task.postprocess()
Task.prepare()
Task.trace_message()
Taskmaster
dump_stats()
find_cycle()
- Submodules
- SCons.Taskmaster.Job module
InterruptState
Jobs
LegacyParallel
NewParallel
NewParallel.FakeCondition
NewParallel.FakeLock
NewParallel.State
NewParallel.Worker
NewParallel.Worker._bootstrap()
NewParallel.Worker._bootstrap_inner()
NewParallel.Worker._delete()
NewParallel.Worker._initialized
NewParallel.Worker._reset_internal_locks()
NewParallel.Worker._set_ident()
NewParallel.Worker._set_native_id()
NewParallel.Worker._set_tstate_lock()
NewParallel.Worker._stop()
NewParallel.Worker._wait_for_tstate_lock()
NewParallel.Worker.daemon
NewParallel.Worker.getName()
NewParallel.Worker.ident
NewParallel.Worker.isDaemon()
NewParallel.Worker.is_alive()
NewParallel.Worker.join()
NewParallel.Worker.name
NewParallel.Worker.native_id
NewParallel.Worker.run()
NewParallel.Worker.setDaemon()
NewParallel.Worker.setName()
NewParallel.Worker.start()
NewParallel._adjust_stack_size()
NewParallel._maybe_start_worker()
NewParallel._restore_stack_size()
NewParallel._setup_logging()
NewParallel._start_worker()
NewParallel._work()
NewParallel.start()
NewParallel.trace_message()
Serial
ThreadPool
Worker
Worker._bootstrap()
Worker._bootstrap_inner()
Worker._delete()
Worker._initialized
Worker._reset_internal_locks()
Worker._set_ident()
Worker._set_native_id()
Worker._set_tstate_lock()
Worker._stop()
Worker._wait_for_tstate_lock()
Worker.daemon
Worker.getName()
Worker.ident
Worker.isDaemon()
Worker.is_alive()
Worker.join()
Worker.name
Worker.native_id
Worker.run()
Worker.setDaemon()
Worker.setName()
Worker.start()
- Module contents
- SCons.Tool package
- Module contents
CreateJarBuilder()
CreateJavaClassDirBuilder()
CreateJavaClassFileBuilder()
CreateJavaFileBuilder()
CreateJavaHBuilder()
FindAllTools()
FindTool()
Initializers()
Tool
ToolInitializer
ToolInitializerMethod
createCFileBuilders()
createLoadableModuleBuilder()
createObjBuilders()
createProgBuilder()
createSharedLibBuilder()
createStaticLibBuilder()
find_program_path()
tool_list()
- Module contents
- SCons.Util package
- Module contents
CLVar
Delegate
DispatchingFormatter
DispatchingFormatter.converter()
DispatchingFormatter.default_msec_format
DispatchingFormatter.default_time_format
DispatchingFormatter.format()
DispatchingFormatter.formatException()
DispatchingFormatter.formatMessage()
DispatchingFormatter.formatStack()
DispatchingFormatter.formatTime()
DispatchingFormatter.usesTime()
DisplayEngine
IDX()
LogicalLines
NodeList
Proxy
RegError
RegGetValue()
RegOpenKeyEx()
Selector
Split()
Unbuffered
UniqueList
WhereIs()
_NoError
_semi_deepcopy_list()
_semi_deepcopy_tuple()
adjustixes()
case_sensitive_suffixes()
cmp()
containsAll()
containsAny()
containsOnly()
dictify()
do_flatten()
flatten()
flatten_sequence()
get_native_path()
logical_lines()
make_path_relative()
print_time()
print_tree()
render_tree()
rightmost_separator()
sanitize_shell_env()
semi_deepcopy()
semi_deepcopy_dict()
silent_intern()
splitext()
unique()
uniquer_hashables()
updrive()
wait_for_process_to_die()
- Submodules
- SCons.Util.envs module
- SCons.Util.filelock module
- SCons.Util.hashes module
MD5collect()
MD5filesignature()
MD5signature()
_attempt_get_hash_function()
_attempt_init_of_python_3_9_hash_object()
_get_hash_object()
_set_allowed_viable_default_hashes()
_show_md5_warning()
get_current_hash_algorithm_used()
get_hash_format()
hash_collect()
hash_file_signature()
hash_signature()
set_hash_format()
- SCons.Util.sctypes module
- SCons.Util.stats module
- Module contents
- SCons.Variables package
- Module contents
- Submodules
- SCons.Variables.BoolVariable module
- SCons.Variables.EnumVariable module
- SCons.Variables.ListVariable module
ListVariable()
_ListVariable
_ListVariable._abc_impl
_ListVariable.append()
_ListVariable.clear()
_ListVariable.copy()
_ListVariable.count()
_ListVariable.extend()
_ListVariable.index()
_ListVariable.insert()
_ListVariable.pop()
_ListVariable.prepare_to_store()
_ListVariable.remove()
_ListVariable.reverse()
_ListVariable.sort()
_converter()
_validator()
- SCons.Variables.PackageVariable module
- SCons.Variables.PathVariable module
- SCons.compat package
Submodules#
SCons.Action module#
SCons Actions.
Information about executing any sort of action that can build one or more target Nodes (typically files) from one or more source Nodes (also typically files) given a specific Environment.
The base class here is ActionBase. The base class supplies just a few utility methods and some generic methods for displaying information about an Action in response to the various commands that control printing.
A second-level base class is _ActionAction. This extends ActionBase by providing the methods that can be used to show and perform an action. True Action objects will subclass _ActionAction; Action factory class objects will subclass ActionBase.
The heavy lifting is handled by subclasses for the different types of actions we might execute:
CommandAction CommandGeneratorAction FunctionAction ListAction
The subclasses supply the following public interface methods used by other modules:
- __call__()
THE public interface, “calling” an Action object executes the command or Python function. This also takes care of printing a pre-substitution command for debugging purposes.
- get_contents()
Fetches the “contents” of an Action for signature calculation plus the varlist. This is what gets checksummed to decide if a target needs to be rebuilt because its action changed.
- genstring()
Returns a string representation of the Action without command substitution, but allows a CommandGeneratorAction to generate the right action based on the specified target, source and env. This is used by the Signature subsystem (through the Executor) to obtain an (imprecise) representation of the Action operation for informative purposes.
Subclasses also supply the following methods for internal use within this module:
- __str__()
Returns a string approximation of the Action; no variable substitution is performed.
- execute()
The internal method that really, truly, actually handles the execution of a command or Python function. This is used so that the __call__() methods can take care of displaying any pre-substitution representations, and then execute an action without worrying about the specific Actions involved.
- get_presig()
Fetches the “contents” of a subclass for signature calculation. The varlist is added to this to produce the Action’s contents. TODO(?): Change this to always return bytes and not str?
- strfunction()
Returns a substituted string representation of the Action. This is used by the _ActionAction.show() command to display the command/function that will be executed to generate the target(s).
There is a related independent ActionCaller class that looks like a regular Action, and which serves as a wrapper for arbitrary functions that we want to let the user specify the arguments to now, but actually execute later (when an out-of-date check determines that it’s needed to be executed, for example). Objects of this class are returned by an ActionFactory class that provides a __call__() method as a convenient way for wrapping up the functions.
- class SCons.Action.ActionBase[source]#
Bases:
ABC
Base class for all types of action objects that can be held by other objects (Builders, Executors, etc.) This provides the common methods for manipulating and combining those actions.
- _abc_impl = <_abc._abc_data object>#
- batch_key(env, target, source)#
- class SCons.Action.ActionCaller(parent, args, kw)[source]#
Bases:
object
A class for delaying calling an Action function with specific (positional and keyword) arguments until the Action is actually executed.
This class looks to the rest of the world like a normal Action object, but what it’s really doing is hanging on to the arguments until we have a target, source and env to use for the expansion.
- class SCons.Action.ActionFactory(actfunc, strfunc, convert=<function ActionFactory.<lambda>>)[source]#
Bases:
object
A factory class that will wrap up an arbitrary function as an SCons-executable Action object.
The real heavy lifting here is done by the ActionCaller class. We just collect the (positional and keyword) arguments that we’re called with and give them to the ActionCaller object we create, so it can hang onto them until it needs them.
- class SCons.Action.CommandAction(cmd, **kw)[source]#
Bases:
_ActionAction
Class for command-execution actions.
- _abc_impl = <_abc._abc_data object>#
- _get_implicit_deps_heavyweight(target, source, env, executor: Executor | None, icd_int)[source]#
Heavyweight dependency scanning involves scanning more than just the first entry in an action string. The exact behavior depends on the value of icd_int. Only files are taken as implicit dependencies; directories are ignored.
If icd_int is an integer value, it specifies the number of entries to scan for implicit dependencies. Action strings are also scanned after a &&. So for example, if icd_int=2 and the action string is “cd <some_dir> && $PYTHON $SCRIPT_PATH <another_path>”, the implicit dependencies would be the path to the python binary and the path to the script.
If icd_int is None, all entries are scanned for implicit dependencies.
- _get_implicit_deps_lightweight(target, source, env, executor: Executor | None)[source]#
Lightweight dependency scanning involves only scanning the first entry in an action string, even if it contains &&.
- batch_key(env, target, source)#
- execute(target, source, env, executor: Executor | None = None)[source]#
Execute a command action.
This will handle lists of commands as well as individual commands, because construction variable substitution may turn a single “command” into a list. This means that this class can actually handle lists of commands, even though that’s not how we use it externally.
- get_contents(target, source, env)#
- get_implicit_deps(target, source, env, executor: Executor | None = None)[source]#
Return the implicit dependencies of this action’s command line.
- get_presig(target, source, env, executor: Executor | None = None)[source]#
Return the signature contents of this action’s command line.
This strips $(-$) and everything in between the string, since those parts don’t affect signatures.
- get_targets(env, executor: Executor | None)#
Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used by this action.
- no_batch_key(env, target, source)#
- presub_lines(env)#
- print_cmd_line(s, target, source, env) None #
In python 3, and in some of our tests, sys.stdout is a String io object, and it takes unicode strings only This code assumes s is a regular string.
- class SCons.Action.CommandGeneratorAction(generator, kw)[source]#
Bases:
ActionBase
Class for command-generator actions.
- _abc_impl = <_abc._abc_data object>#
- get_contents(target, source, env)#
- get_presig(target, source, env, executor: Executor | None = None)[source]#
Return the signature contents of this action’s command line.
This strips $(-$) and everything in between the string, since those parts don’t affect signatures.
- get_targets(env, executor: Executor | None)[source]#
Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used by this action.
- no_batch_key(env, target, source)#
- presub_lines(env)#
- class SCons.Action.FunctionAction(execfunction, kw)[source]#
Bases:
_ActionAction
Class for Python function actions.
- _abc_impl = <_abc._abc_data object>#
- batch_key(env, target, source)#
- get_contents(target, source, env)#
- get_presig(target, source, env, executor: Executor | None = None)[source]#
Return the signature contents of this callable action.
- get_targets(env, executor: Executor | None)#
Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used by this action.
- no_batch_key(env, target, source)#
- presub_lines(env)#
- print_cmd_line(s, target, source, env) None #
In python 3, and in some of our tests, sys.stdout is a String io object, and it takes unicode strings only This code assumes s is a regular string.
- class SCons.Action.LazyAction(var, kw)[source]#
Bases:
CommandGeneratorAction
,CommandAction
A LazyAction is a kind of hybrid generator and command action for strings of the form “$VAR”. These strings normally expand to other strings (think “$CCCOM” to “$CC -c -o $TARGET $SOURCE”), but we also want to be able to replace them with functions in the construction environment. Consequently, we want lazy evaluation and creation of an Action in the case of the function, but that’s overkill in the more normal case of expansion to other strings.
So we do this with a subclass that’s both a generator and a command action. The overridden methods all do a quick check of the construction variable, and if it’s a string we just call the corresponding CommandAction method to do the heavy lifting. If not, then we call the same-named CommandGeneratorAction method. The CommandGeneratorAction methods work by using the overridden _generate() method, that is, our own way of handling “generation” of an action based on what’s in the construction variable.
- _abc_impl = <_abc._abc_data object>#
- _get_implicit_deps_heavyweight(target, source, env, executor: Executor | None, icd_int)#
Heavyweight dependency scanning involves scanning more than just the first entry in an action string. The exact behavior depends on the value of icd_int. Only files are taken as implicit dependencies; directories are ignored.
If icd_int is an integer value, it specifies the number of entries to scan for implicit dependencies. Action strings are also scanned after a &&. So for example, if icd_int=2 and the action string is “cd <some_dir> && $PYTHON $SCRIPT_PATH <another_path>”, the implicit dependencies would be the path to the python binary and the path to the script.
If icd_int is None, all entries are scanned for implicit dependencies.
- _get_implicit_deps_lightweight(target, source, env, executor: Executor | None)#
Lightweight dependency scanning involves only scanning the first entry in an action string, even if it contains &&.
- batch_key(env, target, source)#
- execute(target, source, env, executor: Executor | None = None)#
Execute a command action.
This will handle lists of commands as well as individual commands, because construction variable substitution may turn a single “command” into a list. This means that this class can actually handle lists of commands, even though that’s not how we use it externally.
- get_contents(target, source, env)#
- get_implicit_deps(target, source, env, executor: Executor | None = None)[source]#
Return the implicit dependencies of this action’s command line.
- get_presig(target, source, env, executor: Executor | None = None)[source]#
Return the signature contents of this action’s command line.
This strips $(-$) and everything in between the string, since those parts don’t affect signatures.
- get_targets(env, executor: Executor | None)#
Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used by this action.
- no_batch_key(env, target, source)#
- presub_lines(env)#
- print_cmd_line(s, target, source, env) None #
In python 3, and in some of our tests, sys.stdout is a String io object, and it takes unicode strings only This code assumes s is a regular string.
- process(target, source, env, executor=None, overrides: dict | None = None) Tuple[List, bool, bool] #
- class SCons.Action.ListAction(actionlist)[source]#
Bases:
ActionBase
Class for lists of other actions.
- _abc_impl = <_abc._abc_data object>#
- batch_key(env, target, source)#
- get_contents(target, source, env)#
- get_presig(target, source, env, executor: Executor | None = None)[source]#
Return the signature contents of this action list.
Simple concatenation of the signatures of the elements.
- get_targets(env, executor: Executor | None)#
Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used by this action.
- no_batch_key(env, target, source)#
- class SCons.Action._ActionAction(cmdstr=<class 'SCons.Action._null'>, strfunction=<class 'SCons.Action._null'>, varlist=(), presub=<class 'SCons.Action._null'>, chdir=None, exitstatfunc=None, batch_key=None, targets: str = '$TARGETS', **kw)[source]#
Bases:
ActionBase
Base class for actions that create output objects.
- _abc_impl = <_abc._abc_data object>#
- batch_key(env, target, source)#
- get_contents(target, source, env)#
- get_targets(env, executor: Executor | None)#
Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used by this action.
- no_batch_key(env, target, source)#
- presub_lines(env)#
- SCons.Action._actionAppend(act1, act2)[source]#
Joins two actions together.
Mainly, it handles ListActions by concatenating into a single ListAction.
- SCons.Action._callable_contents(obj) bytearray [source]#
Return the signature contents of a callable Python object.
- SCons.Action._code_contents(code, docstring=None) bytearray [source]#
Return the signature contents of a code object.
By providing direct access to the code object of the function, Python makes this extremely easy. Hooray!
Unfortunately, older versions of Python include line number indications in the compiled byte code. Boo! So we remove the line number byte codes to prevent recompilations from moving a Python function.
- See:
For info on what each co_ variable provides
The signature is as follows (should be byte/chars): co_argcount, len(co_varnames), len(co_cellvars), len(co_freevars), ( comma separated signature for each object in co_consts ), ( comma separated signature for each object in co_names ), ( The bytecode with line number bytecodes removed from co_code )
co_argcount - Returns the number of positional arguments (including arguments with default values). co_varnames - Returns a tuple containing the names of the local variables (starting with the argument names). co_cellvars - Returns a tuple containing the names of local variables that are referenced by nested functions. co_freevars - Returns a tuple containing the names of free variables. (?) co_consts - Returns a tuple containing the literals used by the bytecode. co_names - Returns a tuple containing the names used by the bytecode. co_code - Returns a string representing the sequence of bytecode instructions.
- SCons.Action._do_create_action(act, kw)[source]#
The internal implementation for the Action factory method.
This handles the fact that passing lists to
Action()
itself has different semantics than passing lists as elements of lists. The former will create aListAction
, the latter will create aCommandAction
by converting the inner list elements to strings.
- SCons.Action._do_create_keywords(args, kw)[source]#
This converts any arguments after the action argument into their equivalent keywords and adds them to the kw argument.
- SCons.Action._do_create_list_action(act, kw) ListAction [source]#
A factory for list actions.
Convert the input list act into Actions and then wrap them in a
ListAction
. If act has only a single member, return that member, not a ListAction. This is intended to allow a contained list to specify a command action without being processed into a list action.
- SCons.Action._function_contents(func) bytearray [source]#
Return the signature contents of a function.
The signature is as follows (should be byte/chars): < _code_contents (see above) from func.__code__ > ,( comma separated _object_contents for function argument defaults) ,( comma separated _object_contents for any closure contents )
- See also: https://docs.python.org/3/reference/datamodel.html
func.__code__ - The code object representing the compiled function body.
func.__defaults__ - A tuple containing default argument values for those arguments that have defaults, or None if no arguments have a default value
func.__closure__ - None or a tuple of cells that contain bindings for the function’s free variables.
- SCons.Action._object_contents(obj) bytearray [source]#
Return the signature contents of any Python object.
We have to handle the case where object contains a code object since it can be pickled directly.
- SCons.Action._object_instance_content(obj)[source]#
Returns consistant content for a action class or an instance thereof
- Parameters:
obj Should be either and action class or an instance thereof
- Returns:
bytearray or bytes representing the obj suitable for generating a signature from.
- SCons.Action._resolve_shell_env(env, target, source)[source]#
Returns a resolved execution environment.
First get the execution environment. Then if
SHELL_ENV_GENERATORS
is set and is iterable, call each function to allow it to alter the created execution environment, passing each the returned execution environment from the previous call.Added in version 4.4.
- SCons.Action._string_from_cmd_list(cmd_list)[source]#
Takes a list of command line arguments and returns a pretty representation for printing.
- SCons.Action._subproc(scons_env, cmd, error='ignore', **kw)[source]#
Wrapper for subprocess.Popen which pulls from construction env.
Use for calls to subprocess which need to interpolate values from an SCons construction environment into the environment passed to subprocess. Adds an an error-handling argument. Adds ability to specify std{in,out,err} with “‘devnull’” tag.
Deprecated since version 4.6.
- SCons.Action.get_default_ENV(env)[source]#
Returns an execution environment.
If there is one in env, just use it, else return the Default Environment, insantiated if necessary.
A fiddlin’ little function that has an
import SCons.Environment
which cannot be moved to the top level without creating an import loop. Since this import creates a local variable namedSCons
, it blocks access to the global variable, so we move it here to prevent complaints about local variables being used uninitialized.
- SCons.Action.scons_subproc_run(scons_env, *args, **kwargs) CompletedProcess [source]#
Run an external command using an SCons execution environment.
SCons normally runs external build commands using
subprocess
, but does not harvest any output from such commands. This function is a thin wrapper aroundsubprocess.run()
allowing running a command in an SCons context (i.e. uses an “execution environment” rather than the user’s existing environment), and provides the ability to return any output in asubprocess.CompletedProcess
instance (this must be selected by settingstdout
and/orstderr
toPIPE
, or settingcapture_output=True
- see Keyword Arguments). Typical use case is to run a tool’s “version” option to find out the installed version.If supplied, the
env
keyword argument provides an execution environment to process into appropriate form before it is supplied tosubprocess
; if omitted, scons_env is used to derive a suitable default. The other keyword arguments are passed through, except that the SCons legacyerror
keyword is remapped to the subprocesscheck
keyword; if both are omittedcheck=False
will be passed. The caller is responsible for setting up the desired arguments forsubprocess.run()
.This function retains the legacy behavior of returning something vaguely usable even in the face of complete failure, unless
check=True
(in which case an error is allowed to be raised): it synthesizes aCompletedProcess
instance in this case.A subset of interesting keyword arguments follows; see the Python documentation of
subprocess
for the complete list.- Keyword Arguments:
stdout – (and stderr, stdin) if set to
subprocess.PIPE
. send input to or collect output from the relevant stream in the subprocess; the defaultNone
does no redirection (i.e. output or errors may go to the console or log file, but is not captured); if set tosubprocess.DEVNULL
they are explicitly thrown away.capture_output=True
is a synonym for setting bothstdout
andstderr
toPIPE
.text – open stdin, stdout, stderr in text mode. Default is binary mode.
universal_newlines
is a synonym.encoding – specifies an encoding. Changes to text mode.
errors – specified error handling. Changes to text mode.
input – a byte sequence to be passed to stdin, unless text mode is enabled, in which case it must be a string.
shell – if true, the command is executed through the shell.
check – if true and the subprocess exits with a non-zero exit code, raise a
subprocess.CalledProcessError
exception. Otherwise (the default) in case of anOSError
, report the exit code in theCompletedProcess
instance.
Added in version 4.6.
SCons.Builder module#
SCons.Builder
Builder object subsystem.
A Builder object is a callable that encapsulates information about how to execute actions to create a target Node (file) from source Nodes (files), and how to create those dependencies for tracking.
The main entry point here is the Builder() factory method. This provides a procedural interface that creates the right underlying Builder object based on the keyword arguments supplied and the types of the arguments.
The goal is for this external interface to be simple enough that the vast majority of users can create new Builders as necessary to support building new types of files in their configurations, without having to dive any deeper into this subsystem.
The base class here is BuilderBase. This is a concrete base class which does, in fact, represent the Builder objects that we (or users) create.
There is also a proxy that looks like a Builder:
CompositeBuilder
This proxies for a Builder with an action that is actually a dictionary that knows how to map file suffixes to a specific action. This is so that we can invoke different actions (compilers, compile options) for different flavors of source files.
Builders and their proxies have the following public interface methods used by other modules:
- __call__()
THE public interface. Calling a Builder object (with the use of internal helper methods) sets up the target and source dependencies, appropriate mapping to a specific action, and the environment manipulation necessary for overridden construction variable. This also takes care of warning about possible mistakes in keyword arguments.
- add_emitter()
Adds an emitter for a specific file suffix, used by some Tool modules to specify that (for example) a yacc invocation on a .y can create a .h and a .c file.
- add_action()
Adds an action for a specific file suffix, heavily used by Tool modules to add their specific action(s) for turning a source file into an object file to the global static and shared object file Builders.
There are the following methods for internal use within this module:
- _execute()
The internal method that handles the heavily lifting when a Builder is called. This is used so that the __call__() methods can set up warning about possible mistakes in keyword-argument overrides, and then execute all of the steps necessary so that the warnings only occur once.
- get_name()
Returns the Builder’s name within a specific Environment, primarily used to try to return helpful information in error messages.
adjust_suffix()
get_prefix()
get_suffix()
get_src_suffix()
- set_src_suffix()
Miscellaneous stuff for handling the prefix and suffix manipulation we use in turning source file names into target file names.
- class SCons.Builder.BuilderBase(action=None, prefix: str = '', suffix: str = '', src_suffix: str = '', target_factory=None, source_factory=None, target_scanner=None, source_scanner=None, emitter=None, multi: bool = False, env=None, single_source: bool = False, name=None, chdir=<class 'SCons.Builder._Null'>, is_explicit: bool = True, src_builder=None, ensure_suffix: bool = False, **overrides)[source]#
Bases:
object
Base class for Builders, objects that create output nodes (files) from input nodes (files).
- _create_nodes(env, target=None, source=None)[source]#
Create and return lists of target and source nodes.
- _get_sdict(env)[source]#
Returns a dictionary mapping all of the source suffixes of all src_builders of this Builder to the underlying Builder that should be called first.
This dictionary is used for each target specified, so we save a lot of extra computation by memoizing it for each construction environment.
Note that this is re-computed each time, not cached, because there might be changes to one of our source Builders (or one of their source Builders, and so on, and so on…) that we can’t “see.”
The underlying methods we call cache their computed values, though, so we hope repeatedly aggregating them into a dictionary like this won’t be too big a hit. We may need to look for a better way to do this if performance data show this has turned into a significant bottleneck.
- add_emitter(suffix, emitter) None [source]#
Add a suffix-emitter mapping to this Builder.
This assumes that emitter has been initialized with an appropriate dictionary type, and will throw a TypeError if not, so the caller is responsible for knowing that this is an appropriate method to call for the Builder in question.
- add_src_builder(builder) None [source]#
Add a new Builder to the list of src_builders.
This requires wiping out cached values so that the computed lists of source suffixes get re-calculated.
- get_name(env)[source]#
Attempts to get the name of the Builder.
Look at the BUILDERS variable of env, expecting it to be a dictionary containing this Builder, and return the key of the dictionary. If there’s no key, then return a directly-configured name (if there is one) or the name of the class (by default).
- get_src_builders(env)[source]#
Returns the list of source Builders for this Builder.
This exists mainly to look up Builders referenced as strings in the ‘BUILDER’ variable of the construction environment and cache the result.
- class SCons.Builder.CallableSelector[source]#
Bases:
Selector
A callable dictionary that will, in turn, call the value it finds if it can.
- clear() None. Remove all items from D. #
- copy() a shallow copy of D #
- fromkeys(value=None, /)#
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)#
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items #
- keys() a set-like object providing a view on D's keys #
- pop(k[, d]) v, remove specified key and return the corresponding value. #
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()#
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)#
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. #
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values #
- class SCons.Builder.CompositeBuilder(builder, cmdgen)[source]#
Bases:
Proxy
A Builder Proxy whose main purpose is to always have a DictCmdGenerator as its action, and to provide access to the DictCmdGenerator’s add_action() method.
- __getattr__(name)#
Retrieve an attribute from the wrapped object.
- Raises:
AttributeError – if attribute name doesn’t exist.
- get()#
Retrieve the entire wrapped object
- class SCons.Builder.DictCmdGenerator(mapping=None, source_ext_match: bool = True)[source]#
Bases:
Selector
This is a callable class that can be used as a command generator function. It holds on to a dictionary mapping file suffixes to Actions. It uses that dictionary to return the proper action based on the file suffix of the source file.
- clear() None. Remove all items from D. #
- copy() a shallow copy of D #
- fromkeys(value=None, /)#
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)#
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items #
- keys() a set-like object providing a view on D's keys #
- pop(k[, d]) v, remove specified key and return the corresponding value. #
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()#
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)#
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. #
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values #
- class SCons.Builder.DictEmitter[source]#
Bases:
Selector
A callable dictionary that maps file suffixes to emitters. When called, it finds the right emitter in its dictionary for the suffix of the first source file, and calls that emitter to get the right lists of targets and sources to return. If there’s no emitter for the suffix in its dictionary, the original target and source are returned.
- clear() None. Remove all items from D. #
- copy() a shallow copy of D #
- fromkeys(value=None, /)#
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)#
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items #
- keys() a set-like object providing a view on D's keys #
- pop(k[, d]) v, remove specified key and return the corresponding value. #
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()#
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)#
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. #
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values #
- class SCons.Builder.EmitterProxy(var)[source]#
Bases:
object
This is a callable class that can act as a Builder emitter. It holds on to a string that is a key into an Environment dictionary, and will look there at actual build time to see if it holds a callable. If so, we will call that as the actual emitter.
- class SCons.Builder.ListEmitter(initlist=None)[source]#
Bases:
UserList
A callable list of emitters that calls each in sequence, returning the result.
- _abc_impl = <_abc._abc_data object>#
- append(item)#
S.append(value) – append value to the end of the sequence
- clear() None -- remove all items from S #
- copy()#
- count(value) integer -- return number of occurrences of value #
- extend(other)#
S.extend(iterable) – extend sequence by appending elements from the iterable
- index(value[, start[, stop]]) integer -- return first index of value. #
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- insert(i, item)#
S.insert(index, value) – insert value before index
- pop([index]) item -- remove and return item at index (default last). #
Raise IndexError if list is empty or index is out of range.
- remove(item)#
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- reverse()#
S.reverse() – reverse IN PLACE
- sort(*args, **kwds)#
- class SCons.Builder.OverrideWarner(mapping)[source]#
Bases:
UserDict
A class for warning about keyword arguments that we use as overrides in a Builder call.
This class exists to handle the fact that a single Builder call can actually invoke multiple builders. This class only emits the warnings once, no matter how many Builders are invoked.
- _abc_impl = <_abc._abc_data object>#
- clear() None. Remove all items from D. #
- copy()#
- classmethod fromkeys(iterable, value=None)#
- get(k[, d]) D[k] if k in D, else d. d defaults to None. #
- items() a set-like object providing a view on D's items #
- keys() a set-like object providing a view on D's keys #
- pop(k[, d]) v, remove specified key and return the corresponding value. #
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair #
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D #
- update([E, ]**F) None. Update D from mapping/iterable E and F. #
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values #
- SCons.Builder._node_errors(builder, env, tlist, slist)[source]#
Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate.
SCons.CacheDir module#
CacheDir support
- class SCons.CacheDir.CacheDir(path)[source]#
Bases:
object
- _readconfig(path)[source]#
Read the cache config.
If directory or config file do not exist, create. Take advantage of Py3 capability in os.makedirs() and in file open(): just try the operation and handle failure appropriately.
Omit the check for old cache format, assume that’s old enough there will be none of those left to worry about.
- Parameters:
path – path to the cache directory
- cachepath(node) tuple [source]#
Return where to cache a file.
Given a Node, obtain the configured cache directory and the path to the cached file, which is generated from the node’s build signature. If caching is not enabled for the None, return a tuple of None.
- classmethod copy_to_cache(env, src, dst) str [source]#
Copy a file to cache.
Just use the FS copy2 (“with metadata”) method, except do an additional check and if necessary a chmod to ensure the cachefile is writeable, to forestall permission problems if the cache entry is later updated.
- property hit_ratio: float#
- property misses: int#
- retrieve(node) bool [source]#
Retrieve a node from cache.
Returns True if a successful retrieval resulted.
This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in built().
Note that there’s a special trick here with the execute flag (one that’s not normally done for other actions). Basically if the user requested a no_exec (-n) build, then SCons.Action.execute_actions is set to 0 and when any action is called, it does its showing but then just returns zero instead of actually calling the action execution operation. The problem for caching is that if the file does NOT exist in cache then the CacheRetrieveString won’t return anything to show for the task, but the Action.__call__ won’t call CacheRetrieveFunc; instead it just returns zero, which makes the code below think that the file was successfully retrieved from the cache, therefore it doesn’t do any subsequent building. However, the CacheRetrieveString didn’t print anything because it didn’t actually exist in the cache, and no more build actions will be performed, so the user just sees nothing. The fix is to tell Action.__call__ to always execute the CacheRetrieveFunc and then have the latter explicitly check SCons.Action.execute_actions itself.
SCons.Conftest module#
Autoconf-like configuration support
The purpose of this module is to define how a check is to be performed.
A context class is used that defines functions for carrying out the tests, logging and messages. The following methods and members must be present:
- context.Display(msg)
Function called to print messages that are normally displayed for the user. Newlines are explicitly used. The text should also be written to the logfile!
- context.Log(msg)
Function called to write to a log file.
- context.BuildProg(text, ext)
Function called to build a program, using “ext” for the file extension. Must return an empty string for success, an error message for failure. For reliable test results building should be done just like an actual program would be build, using the same command and arguments (including configure results so far).
- context.CompileProg(text, ext)
Function called to compile a program, using “ext” for the file extension. Must return an empty string for success, an error message for failure. For reliable test results compiling should be done just like an actual source file would be compiled, using the same command and arguments (including configure results so far).
- context.AppendLIBS(lib_name_list)
Append “lib_name_list” to the value of LIBS. “lib_namelist” is a list of strings. Return the value of LIBS before changing it (any type can be used, it is passed to SetLIBS() later.)
- context.PrependLIBS(lib_name_list)
Prepend “lib_name_list” to the value of LIBS. “lib_namelist” is a list of strings. Return the value of LIBS before changing it (any type can be used, it is passed to SetLIBS() later.)
- context.SetLIBS(value)
Set LIBS to “value”. The type of “value” is what AppendLIBS() returned. Return the value of LIBS before changing it (any type can be used, it is passed to SetLIBS() later.)
- context.headerfilename
Name of file to append configure results to, usually “confdefs.h”. The file must not exist or be empty when starting. Empty or None to skip this (some tests will not work!).
- context.config_h (may be missing).
If present, must be a string, which will be filled with the contents of a config_h file.
- context.vardict
Dictionary holding variables used for the tests and stores results from the tests, used for the build commands. Normally contains “CC”, “LIBS”, “CPPFLAGS”, etc.
- context.havedict
Dictionary holding results from the tests that are to be used inside a program. Names often start with “HAVE_”. These are zero (feature not present) or one (feature present). Other variables may have any value, e.g., “PERLVERSION” can be a number and “SYSTEMNAME” a string.
- SCons.Conftest.CheckBuilder(context, text=None, language=None)[source]#
Configure check to see if the compiler works. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly. “language” should be “C” or “C++” and is used to select the compiler. Default is “C”. “text” may be used to specify the code to be build. Returns an empty string for success, an error message for failure.
- SCons.Conftest.CheckCC(context)[source]#
Configure check for a working C compiler.
This checks whether the C compiler, as defined in the $CC construction variable, can compile a C source file. It uses the current $CCCOM value too, so that it can test against non working flags.
- SCons.Conftest.CheckCXX(context)[source]#
Configure check for a working CXX compiler.
This checks whether the CXX compiler, as defined in the $CXX construction variable, can compile a CXX source file. It uses the current $CXXCOM value too, so that it can test against non working flags.
- SCons.Conftest.CheckDeclaration(context, symbol, includes=None, language=None)[source]#
Checks whether symbol is declared.
Use the same test as autoconf, that is test whether the symbol is defined as a macro or can be used as an r-value.
- Parameters:
symbol – str the symbol to check
includes – str Optional “header” can be defined to include a header file.
language – str only C and C++ supported.
- Returns:
- bool
True if the check failed, False if succeeded.
- Return type:
status
- SCons.Conftest.CheckFunc(context, function_name, header=None, language=None, funcargs=None)[source]#
Configure check for a function “function_name”. “language” should be “C” or “C++” and is used to select the compiler. Default is “C”. Optional “header” can be defined to define a function prototype, include a header file or anything else that comes before main(). Optional “funcargs” can be defined to define an argument list for the generated function invocation. Sets HAVE_function_name in context.havedict according to the result. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly. Returns an empty string for success, an error message for failure.
Changed in version 4.7.0: The
funcargs
parameter was added.
- SCons.Conftest.CheckHeader(context, header_name, header=None, language=None, include_quotes=None)[source]#
Configure check for a C or C++ header file “header_name”. Optional “header” can be defined to do something before including the header file (unusual, supported for consistency). “language” should be “C” or “C++” and is used to select the compiler. Default is “C”. Sets HAVE_header_name in context.havedict according to the result. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS and $CPPFLAGS are set correctly. Returns an empty string for success, an error message for failure.
- SCons.Conftest.CheckLib(context, libs, func_name=None, header=None, extra_libs=None, call=None, language=None, autoadd: int = 1, append: bool = True, unique: bool = False)[source]#
Configure check for a C or C++ libraries “libs”. Searches through the list of libraries, until one is found where the test succeeds. Tests if “func_name” or “call” exists in the library. Note: if it exists in another library the test succeeds anyway! Optional “header” can be defined to include a header file. If not given a default prototype for “func_name” is added. Optional “extra_libs” is a list of library names to be added after “lib_name” in the build command. To be used for libraries that “lib_name” depends on. Optional “call” replaces the call to “func_name” in the test code. It must consist of complete C statements, including a trailing “;”. Both “func_name” and “call” arguments are optional, and in that case, just linking against the libs is tested. “language” should be “C” or “C++” and is used to select the compiler. Default is “C”. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly. Returns an empty string for success, an error message for failure.
- SCons.Conftest.CheckMember(context, aggregate_member, header=None, language=None)[source]#
Configure check for a C or C++ member “aggregate_member”. Optional “header” can be defined to include a header file. “language” should be “C” or “C++” and is used to select the compiler. Default is “C”. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.
- Parameters:
aggregate_member – str the member to check. For example, ‘struct tm.tm_gmtoff’.
includes – str Optional “header” can be defined to include a header file.
language – str only C and C++ supported.
Returns the status (0 or False = Passed, True/non-zero = Failed).
- SCons.Conftest.CheckProg(context, prog_name)[source]#
Configure check for a specific program.
Check whether program prog_name exists in path. If it is found, returns the path for it, otherwise returns None.
- SCons.Conftest.CheckSHCC(context)[source]#
Configure check for a working shared C compiler.
This checks whether the C compiler, as defined in the $SHCC construction variable, can compile a C source file. It uses the current $SHCCCOM value too, so that it can test against non working flags.
- SCons.Conftest.CheckSHCXX(context)[source]#
Configure check for a working shared CXX compiler.
This checks whether the CXX compiler, as defined in the $SHCXX construction variable, can compile a CXX source file. It uses the current $SHCXXCOM value too, so that it can test against non working flags.
- SCons.Conftest.CheckType(context, type_name, fallback=None, header=None, language=None)[source]#
Configure check for a C or C++ type “type_name”. Optional “header” can be defined to include a header file. “language” should be “C” or “C++” and is used to select the compiler. Default is “C”. Sets HAVE_type_name in context.havedict according to the result. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly. Returns an empty string for success, an error message for failure.
- SCons.Conftest.CheckTypeSize(context, type_name, header=None, language=None, expect=None)[source]#
This check can be used to get the size of a given type, or to check whether the type is of expected size.
- Parameters:
type (-) – str the type to check
includes (-) – sequence list of headers to include in the test code before testing the type
language (-) – str ‘C’ or ‘C++’
expect (-) – int if given, will test wether the type has the given number of bytes. If not given, will automatically find the size.
Returns –
- statusint
0 if the check failed, or the found size of the type if the check succeeded.
- SCons.Conftest._Have(context, key, have, comment=None) None [source]#
Store result of a test in context.havedict and context.headerfilename.
- Parameters:
key - is a “HAVE_abc” name. It is turned into all CAPITALS and non-alphanumerics are replaced by an underscore.
have - value as it should appear in the header file, include quotes when desired and escape special characters!
comment is the C comment to add above the line defining the symbol (the comment is automatically put inside a /* */). If None, no comment is added.
- The value of “have” can be:
1 - Feature is defined, add “#define key”.
0 - Feature is not defined, add “/* #undef key */”. Adding “undef” is what autoconf does. Not useful for the compiler, but it shows that the test was done.
number - Feature is defined to this number “#define key have”. Doesn’t work for 0 or 1, use a string then.
string - Feature is defined to this string “#define key have”.
- SCons.Conftest._LogFailed(context, text, msg) None [source]#
Write to the log about a failed program. Add line numbers, so that error messages can be understood.
- SCons.Conftest._YesNoResult(context, ret, key, text, comment=None) None [source]#
Handle the result of a test with a “yes” or “no” result.
- Parameters:
ret is the return value: empty if OK, error message when not.
key is the name of the symbol to be defined (HAVE_foo).
text is the source code of the program used for testing.
comment is the C comment to add above the line defining the symbol (the comment is automatically put inside a /* */). If None, no comment is added.
- SCons.Conftest._check_empty_program(context, comp, text, language, use_shared: bool = False)[source]#
Return 0 on success, 1 otherwise.
- SCons.Conftest._lang2suffix(lang)[source]#
Convert a language name to a suffix. When “lang” is empty or None C is assumed. Returns a tuple (lang, suffix, None) when it works. For an unrecognized language returns (None, None, msg).
- Where:
lang = the unified language name
suffix = the suffix, including the leading dot
msg = an error message
SCons.Debug module#
Code for debugging SCons internal things.
Shouldn’t be needed by most users. Quick shortcuts:
from SCons.Debug import caller_trace
caller_trace()
- SCons.Debug.Trace(msg, tracefile=None, mode: str = 'w', tstamp: bool = False) None [source]#
Write a trace message.
Write messages when debugging which do not interfere with stdout. Useful in tests, which monitor stdout and would break with unexpected output. Trace messages can go to the console (which is opened as a file), or to a disk file; the tracefile argument persists across calls unless overridden.
- Parameters:
tracefile – file to write trace message to. If omitted, write to the previous trace file (default: console).
mode – file open mode (default: ‘w’)
tstamp – write relative timestamps with trace. Outputs time since scons was started, and time since last trace (default: False)
- SCons.Debug.caller_trace(back: int = 0) None [source]#
Trace caller stack and save info into global dicts, which are printed automatically at the end of SCons execution.
- SCons.Debug.countLoggedInstances(classes, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) None [source]#
- SCons.Debug.dumpLoggedInstances(classes, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) None [source]#
- SCons.Debug.dump_caller_counts(file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) None [source]#
SCons.Defaults module#
Builders and other things for the local site.
Here’s where we’ll duplicate the functionality of autoconf until we move it into the installation procedure or use something like qmconf.
The code that reads the registry to find MSVC components was borrowed from distutils.msvccompiler.
- SCons.Defaults.DefaultEnvironment(*args, **kwargs)[source]#
Construct the global (“default”) construction environment.
The environment is provisioned with the values from kwargs.
After the environment is created, this function is replaced with a reference to
_fetch_DefaultEnvironment()
which efficiently returns the initialized default construction environment without checking for its existence.Historically, some parts of the code held references to this function. Thus it still has the existence check for
_default_env
rather than just blindly creating the environment and overwriting itself.
- class SCons.Defaults.NullCmdGenerator(cmd)[source]#
Bases:
object
Callable class for use as a no-effect command generator.
The
__call__
method for this class simply returns the thing you instantiated it with. Example usage:env["DO_NOTHING"] = NullCmdGenerator env["LINKCOM"] = "${DO_NOTHING('$LINK $SOURCES $TARGET')}"
- class SCons.Defaults.Variable_Method_Caller(variable, method)[source]#
Bases:
object
A class for finding a construction variable on the stack and calling one of its methods.
Used to support “construction variables” appearing in string
eval``s that actually stand in for methods--specifically, the use of "RDirs" in a call to :func:`_concat` that should actually execute the ``TARGET.RDirs
method.Historical note: This was formerly supported by creating a little “build dictionary” that mapped RDirs to the method, but this got in the way of Memoizing construction environments, because we had to create new environment objects to hold the variables.
- SCons.Defaults.__lib_either_version_flag(env, version_var1, version_var2, flags_var)[source]#
if $version_var1 or $version_var2 is not empty, returns env[flags_var], otherwise returns None :param env: :param version_var1: :param version_var2: :param flags_var: :return:
- SCons.Defaults.__libversionflags(env, version_var, flags_var)[source]#
if version_var is not empty, returns env[flags_var], otherwise returns None :param env: :param version_var: :param flags_var: :return:
- SCons.Defaults._concat(prefix, items_iter, suffix, env, f=<function <lambda>>, target=None, source=None, affect_signature: bool = True)[source]#
Creates a new list from ‘items_iter’ by first interpolating each element in the list using the ‘env’ dictionary and then calling f on the list, and finally calling _concat_ixes to concatenate ‘prefix’ and ‘suffix’ onto each element of the list.
- SCons.Defaults._concat_ixes(prefix, items_iter, suffix, env)[source]#
Creates a new list from ‘items_iter’ by concatenating the ‘prefix’ and ‘suffix’ arguments onto each element of the list. A trailing space on ‘prefix’ or leading space on ‘suffix’ will cause them to be put into separate list elements rather than being concatenated.
- SCons.Defaults._defines(prefix, defs, suffix, env, target=None, source=None, c=<function _concat_ixes>)[source]#
A wrapper around
_concat_ixes()
that turns a list or string into a list of C preprocessor command-line definitions.
- SCons.Defaults._fetch_DefaultEnvironment(*args, **kwargs)[source]#
Returns the already-created default construction environment.
- SCons.Defaults._stripixes(prefix: str, items, suffix: str, stripprefixes: List[str], stripsuffixes: List[str], env, literal_prefix: str = '', c: Callable[[list], list] = None) list [source]#
Returns a list with text added to items after first stripping them.
A companion to
_concat_ixes()
, used by tools (like the GNU linker) that need to turn something likelibfoo.a
into-lfoo
. stripprefixes and stripsuffixes are stripped from items. Calls function c to postprocess the result.- Parameters:
prefix – string to prepend to elements
items – string or iterable to transform
suffix – string to append to elements
stripprefixes – prefix string(s) to strip from elements
stripsuffixes – suffix string(s) to strip from elements
env – construction environment for variable interpolation
c – optional function to perform a transformation on the list. The default is None, which will select
_concat_ixes()
.
- SCons.Defaults.chmod_func(dest, mode) None [source]#
Implementation of the Chmod action function.
mode can be either an integer (normally expressed in octal mode, as in 0o755) or a string following the syntax of the POSIX chmod command (for example “ugo+w”). The latter must be converted, since the underlying Python only takes the numeric form.
- SCons.Defaults.copy_func(dest, src, symlinks: bool = True) int [source]#
Implementation of the Copy action function.
Copies src to dest. If src is a list, dest must be a directory, or not exist (will be created).
Since Python
shutil
methods, which know nothing about SCons Nodes, will be called to perform the actual copying, args are converted to strings first.If symlinks evaluates true, then a symbolic link will be shallow copied and recreated as a symbolic link; otherwise, copying a symbolic link will be equivalent to copying the symbolic link’s final target regardless of symbolic link depth.
- SCons.Defaults.copy_strfunc(dest, src, symlinks: bool = True) str [source]#
strfunction for the Copy action function.
- SCons.Defaults.delete_func(dest, must_exist: bool = False) None [source]#
Implementation of the Delete action function.
Lets the Python
os.unlink()
raise an error if dest does not exist, unless must_exist evaluates false (the default).
- SCons.Defaults.delete_strfunc(dest, must_exist: bool = False) str [source]#
strfunction for the Delete action function.
- SCons.Defaults.get_paths_str(dest) str [source]#
Generates a string from dest for use in a strfunction.
If dest is a list, manually converts each elem to a string.
- SCons.Defaults.processDefines(defs) List[str] [source]#
Return list of strings for preprocessor defines from defs.
Resolves the different forms
CPPDEFINES
can be assembled in: if the Append/Prepend routines are used beyond a initial setting it will be a deque, but if written to only once (Environment initializer, or direct write) it can be a multitude of types.Any prefix/suffix is handled elsewhere (usually
_concat_ixes()
).Changed in version 4.5.0: Bare tuples are now treated the same as tuple-in-sequence, assumed to describe a valued macro. Bare strings are now split on space. A dictionary is no longer sorted before handling.
SCons.Environment module#
Base class for construction Environments.
These are the primary objects used to communicate dependency and construction information to the build engine.
Keyword arguments supplied when the construction Environment is created are construction variables used to initialize the Environment.
- class SCons.Environment.Base(platform=None, tools=None, toolpath=None, variables=None, parse_flags=None, **kw)[source]#
Bases:
SubstitutionEnvironment
Base class for “real” construction Environments.
These are the primary objects used to communicate dependency and construction information to the build engine.
Keyword arguments supplied when the construction Environment is created are construction variables used to initialize the Environment.
- AddMethod(function, name=None) None #
Adds the specified function as a method of this construction environment with the specified name. If the name is omitted, the default name is the name of the function itself.
- Append(**kw) None [source]#
Append values to construction variables in an Environment.
The variable is created if it is not already present.
- AppendENVPath(name, newpath, envname: str = 'ENV', sep=':', delete_existing: bool = False) None [source]#
Append path elements to the path name in the envname dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string.
If delete_existing is False, a newpath element already in the path will not be moved to the end (it will be left where it is).
- AppendUnique(delete_existing: bool = False, **kw) None [source]#
Append values uniquely to existing construction variables.
Similar to
Append()
, but the result may not contain duplicates of any values passed for each given key (construction variable), so an existing list may need to be pruned first, however it may still contain other duplicates.If delete_existing is true, removes existing values first, so values move to the end; otherwise (the default) values are skipped if already present.
- Clone(tools=[], toolpath=None, variables=None, parse_flags=None, **kw)[source]#
Return a copy of a construction Environment.
The copy is like a Python “deep copy”: independent copies are made recursively of each object, except that a reference is copied when an object is not deep-copyable (like a function). There are no references to any mutable objects in the original environment.
Unrecognized keyword arguments are taken as construction variable assignments.
- Parameters:
tools – list of tools to initialize.
toolpath – list of paths to search for tools.
variables – a
Variables
object to use to populate construction variables from command-line variables.parse_flags – option strings to parse into construction variables.
Added in version 4.8.0: The optional variables parameter was added.
- Command(target, source, action, **kw)[source]#
Set up a one-off build command.
Builds target from source using action, which may be be any type that the Builder factory will accept for an action. Generates an anonymous builder and calls it, to add the details to the build graph. The builder is not named, added to
BUILDERS
, or otherwise saved.Recognizes the
Builder()
keywordssource_scanner
,target_scanner
,source_factory
andtarget_factory
. All other arguments from kw are passed on to the builder when it is called.
- Detect(progs)[source]#
Return the first available program from one or more possibilities.
- Parameters:
progs (str or list) – one or more command names to check for
- Dictionary(*args)[source]#
Return construction variables from an environment.
- Parameters:
*args (optional) – variable names to look up
- Returns:
If args omitted, the dictionary of all construction variables. If one arg, the corresponding value is returned. If more than one arg, a list of values is returned.
- Raises:
KeyError – if any of args is not in the construction environment.
- Dump(*key: str, format: str = 'pretty') str [source]#
Return string of serialized construction variables.
Produces a “pretty” output of a dictionary of selected construction variables, or all of them. The display format is selectable. The result is intended for human consumption (e.g, to print), mainly when debugging. Objects that cannot directly be represented get a placeholder like
<function foo at 0x123456>
(pretty-print) or<<non-serializable: function>>
(JSON).- Parameters:
key – if omitted, format the whole dict of variables, else format *key*(s) with the corresponding values.
format – specify the format to serialize to.
"pretty"
generates a pretty-printed string,"json"
a JSON-formatted string.
- Raises:
ValueError – format is not a recognized serialization format.
Changed in version NEXT_VERSION: key is no longer limited to a single construction variable name. If key is supplied, a formatted dictionary is generated like the no-arg case - previously a single key displayed just the value.
- FindIxes(paths: Sequence[str], prefix: str, suffix: str) str | None [source]#
Search paths for a path that has prefix and suffix.
Returns on first match.
- Parameters:
paths – the list of paths or nodes.
prefix – construction variable for the prefix.
suffix – construction variable for the suffix.
- Returns:
The matched path or
None
- Glob(pattern, ondisk: bool = True, source: bool = False, strings: bool = False, exclude=None)[source]#
- MergeFlags(args, unique: bool = True) None #
Merge flags into construction variables.
Merges the flags from args into this construction environent. If args is not a dict, it is first converted to one with flags distributed into appropriate construction variables. See
ParseFlags()
.As a side effect, if unique is true, a new object is created for each modified construction variable by the loop at the end. This is silently expected by the
Override()
parse_flags functionality, which does not want to share the list (or whatever) with the environment being overridden.- Parameters:
args – flags to merge
unique – merge flags rather than appending (default: True). When merging, path variables are retained from the front, other construction variables from the end.
- Override(overrides)#
Produce a modified environment whose variables are overridden by the overrides dictionaries. “overrides” is a dictionary that will override the variables of this environment.
This function is much more efficient than Clone() or creating a new Environment because it doesn’t copy the construction environment dictionary, it just wraps the underlying construction environment, and doesn’t even create a wrapper object if there are no overrides.
- ParseConfig(command, function=None, unique: bool = True)[source]#
Parse the result of running a command to update construction vars.
Use
function
to parse the output of runningcommand
in order to modify the current environment.- Parameters:
command – a string or a list of strings representing a command and its arguments.
function – called to process the result of
command
, which will be passed asargs
. Iffunction
is omitted orNone
,MergeFlags()
is used. Takes 3 args(env, args, unique)
unique – whether no duplicate values are allowed (default true)
- ParseDepends(filename, must_exist=None, only_one: bool = False)[source]#
Parse a mkdep-style file for explicit dependencies. This is completely abusable, and should be unnecessary in the “normal” case of proper SCons configuration, but it may help make the transition from a Make hierarchy easier for some people to swallow. It can also be genuinely useful when using a tool that can write a .d file, but for which writing a scanner would be too complicated.
- ParseFlags(*flags) dict #
Return a dict of parsed flags.
Parse
flags
and return a dict with the flags distributed into the appropriate construction variable names. The flags are treated as a typical set of command-line flags for a GNU-style toolchain, such as might have been generated by one of the {foo}-config scripts, and used to populate the entries based on knowledge embedded in this method - the choices are not expected to be portable to other toolchains.If one of the
flags
strings begins with a bang (exclamation mark), it is assumed to be a command and the rest of the string is executed; the result of that evaluation is then added to the dict.
- Prepend(**kw) None [source]#
Prepend values to construction variables in an Environment.
The variable is created if it is not already present.
- PrependENVPath(name, newpath, envname: str = 'ENV', sep=':', delete_existing: bool = True) None [source]#
Prepend path elements to the path name in the envname dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string.
If delete_existing is False, a newpath component already in the path will not be moved to the front (it will be left where it is).
- PrependUnique(delete_existing: bool = False, **kw) None [source]#
Prepend values uniquely to existing construction variables.
Similar to
Prepend()
, but the result may not contain duplicates of any values passed for each given key (construction variable), so an existing list may need to be pruned first, however it may still contain other duplicates.If delete_existing is true, removes existing values first, so values move to the front; otherwise (the default) values are skipped if already present.
- RemoveMethod(function) None #
Removes the specified function’s MethodWrapper from the added_methods list, so we don’t re-bind it when making a clone.
- Replace(**kw) None [source]#
Replace existing construction variables in an Environment with new construction variables and/or values.
- ReplaceIxes(path, old_prefix, old_suffix, new_prefix, new_suffix)[source]#
Replace old_prefix with new_prefix and old_suffix with new_suffix.
env - Environment used to interpolate variables. path - the path that will be modified. old_prefix - construction variable for the old prefix. old_suffix - construction variable for the old suffix. new_prefix - construction variable for the new prefix. new_suffix - construction variable for the new suffix.
- Requires(target, prerequisite)[source]#
Specify that prerequisite must be built before target.
Creates an order-only relationship, not a full dependency. prerequisite must exist before target can be built, but a change to prerequisite does not trigger a rebuild of target.
- SideEffect(side_effect, target)[source]#
Tell scons that side_effects are built as side effects of building targets.
- Split(arg)[source]#
This function converts a string or list into a list of strings or Nodes. This makes things easier for users by allowing files to be specified as a white-space separated list to be split.
- The input rules are:
A single string containing names separated by spaces. These will be split apart at the spaces.
A single Node instance
A list containing either strings or Node instances. Any strings in the list are not split at spaces.
In all cases, the function returns a list of Nodes and strings.
- Tool(tool: str | Callable, toolpath: Collection[str] | None = None, **kwargs) Callable [source]#
Find and run tool module tool.
tool is generally a string, but can also be a callable object, in which case it is just called, without any of the setup. The skipped setup includes storing kwargs into the created
Tool
instance, which is extracted and used when the instance is called, so in the skip case, the called object will not get the kwargs.Changed in version 4.2: returns the tool object rather than
None
.
- Value(value, built_value=None, name=None)[source]#
Return a Value (Python expression) node.
Changed in version 4.0: the name parameter was added.
- _canonicalize(path)[source]#
Allow Dirs and strings beginning with # for top-relative.
Note this uses the current env’s fs (in self).
- _init_special() None #
Initial the dispatch tables for special handling of special construction variables.
- _update(other) None [source]#
Private method to update an environment’s consvar dict directly.
Bypasses the normal checks that occur when users try to set items.
- _update_onlynew(other) None [source]#
Private method to add new items to an environment’s consvar dict.
Only adds items from other whose keys do not already appear in the existing dict; values from other are not used for replacement. Bypasses the normal checks that occur when users try to set items.
- arg2nodes(args, node_factory=<class 'SCons.Environment._Null'>, lookup_list=<class 'SCons.Environment._Null'>, **kw)#
Converts args to a list of nodes.
- Parameters:
just (args - filename strings or nodes to convert; nodes are) – added to the list without further processing.
not (node_factory - optional factory to create the nodes; if) – specified, will use this environment’s ``fs.File method.
to (lookup_list - optional list of lookup functions to call) – attempt to find the file referenced by each args.
add. (kw - keyword arguments that represent additional nodes to)
- backtick(command) str #
Emulate command substitution.
Provides behavior conceptually like POSIX Shell notation for running a command in backquotes (backticks) by running
command
and returning the resulting output string.This is not really a public API any longer, it is provided for the use of
ParseFlags()
(which supports it using a syntax of !command) andParseConfig()
.- Raises:
OSError – if the external command returned non-zero exit status.
- get(key, default=None)#
Emulates the get() method of dictionaries.
- get_factory(factory, default: str = 'File')[source]#
Return a factory function for creating Nodes for this construction environment.
- gvars()#
- items()#
Emulates the items() method of dictionaries.
- keys()#
Emulates the keys() method of dictionaries.
- lvars()#
- setdefault(key, default=None)#
Emulates the setdefault() method of dictionaries.
- subst(string, raw: int = 0, target=None, source=None, conv=None, executor: Executor | None = None, overrides: dict | None = None)#
Recursively interpolates construction variables from the Environment into the specified string, returning the expanded result. Construction variables are specified by a $ prefix in the string and begin with an initial underscore or alphabetic character followed by any number of underscores or alphanumeric characters. The construction variable names may be surrounded by curly braces to separate the name from trailing characters.
- subst_kw(kw, raw: int = 0, target=None, source=None)#
- subst_list(string, raw: int = 0, target=None, source=None, conv=None, executor: Executor | None = None, overrides: dict | None = None)#
Calls through to SCons.Subst.scons_subst_list().
See the documentation for that function.
- subst_path(path, target=None, source=None)#
Substitute a path list.
Turns EntryProxies into Nodes, leaving Nodes (and other objects) as-is.
- subst_target_source(string, raw: int = 0, target=None, source=None, conv=None, executor: Executor | None = None, overrides: dict | None = None)#
Recursively interpolates construction variables from the Environment into the specified string, returning the expanded result. Construction variables are specified by a $ prefix in the string and begin with an initial underscore or alphabetic character followed by any number of underscores or alphanumeric characters. The construction variable names may be surrounded by curly braces to separate the name from trailing characters.
- validate_CacheDir_class(custom_class=None)[source]#
Validate the passed custom CacheDir class, or if no args are passed, validate the custom CacheDir class from the environment.
- values()#
Emulates the values() method of dictionaries.
- class SCons.Environment.BuilderDict(mapping, env)[source]#
Bases:
UserDict
This is a dictionary-like class used by an Environment to hold the Builders. We need to do this because every time someone changes the Builders in the Environment’s BUILDERS dictionary, we must update the Environment’s attributes.
- _abc_impl = <_abc._abc_data object>#
- clear() None. Remove all items from D. #
- copy()#
- classmethod fromkeys(iterable, value=None)#
- get(k[, d]) D[k] if k in D, else d. d defaults to None. #
- items() a set-like object providing a view on D's items #
- keys() a set-like object providing a view on D's keys #
- pop(k[, d]) v, remove specified key and return the corresponding value. #
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair #
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D #
- update([E, ]**F) None. Update D from mapping/iterable E and F. [source]#
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values #
- class SCons.Environment.BuilderWrapper(obj: Any, method: Callable, name: str | None = None)[source]#
Bases:
MethodWrapper
A MethodWrapper subclass that that associates an environment with a Builder.
This mainly exists to wrap the __call__() function so that all calls to Builders can have their argument lists massaged in the same way (treat a lone argument as the source, treat two arguments as target then source, make sure both target and source are lists) without having to have cut-and-paste code to do it.
As a bit of obsessive backwards compatibility, we also intercept attempts to get or set the “env” or “builder” attributes, which were the names we used before we put the common functionality into the MethodWrapper base class. We’ll keep this around for a while in case people shipped Tool modules that reached into the wrapper (like the Tool/qt.py module does, or did). There shouldn’t be a lot attribute fetching or setting on these, so a little extra work shouldn’t hurt.
- clone(new_object)#
Returns an object that re-binds the underlying “method” to the specified new object.
- SCons.Environment.NoSubstitutionProxy(subject)[source]#
An entry point for returning a proxy subclass instance that overrides the subst*() methods so they don’t actually perform construction variable substitution. This is specifically intended to be the shim layer in between global function calls (which don’t want construction variable substitution) and the DefaultEnvironment() (which would substitute variables if left to its own devices).
We have to wrap this in a function that allows us to delay definition of the class until it’s necessary, so that when it subclasses Environment it will pick up whatever Environment subclass the wrapper interface might have assigned to SCons.Environment.Environment.
- class SCons.Environment.OverrideEnvironment(subject, overrides=None)[source]#
Bases:
Base
A proxy that overrides variables in a wrapped construction environment by returning values from an overrides dictionary in preference to values from the underlying subject environment.
This is a lightweight (I hope) proxy that passes through most use of attributes to the underlying Environment.Base class, but has just enough additional methods defined to act like a real construction environment with overridden values. It can wrap either a Base construction environment, or another OverrideEnvironment, which can in turn nest arbitrary OverrideEnvironments…
Note that we do not call the underlying base class (SubsitutionEnvironment) initialization, because we get most of those from proxying the attributes of the subject construction environment. But because we subclass SubstitutionEnvironment, this class also has inherited arg2nodes() and subst*() methods; those methods can’t be proxied because they need this object’s methods to fetch the values from the overrides dictionary.
- Action(*args, **kw)#
- AddMethod(function, name=None) None #
Adds the specified function as a method of this construction environment with the specified name. If the name is omitted, the default name is the name of the function itself.
- AddPostAction(files, action)#
- AddPreAction(files, action)#
- Alias(target, source=[], action=None, **kw)#
- AlwaysBuild(*targets)#
- Append(**kw) None #
Append values to construction variables in an Environment.
The variable is created if it is not already present.
- AppendENVPath(name, newpath, envname: str = 'ENV', sep=':', delete_existing: bool = False) None #
Append path elements to the path name in the envname dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string.
If delete_existing is False, a newpath element already in the path will not be moved to the end (it will be left where it is).
- AppendUnique(delete_existing: bool = False, **kw) None #
Append values uniquely to existing construction variables.
Similar to
Append()
, but the result may not contain duplicates of any values passed for each given key (construction variable), so an existing list may need to be pruned first, however it may still contain other duplicates.If delete_existing is true, removes existing values first, so values move to the end; otherwise (the default) values are skipped if already present.
- Builder(**kw)#
- CacheDir(path, custom_class=None) None #
- Clean(targets, files) None #
- Clone(tools=[], toolpath=None, variables=None, parse_flags=None, **kw)#
Return a copy of a construction Environment.
The copy is like a Python “deep copy”: independent copies are made recursively of each object, except that a reference is copied when an object is not deep-copyable (like a function). There are no references to any mutable objects in the original environment.
Unrecognized keyword arguments are taken as construction variable assignments.
- Parameters:
tools – list of tools to initialize.
toolpath – list of paths to search for tools.
variables – a
Variables
object to use to populate construction variables from command-line variables.parse_flags – option strings to parse into construction variables.
Added in version 4.8.0: The optional variables parameter was added.
- Command(target, source, action, **kw)#
Set up a one-off build command.
Builds target from source using action, which may be be any type that the Builder factory will accept for an action. Generates an anonymous builder and calls it, to add the details to the build graph. The builder is not named, added to
BUILDERS
, or otherwise saved.Recognizes the
Builder()
keywordssource_scanner
,target_scanner
,source_factory
andtarget_factory
. All other arguments from kw are passed on to the builder when it is called.
- Configure(*args, **kw)#
- Decider(function)#
- Depends(target, dependency)#
Explicity specify that target depends on dependency.
- Detect(progs)#
Return the first available program from one or more possibilities.
- Parameters:
progs (str or list) – one or more command names to check for
- Dictionary(*args)[source]#
Return construction variables from an environment.
- Parameters:
*args (optional) – variable names to look up
- Returns:
If args omitted, the dictionary of all construction variables. If one arg, the corresponding value is returned. If more than one arg, a list of values is returned.
- Raises:
KeyError – if any of args is not in the construction environment.
- Dir(name, *args, **kw)#
- Dump(*key: str, format: str = 'pretty') str #
Return string of serialized construction variables.
Produces a “pretty” output of a dictionary of selected construction variables, or all of them. The display format is selectable. The result is intended for human consumption (e.g, to print), mainly when debugging. Objects that cannot directly be represented get a placeholder like
<function foo at 0x123456>
(pretty-print) or<<non-serializable: function>>
(JSON).- Parameters:
key – if omitted, format the whole dict of variables, else format *key*(s) with the corresponding values.
format – specify the format to serialize to.
"pretty"
generates a pretty-printed string,"json"
a JSON-formatted string.
- Raises:
ValueError – format is not a recognized serialization format.
Changed in version NEXT_VERSION: key is no longer limited to a single construction variable name. If key is supplied, a formatted dictionary is generated like the no-arg case - previously a single key displayed just the value.
- Entry(name, *args, **kw)#
- Environment(**kw)#
- Execute(action, *args, **kw)#
Directly execute an action through an Environment
- File(name, *args, **kw)#
- FindFile(file, dirs)#
- FindInstalledFiles()#
returns the list of all targets of the Install and InstallAs Builder.
- FindIxes(paths: Sequence[str], prefix: str, suffix: str) str | None #
Search paths for a path that has prefix and suffix.
Returns on first match.
- Parameters:
paths – the list of paths or nodes.
prefix – construction variable for the prefix.
suffix – construction variable for the suffix.
- Returns:
The matched path or
None
- FindSourceFiles(node: str = '.') list #
Return a list of all source files.
- Flatten(sequence)#
- GetBuildPath(files)#
- Glob(pattern, ondisk: bool = True, source: bool = False, strings: bool = False, exclude=None)#
- Ignore(target, dependency)#
Ignore a dependency.
- Literal(string)#
- Local(*targets)#
- MergeFlags(args, unique: bool = True) None #
Merge flags into construction variables.
Merges the flags from args into this construction environent. If args is not a dict, it is first converted to one with flags distributed into appropriate construction variables. See
ParseFlags()
.As a side effect, if unique is true, a new object is created for each modified construction variable by the loop at the end. This is silently expected by the
Override()
parse_flags functionality, which does not want to share the list (or whatever) with the environment being overridden.- Parameters:
args – flags to merge
unique – merge flags rather than appending (default: True). When merging, path variables are retained from the front, other construction variables from the end.
- NoCache(*targets)#
Tag target(s) so that it will not be cached.
- NoClean(*targets)#
Tag target(s) so that it will not be cleaned by -c.
- Override(overrides)#
Produce a modified environment whose variables are overridden by the overrides dictionaries. “overrides” is a dictionary that will override the variables of this environment.
This function is much more efficient than Clone() or creating a new Environment because it doesn’t copy the construction environment dictionary, it just wraps the underlying construction environment, and doesn’t even create a wrapper object if there are no overrides.
- ParseConfig(command, function=None, unique: bool = True)#
Parse the result of running a command to update construction vars.
Use
function
to parse the output of runningcommand
in order to modify the current environment.- Parameters:
command – a string or a list of strings representing a command and its arguments.
function – called to process the result of
command
, which will be passed asargs
. Iffunction
is omitted orNone
,MergeFlags()
is used. Takes 3 args(env, args, unique)
unique – whether no duplicate values are allowed (default true)
- ParseDepends(filename, must_exist=None, only_one: bool = False)#
Parse a mkdep-style file for explicit dependencies. This is completely abusable, and should be unnecessary in the “normal” case of proper SCons configuration, but it may help make the transition from a Make hierarchy easier for some people to swallow. It can also be genuinely useful when using a tool that can write a .d file, but for which writing a scanner would be too complicated.
- ParseFlags(*flags) dict #
Return a dict of parsed flags.
Parse
flags
and return a dict with the flags distributed into the appropriate construction variable names. The flags are treated as a typical set of command-line flags for a GNU-style toolchain, such as might have been generated by one of the {foo}-config scripts, and used to populate the entries based on knowledge embedded in this method - the choices are not expected to be portable to other toolchains.If one of the
flags
strings begins with a bang (exclamation mark), it is assumed to be a command and the rest of the string is executed; the result of that evaluation is then added to the dict.
- Platform(platform)#
- Precious(*targets)#
Mark targets as precious: do not delete before building.
- Prepend(**kw) None #
Prepend values to construction variables in an Environment.
The variable is created if it is not already present.
- PrependENVPath(name, newpath, envname: str = 'ENV', sep=':', delete_existing: bool = True) None #
Prepend path elements to the path name in the envname dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string.
If delete_existing is False, a newpath component already in the path will not be moved to the front (it will be left where it is).
- PrependUnique(delete_existing: bool = False, **kw) None #
Prepend values uniquely to existing construction variables.
Similar to
Prepend()
, but the result may not contain duplicates of any values passed for each given key (construction variable), so an existing list may need to be pruned first, however it may still contain other duplicates.If delete_existing is true, removes existing values first, so values move to the front; otherwise (the default) values are skipped if already present.
- Pseudo(*targets)#
Mark targets as pseudo: must not exist.
- PyPackageDir(modulename)#
- RemoveMethod(function) None #
Removes the specified function’s MethodWrapper from the added_methods list, so we don’t re-bind it when making a clone.
- Replace(**kw) None [source]#
Replace existing construction variables in an Environment with new construction variables and/or values.
- ReplaceIxes(path, old_prefix, old_suffix, new_prefix, new_suffix)#
Replace old_prefix with new_prefix and old_suffix with new_suffix.
env - Environment used to interpolate variables. path - the path that will be modified. old_prefix - construction variable for the old prefix. old_suffix - construction variable for the old suffix. new_prefix - construction variable for the new prefix. new_suffix - construction variable for the new suffix.
- Repository(*dirs, **kw) None #
Specify Repository directories to search.
- Requires(target, prerequisite)#
Specify that prerequisite must be built before target.
Creates an order-only relationship, not a full dependency. prerequisite must exist before target can be built, but a change to prerequisite does not trigger a rebuild of target.
- SConsignFile(name='.sconsign', dbm_module=None) None #
- Scanner(*args, **kw)#
- SetDefault(**kw) None #
- SideEffect(side_effect, target)#
Tell scons that side_effects are built as side effects of building targets.
- Split(arg)#
This function converts a string or list into a list of strings or Nodes. This makes things easier for users by allowing files to be specified as a white-space separated list to be split.
- The input rules are:
A single string containing names separated by spaces. These will be split apart at the spaces.
A single Node instance
A list containing either strings or Node instances. Any strings in the list are not split at spaces.
In all cases, the function returns a list of Nodes and strings.
- Tool(tool: str | Callable, toolpath: Collection[str] | None = None, **kwargs) Callable #
Find and run tool module tool.
tool is generally a string, but can also be a callable object, in which case it is just called, without any of the setup. The skipped setup includes storing kwargs into the created
Tool
instance, which is extracted and used when the instance is called, so in the skip case, the called object will not get the kwargs.Changed in version 4.2: returns the tool object rather than
None
.
- Value(value, built_value=None, name=None)#
Return a Value (Python expression) node.
Changed in version 4.0: the name parameter was added.
- VariantDir(variant_dir, src_dir, duplicate: int = 1) None #
- WhereIs(prog, path=None, pathext=None, reject=None)#
Find prog in the path.
- _canonicalize(path)#
Allow Dirs and strings beginning with # for top-relative.
Note this uses the current env’s fs (in self).
- _changed_build(dependency, target, prev_ni, repo_node=None) bool #
- _changed_content(dependency, target, prev_ni, repo_node=None) bool #
- _changed_timestamp_match(dependency, target, prev_ni, repo_node=None) bool #
- _changed_timestamp_newer(dependency, target, prev_ni, repo_node=None) bool #
- _changed_timestamp_then_content(dependency, target, prev_ni, repo_node=None) bool #
- _find_toolpath_dir(tp)#
- _gsm()#
- _init_special() None #
Initial the dispatch tables for special handling of special construction variables.
- _update(other) None [source]#
Private method to update an environment’s consvar dict directly.
Bypasses the normal checks that occur when users try to set items.
- _update_onlynew(other) None [source]#
Update a dict with new keys.
Unlike the .update method, if the key is already present, it is not replaced.
- arg2nodes(args, node_factory=<class 'SCons.Environment._Null'>, lookup_list=<class 'SCons.Environment._Null'>, **kw)#
Converts args to a list of nodes.
- Parameters:
just (args - filename strings or nodes to convert; nodes are) – added to the list without further processing.
not (node_factory - optional factory to create the nodes; if) – specified, will use this environment’s ``fs.File method.
to (lookup_list - optional list of lookup functions to call) – attempt to find the file referenced by each args.
add. (kw - keyword arguments that represent additional nodes to)
- backtick(command) str #
Emulate command substitution.
Provides behavior conceptually like POSIX Shell notation for running a command in backquotes (backticks) by running
command
and returning the resulting output string.This is not really a public API any longer, it is provided for the use of
ParseFlags()
(which supports it using a syntax of !command) andParseConfig()
.- Raises:
OSError – if the external command returned non-zero exit status.
- get_CacheDir()#
- get_builder(name)#
Fetch the builder with the specified name from the environment.
- get_factory(factory, default: str = 'File')#
Return a factory function for creating Nodes for this construction environment.
- get_scanner(skey)#
Find the appropriate scanner given a key (usually a file suffix).
- scanner_map_delete(kw=None) None #
Delete the cached scanner map (if we need to).
- subst(string, raw: int = 0, target=None, source=None, conv=None, executor: Executor | None = None, overrides: dict | None = None)#
Recursively interpolates construction variables from the Environment into the specified string, returning the expanded result. Construction variables are specified by a $ prefix in the string and begin with an initial underscore or alphabetic character followed by any number of underscores or alphanumeric characters. The construction variable names may be surrounded by curly braces to separate the name from trailing characters.
- subst_kw(kw, raw: int = 0, target=None, source=None)#
- subst_list(string, raw: int = 0, target=None, source=None, conv=None, executor: Executor | None = None, overrides: dict | None = None)#
Calls through to SCons.Subst.scons_subst_list().
See the documentation for that function.
- subst_path(path, target=None, source=None)#
Substitute a path list.
Turns EntryProxies into Nodes, leaving Nodes (and other objects) as-is.
- subst_target_source(string, raw: int = 0, target=None, source=None, conv=None, executor: Executor | None = None, overrides: dict | None = None)#
Recursively interpolates construction variables from the Environment into the specified string, returning the expanded result. Construction variables are specified by a $ prefix in the string and begin with an initial underscore or alphabetic character followed by any number of underscores or alphanumeric characters. The construction variable names may be surrounded by curly braces to separate the name from trailing characters.
- validate_CacheDir_class(custom_class=None)#
Validate the passed custom CacheDir class, or if no args are passed, validate the custom CacheDir class from the environment.
- class SCons.Environment.SubstitutionEnvironment(**kw)[source]#
Bases:
object
Base class for different flavors of construction environments.
This class contains a minimal set of methods that handle construction variable expansion and conversion of strings to Nodes, which may or may not be actually useful as a stand-alone class. Which methods ended up in this class is pretty arbitrary right now. They’re basically the ones which we’ve empirically determined are common to the different construction environment subclasses, and most of the others that use or touch the underlying dictionary of construction variables.
Eventually, this class should contain all the methods that we determine are necessary for a “minimal” interface to the build engine. A full “native Python” SCons environment has gotten pretty heavyweight with all of the methods and Tools and construction variables we’ve jammed in there, so it would be nice to have a lighter weight alternative for interfaces that don’t need all of the bells and whistles. (At some point, we’ll also probably rename this class “Base,” since that more reflects what we want this class to become, but because we’ve released comments that tell people to subclass Environment.Base to create their own flavors of construction environment, we’ll save that for a future refactoring when this class actually becomes useful.)
- AddMethod(function, name=None) None [source]#
Adds the specified function as a method of this construction environment with the specified name. If the name is omitted, the default name is the name of the function itself.
- MergeFlags(args, unique: bool = True) None [source]#
Merge flags into construction variables.
Merges the flags from args into this construction environent. If args is not a dict, it is first converted to one with flags distributed into appropriate construction variables. See
ParseFlags()
.As a side effect, if unique is true, a new object is created for each modified construction variable by the loop at the end. This is silently expected by the
Override()
parse_flags functionality, which does not want to share the list (or whatever) with the environment being overridden.- Parameters:
args – flags to merge
unique – merge flags rather than appending (default: True). When merging, path variables are retained from the front, other construction variables from the end.
- Override(overrides)[source]#
Produce a modified environment whose variables are overridden by the overrides dictionaries. “overrides” is a dictionary that will override the variables of this environment.
This function is much more efficient than Clone() or creating a new Environment because it doesn’t copy the construction environment dictionary, it just wraps the underlying construction environment, and doesn’t even create a wrapper object if there are no overrides.
- ParseFlags(*flags) dict [source]#
Return a dict of parsed flags.
Parse
flags
and return a dict with the flags distributed into the appropriate construction variable names. The flags are treated as a typical set of command-line flags for a GNU-style toolchain, such as might have been generated by one of the {foo}-config scripts, and used to populate the entries based on knowledge embedded in this method - the choices are not expected to be portable to other toolchains.If one of the
flags
strings begins with a bang (exclamation mark), it is assumed to be a command and the rest of the string is executed; the result of that evaluation is then added to the dict.
- RemoveMethod(function) None [source]#
Removes the specified function’s MethodWrapper from the added_methods list, so we don’t re-bind it when making a clone.
- _init_special() None [source]#
Initial the dispatch tables for special handling of special construction variables.
- arg2nodes(args, node_factory=<class 'SCons.Environment._Null'>, lookup_list=<class 'SCons.Environment._Null'>, **kw)[source]#
Converts args to a list of nodes.
- Parameters:
just (args - filename strings or nodes to convert; nodes are) – added to the list without further processing.
not (node_factory - optional factory to create the nodes; if) – specified, will use this environment’s ``fs.File method.
to (lookup_list - optional list of lookup functions to call) – attempt to find the file referenced by each args.
add. (kw - keyword arguments that represent additional nodes to)
- backtick(command) str [source]#
Emulate command substitution.
Provides behavior conceptually like POSIX Shell notation for running a command in backquotes (backticks) by running
command
and returning the resulting output string.This is not really a public API any longer, it is provided for the use of
ParseFlags()
(which supports it using a syntax of !command) andParseConfig()
.- Raises:
OSError – if the external command returned non-zero exit status.
- subst(string, raw: int = 0, target=None, source=None, conv=None, executor: Executor | None = None, overrides: dict | None = None)[source]#
Recursively interpolates construction variables from the Environment into the specified string, returning the expanded result. Construction variables are specified by a $ prefix in the string and begin with an initial underscore or alphabetic character followed by any number of underscores or alphanumeric characters. The construction variable names may be surrounded by curly braces to separate the name from trailing characters.
- subst_list(string, raw: int = 0, target=None, source=None, conv=None, executor: Executor | None = None, overrides: dict | None = None)[source]#
Calls through to SCons.Subst.scons_subst_list().
See the documentation for that function.
- subst_path(path, target=None, source=None)[source]#
Substitute a path list.
Turns EntryProxies into Nodes, leaving Nodes (and other objects) as-is.
- subst_target_source(string, raw: int = 0, target=None, source=None, conv=None, executor: Executor | None = None, overrides: dict | None = None)#
Recursively interpolates construction variables from the Environment into the specified string, returning the expanded result. Construction variables are specified by a $ prefix in the string and begin with an initial underscore or alphabetic character followed by any number of underscores or alphanumeric characters. The construction variable names may be surrounded by curly braces to separate the name from trailing characters.
- SCons.Environment._add_cppdefines(env_dict: dict, val, prepend: bool = False, unique: bool = False, delete_existing: bool = False) None [source]#
Adds to
CPPDEFINES
, using the rules for C preprocessor macros.This is split out from regular construction variable addition because these entries can express either a macro with a replacement value or one without. A macro with replacement value can be supplied as val in three ways: as a combined string
"name=value"
; as a tuple(name, value)
, or as an entry in a dictionary{"name": value}
. A list argument with multiple macros can also be given.Additions can be unconditional (duplicates allowed) or uniquing (no dupes).
Note if a replacement value is supplied, unique requires a full match to decide uniqueness - both the macro name and the replacement. The inner
_is_in()
is used to figure that out.- Parameters:
env_dict – the dictionary containing the
CPPDEFINES
to be modified.val – the value to add, can be string, sequence or dict
prepend – whether to put val in front or back.
unique – whether to add val if it already exists.
delete_existing – if unique is true, add val after removing previous.
Added in version 4.5.0.
SCons.Errors module#
SCons exception classes.
Used to handle internal and user errors in SCons.
- exception SCons.Errors.BuildError(node=None, errstr: str = 'Unknown error', status: int = 2, exitstatus: int = 2, filename=None, executor: SCons.Executor.Executor | None = None, action=None, command=None, exc_info=(None, None, None))[source]#
Bases:
Exception
SCons Errors that can occur while building.
A
BuildError
exception contains information both about the erorr itself, and what caused the error.- Variables:
node – (cause) the error occurred while building this target node(s)
errstr – (info) a description of the error message
status – (info) the return code of the action that caused the build error. Must be set to a non-zero value even if the build error is not due to an action returning a non-zero returned code.
exitstatus – (info) SCons exit status due to this build error. Must be nonzero unless due to an explicit
Exit()
call. Not always the same asstatus
, since actions return a status code that should be respected, but SCons typically exits with 2 irrespective of the return value of the failed action.filename – (info) The name of the file or directory that caused the build error. Set to
None
if no files are associated with this error. This might be different from the target being built. For example, failure to create the directory in which the target file will appear. It can beNone
if the error is not due to a particular filename.executor – (cause) the executor that caused the build to fail (might be
None
if the build failures is not due to the executor failing)action – (cause) the action that caused the build to fail (might be
None
if the build failures is not due to the an action failure)command – (cause) the command line for the action that caused the build to fail (might be
None
if the build failures is not due to the an action failure)exc_info – (info) Info about exception that caused the build error. Set to
(None, None, None)
if this build error is not due to an exception.
- SCons.Errors.convert_to_BuildError(status, exc_info=None)[source]#
Convert a return code to a BuildError Exception.
The buildError.status we set here will normally be used as the exit status of the “scons” process.
- Parameters:
status – can either be a return code or an Exception.
exc_info (tuple, optional) – explicit exception information.
SCons.Executor module#
Execute actions with specific lists of target and source Nodes.
- class SCons.Executor.Batch(targets=[], sources=[])[source]#
Bases:
object
Remembers exact association between targets and sources of executor.
- sources#
- targets#
- class SCons.Executor.Executor(action, env=None, overridelist=[{}], targets=[], sources=[], builder_kw={})[source]#
Bases:
object
A class for controlling instances of executing an action.
This largely exists to hold a single association of an action, environment, list of environment override dictionaries, targets and sources for later processing as needed.
- _changed_sources_list#
- _changed_targets_list#
- _do_execute#
- _execute_str#
- _memo#
- _unchanged_sources_list#
- _unchanged_targets_list#
- action_list#
- add_batch(targets, sources) None [source]#
Add pair of associated target and source to this Executor’s list. This is necessary for “batch” Builders that can be called repeatedly to build up a list of matching target and source files that will be used in order to update multiple target files at once from multiple corresponding source files, for tools like MSVC that support it.
- add_sources(sources) None [source]#
Add source files to this Executor’s list. This is necessary for “multi” Builders that can be called repeatedly to build up a source file list for a given target.
- batches#
- builder_kw#
- env#
- get_action_side_effects()[source]#
Returns all side effects for all batches of this Executor used by the underlying Action.
- get_all_children()[source]#
Returns all unique children (dependencies) for all batches of this Executor.
The Taskmaster can recognize when it’s already evaluated a Node, so we don’t have to make this list unique for its intended canonical use case, but we expect there to be a lot of redundancy (long lists of batched .cc files #including the same .h files over and over), so removing the duplicates once up front should save the Taskmaster a lot of work.
- get_all_prerequisites()[source]#
Returns all unique (order-only) prerequisites for all batches of this Executor.
- get_build_scanner_path(scanner)[source]#
Fetch the scanner path for this executor’s targets and sources.
- get_contents()[source]#
Fetch the signature contents. This is the main reason this class exists, so we can compute this once and cache it regardless of how many target or source Nodes there are.
Returns bytes
- get_implicit_deps()[source]#
Return the executor’s implicit dependencies, i.e. the nodes of the commands to be executed.
- get_timestamp() int [source]#
Fetch a time stamp for this Executor. We don’t have one, of course (only files do), but this is the interface used by the timestamp module.
- lvars#
- overridelist#
- post_actions#
- pre_actions#
- prepare()[source]#
Preparatory checks for whether this Executor can go ahead and (try to) build its targets.
- class SCons.Executor.Null(*args, **kw)[source]#
Bases:
object
A null Executor, with a null build Environment, that does nothing when the rest of the methods call it.
This might be able to disappear when we refactor things to disassociate Builders from Nodes entirely, so we’re not going to worry about unit tests for this–at least for now.
- _changed_sources_list#
- _changed_targets_list#
- _do_execute#
- _execute_str#
- _memo#
- _unchanged_sources_list#
- _unchanged_targets_list#
- action_list#
- batches#
- builder_kw#
- env#
- lvars#
- overridelist#
- post_actions#
- pre_actions#
- class SCons.Executor.NullEnvironment(*args, **kwargs)[source]#
Bases:
Null
- SCons = <module 'SCons' from '/Users/bdbaddog/devel/scons/git/as_scons/SCons/__init__.py'>#
- _CacheDir = <SCons.CacheDir.CacheDir object>#
- _CacheDir_path = None#
- class SCons.Executor.TSList(func)[source]#
Bases:
UserList
A class that implements $TARGETS or $SOURCES expansions by wrapping an executor Method. This class is used in the Executor.lvars() to delay creation of NodeList objects until they’re needed.
Note that we subclass collections.UserList purely so that the is_Sequence() function will identify an object of this class as a list during variable expansion. We’re not really using any collections.UserList methods in practice.
- _abc_impl = <_abc._abc_data object>#
- append(item)#
S.append(value) – append value to the end of the sequence
- clear() None -- remove all items from S #
- copy()#
- count(value) integer -- return number of occurrences of value #
- extend(other)#
S.extend(iterable) – extend sequence by appending elements from the iterable
- index(value[, start[, stop]]) integer -- return first index of value. #
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- insert(i, item)#
S.insert(index, value) – insert value before index
- pop([index]) item -- remove and return item at index (default last). #
Raise IndexError if list is empty or index is out of range.
- remove(item)#
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- reverse()#
S.reverse() – reverse IN PLACE
- sort(*args, **kwds)#
SCons.Memoize module#
Decorator-based memoizer to count caching stats.
A decorator-based implementation to count hits and misses of the computed values that various methods cache in memory.
Use of this modules assumes that wrapped methods be coded to cache their values in a consistent way. In particular, it requires that the class uses a dictionary named “_memo” to store the cached values.
Here is an example of wrapping a method that returns a computed value, with no input parameters:
@SCons.Memoize.CountMethodCall
def foo(self):
try: # Memoization
return self._memo['foo'] # Memoization
except KeyError: # Memoization
pass # Memoization
result = self.compute_foo_value()
self._memo['foo'] = result # Memoization
return result
Here is an example of wrapping a method that will return different values based on one or more input arguments:
def _bar_key(self, argument): # Memoization
return argument # Memoization
@SCons.Memoize.CountDictCall(_bar_key)
def bar(self, argument):
memo_key = argument # Memoization
try: # Memoization
memo_dict = self._memo['bar'] # Memoization
except KeyError: # Memoization
memo_dict = {} # Memoization
self._memo['dict'] = memo_dict # Memoization
else: # Memoization
try: # Memoization
return memo_dict[memo_key] # Memoization
except KeyError: # Memoization
pass # Memoization
result = self.compute_bar_value(argument)
memo_dict[memo_key] = result # Memoization
return result
Deciding what to cache is tricky, because different configurations can have radically different performance tradeoffs, and because the tradeoffs involved are often so non-obvious. Consequently, deciding whether or not to cache a given method will likely be more of an art than a science, but should still be based on available data from this module. Here are some VERY GENERAL guidelines about deciding whether or not to cache return values from a method that’s being called a lot:
- – The first question to ask is, “Can we change the calling code
so this method isn’t called so often?” Sometimes this can be done by changing the algorithm. Sometimes the caller should be memoized, not the method you’re looking at.
—The memoized function should be timed with multiple configurations to make sure it doesn’t inadvertently slow down some other configuration.
- – When memoizing values based on a dictionary key composed of
input arguments, you don’t need to use all of the arguments if some of them don’t affect the return values.
- class SCons.Memoize.CountDict(cls_name, method_name, keymaker)[source]#
Bases:
Counter
A counter class for memoized values stored in a dictionary, with keys based on the method’s input arguments.
A CountDict object is instantiated in a decorator for each of the class’s methods that memoizes its return value in a dictionary, indexed by some key that can be computed from one or more of its input arguments.
- count(*args, **kw) None [source]#
Counts whether the computed key value is already present in the memoization dictionary (a hit) or not (a miss).
- display() None #
- key()#
- SCons.Memoize.CountDictCall(keyfunc)[source]#
Decorator for counting memoizer hits/misses while accessing dictionary values with a key-generating function. Like CountMethodCall above, it wraps the given method fn and uses a CountDict object to keep track of the caching statistics. The dict-key function keyfunc has to get passed in the decorator call and gets stored in the CountDict instance. Wrapping gets enabled by calling EnableMemoization().
- SCons.Memoize.CountMethodCall(fn)[source]#
Decorator for counting memoizer hits/misses while retrieving a simple value in a class method. It wraps the given method fn and uses a CountValue object to keep track of the caching statistics. Wrapping gets enabled by calling EnableMemoization().
- class SCons.Memoize.CountValue(cls_name, method_name)[source]#
Bases:
Counter
A counter class for simple, atomic memoized values.
A CountValue object should be instantiated in a decorator for each of the class’s methods that memoizes its return value by simply storing the return value in its _memo dictionary.
- count(*args, **kw) None [source]#
Counts whether the memoized value has already been set (a hit) or not (a miss).
- display() None #
- key()#
- class SCons.Memoize.Counter(cls_name, method_name)[source]#
Bases:
object
Base class for counting memoization hits and misses.
We expect that the initialization in a matching decorator will fill in the correct class name and method name that represents the name of the function being counted.
SCons.PathList module#
Handle lists of directory paths.
These are the path lists that get set as CPPPATH
, LIBPATH
,
etc.) with as much caching of data and efficiency as we can, while
still keeping the evaluation delayed so that we Do the Right Thing
(almost) regardless of how the variable is specified.
- SCons.PathList.PathList(pathlist, split=True)#
Entry point for getting PathLists.
Returns the cached
_PathList
object for the specified pathlist, creating and caching a new object as necessary.
- class SCons.PathList._PathList(pathlist, split=True)[source]#
Bases:
object
An actual PathList object.
Initializes a
PathList
object, canonicalizing the input and pre-processing it for quicker substitution later.The stored representation of the
PathList
is a list of tuples containing (type, value), where the “type” is one of theTYPE_*
variables defined above. We distinguish between:Strings that contain no
$
and therefore need no delayed-evaluation string substitution (we expect that there will be many of these and that we therefore get a pretty big win from avoiding string substitution)Strings that contain
$
and therefore need substitution (the hard case is things like${TARGET.dir}/include
, which require re-evaluation for every target + source)Other objects (which may be something like an
EntryProxy
that needs a method called to return a Node)
Pre-identifying the type of each element in the
PathList
up-front and storing the type in the list of tuples is intended to reduce the amount of calculation when we actually do the substitution over and over for each target.
- SCons.PathList.node_conv(obj)[source]#
This is the “string conversion” routine that we have our substitutions use to return Nodes, not strings. This relies on the fact that an
EntryProxy
object has aget()
method that returns the underlying Node that it wraps, which is a bit of architectural dependence that we might need to break or modify in the future in response to additional requirements.
SCons.SConf module#
Autoconf-like configuration support.
In other words, SConf allows to run tests on the build machine to detect capabilities of system and do some things based on result: generate config files, header files for C/C++, update variables in environment.
Tests on the build system can detect if compiler sees header files, if libraries are installed, if some command line options are supported etc.
- SCons.SConf.CheckCHeader(context, header, include_quotes: str = '""')[source]#
A test for a C header file.
- SCons.SConf.CheckCXXHeader(context, header, include_quotes: str = '""')[source]#
A test for a C++ header file.
- class SCons.SConf.CheckContext(sconf)[source]#
Bases:
object
Provides a context for configure tests. Defines how a test writes to the screen and log file.
A typical test is just a callable with an instance of CheckContext as first argument:
- def CheckCustom(context, …):
context.Message(‘Checking my weird test … ‘) ret = myWeirdTestFunction(…) context.Result(ret)
Often, myWeirdTestFunction will be one of context.TryCompile/context.TryLink/context.TryRun. The results of those are cached, for they are only rebuild, if the dependencies have changed.
- Message(text) None [source]#
Inform about what we are doing right now, e.g. ‘Checking for SOMETHING … ‘
- SCons.SConf.CheckDeclaration(context, declaration, includes: str = '', language=None) bool [source]#
- SCons.SConf.CheckFunc(context, function_name, header=None, language=None, funcargs=None) bool [source]#
- SCons.SConf.CheckHeader(context, header, include_quotes: str = '<>', language=None) bool [source]#
A test for a C or C++ header file.
- SCons.SConf.CheckLib(context, library=None, symbol: str = 'main', header=None, language=None, autoadd: bool = True, append: bool = True, unique: bool = False) bool [source]#
A test for a library. See also CheckLibWithHeader. Note that library may also be None to test whether the given symbol compiles without flags.
- SCons.SConf.CheckLibWithHeader(context, libs, header, language, call=None, autoadd: bool = True, append: bool = True, unique: bool = False) bool [source]#
Another (more sophisticated) test for a library. Checks, if library and header is available for language (may be ‘C’ or ‘CXX’). Call maybe be a valid expression _with_ a trailing ‘;’. As in CheckLib, we support library=None, to test if the call compiles without extra link flags.
- SCons.SConf.CheckMember(context, aggregate_member, header=None, language=None) bool [source]#
Returns the status (False : failed, True : ok).
- SCons.SConf.CheckProg(context, prog_name)[source]#
Simple check if a program exists in the path. Returns the path for the application, or None if not found.
- SCons.SConf.CheckTypeSize(context, type_name, includes: str = '', language=None, expect=None)[source]#
- exception SCons.SConf.ConfigureCacheError(target)[source]#
Bases:
SConfError
Raised when a use explicitely requested the cache feature, but the test is run the first time.
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception SCons.SConf.ConfigureDryRunError(target)[source]#
Bases:
SConfError
Raised when a file or directory needs to be updated during a Configure process, but the user requested a dry-run
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- SCons.SConf.CreateConfigHBuilder(env) None [source]#
Called if necessary just before the building targets phase begins.
- class SCons.SConf.SConfBase(env, custom_tests={}, conf_dir: str = '$CONFIGUREDIR', log_file: str = '$CONFIGURELOG', config_h=None, _depth: int = 0)[source]#
Bases:
object
This is simply a class to represent a configure context. After creating a SConf object, you can call any tests. After finished with your tests, be sure to call the Finish() method, which returns the modified environment. Some words about caching: In most cases, it is not necessary to cache Test results explicitly. Instead, we use the scons dependency checking mechanism. For example, if one wants to compile a test program (SConf.TryLink), the compiler is only called, if the program dependencies have changed. However, if the program could not be compiled in a former SConf run, we need to explicitly cache this error.
- AddTest(test_name, test_instance) None [source]#
Adds test_class to this SConf instance. It can be called with self.test_name(…)
- AddTests(tests) None [source]#
Adds all the tests given in the tests dictionary to this SConf instance
- BuildNodes(nodes)[source]#
Tries to build the given nodes immediately. Returns 1 on success, 0 on error.
- Define(name, value=None, comment=None) None [source]#
Define a pre processor symbol name, with the optional given value in the current config header.
If value is None (default), then #define name is written. If value is not none, then #define name value is written.
comment is a string which will be put as a C comment in the header, to explain the meaning of the value (appropriate C comments will be added automatically).
- TryAction(action, text=None, extension: str = '')[source]#
Tries to execute the given action with optional source file contents <text> and optional source file extension <extension>, Returns the status (0 : failed, 1 : ok) and the contents of the output file.
- TryBuild(builder, text=None, extension: str = '')[source]#
Low level TryBuild implementation. Normally you don’t need to call that - you can use TryCompile / TryLink / TryRun instead
- TryCompile(text, extension)[source]#
Compiles the program given in text to an env.Object, using extension as file extension (e.g. ‘.c’). Returns 1, if compilation was successful, 0 otherwise. The target is saved in self.lastTarget (for further processing).
- TryLink(text, extension)[source]#
Compiles the program given in text to an executable env.Program, using extension as file extension (e.g. ‘.c’). Returns 1, if compilation was successful, 0 otherwise. The target is saved in self.lastTarget (for further processing).
- TryRun(text, extension)[source]#
Compiles and runs the program given in text, using extension as file extension (e.g. ‘.c’). Returns (1, outputStr) on success, (0, ‘’) otherwise. The target (a file containing the program’s stdout) is saved in self.lastTarget (for further processing).
- _startup() None [source]#
Private method. Set up logstream, and set the environment variables necessary for a piped build
- pspawn_wrapper(sh, escape, cmd, args, env)[source]#
Wrapper function for handling piped spawns.
This looks to the calling interface (in Action.py) like a “normal” spawn, but associates the call with the PSPAWN variable from the construction environment and with the streams to which we want the output logged. This gets slid into the construction environment as the SPAWN variable so Action.py doesn’t have to know or care whether it’s spawning a piped command or not.
- class SCons.SConf.SConfBuildInfo[source]#
Bases:
FileBuildInfo
Special build info for targets of configure tests. Additional members are result (did the builder succeed last time?) and string, which contains messages of the original build phase.
- __getstate__()#
Return all fields that shall be pickled. Walk the slots in the class hierarchy and add those to the state dictionary. If a ‘__dict__’ slot is available, copy all entries to the dictionary. Also include the version id, which is fixed for all instances of a class.
- __setstate__(state) None #
Restore the attributes from a pickled state.
- bact#
- bactsig#
- bdepends#
- bdependsigs#
- bimplicit#
- bimplicitsigs#
- bsources#
- bsourcesigs#
- convert_from_sconsign(dir, name) None #
Converts a newly-read FileBuildInfo object for in-SCons use
For normal up-to-date checking, we don’t have any conversion to perform–but we’re leaving this method here to make that clear.
- convert_to_sconsign() None #
Converts this FileBuildInfo object for writing to a .sconsign file
This replaces each Node in our various dependency lists with its usual string representation: relative to the top-level SConstruct directory, or an absolute path if it’s outside.
- current_version_id = 2#
- dependency_map#
- format(names: int = 0)#
- merge(other) None #
Merge the fields of another object into this object. Already existing information is overwritten by the other instance’s data. WARNING: If a ‘__dict__’ slot is added, it should be updated instead of replaced.
- prepare_dependencies() None #
Prepares a FileBuildInfo object for explaining what changed
The bsources, bdepends and bimplicit lists have all been stored on disk as paths relative to the top-level SConstruct directory. Convert the strings to actual Nodes (for use by the –debug=explain code and –implicit-cache).
- result#
- string#
- class SCons.SConf.SConfBuildTask(tm, targets, top, node)[source]#
Bases:
AlwaysTask
This is almost the same as SCons.Script.BuildTask. Handles SConfErrors correctly and knows about the current cache_mode.
- LOGGER = None#
- _abc_impl = <_abc._abc_data object>#
- _exception_raise()#
Raises a pending exception that was recorded while getting a Task ready for execution.
- _no_exception_to_raise() None #
- display(message) None [source]#
Hook to allow the calling interface to display a message.
This hook gets called as part of preparing a task for execution (that is, a Node to be built). As part of figuring out what Node should be built next, the actual target list may be altered, along with a message describing the alteration. The calling interface can subclass Task and provide a concrete implementation of this method to see those messages.
- display_cached_string(bi) None [source]#
Logs the original builder messages, given the SConfBuildInfo instance bi.
- exc_clear() None #
Clears any recorded exception.
This also changes the “exception_raise” attribute to point to the appropriate do-nothing method.
- exc_info()#
Returns info about a recorded exception.
- exception_set(exception=None) None #
Records an exception to be raised at the appropriate time.
This also changes the “exception_raise” attribute to point to the method that will, in fact
- execute()[source]#
Called to execute the task.
This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in prepare(), executed() or failed().
- executed() None #
Called when the task has been successfully executed and the Taskmaster instance wants to call the Node’s callback methods.
This may have been a do-nothing operation (to preserve build order), so we must check the node’s state before deciding whether it was “built”, in which case we call the appropriate Node method. In any event, we always call “visited()”, which will handle any post-visit actions that must take place regardless of whether or not the target was an actual built target or a source Node.
- executed_with_callbacks() None #
Called when the task has been successfully executed and the Taskmaster instance wants to call the Node’s callback methods.
This may have been a do-nothing operation (to preserve build order), so we must check the node’s state before deciding whether it was “built”, in which case we call the appropriate Node method. In any event, we always call “visited()”, which will handle any post-visit actions that must take place regardless of whether or not the target was an actual built target or a source Node.
- executed_without_callbacks() None #
Called when the task has been successfully executed and the Taskmaster instance doesn’t want to call the Node’s callback methods.
- fail_continue() None #
Explicit continue-the-build failure.
This sets failure status on the target nodes and all of their dependent parent nodes.
Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure().
- fail_stop() None #
Explicit stop-the-build failure.
This sets failure status on the target nodes and all of their dependent parent nodes.
Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure().
- failed()[source]#
Default action when a task fails: stop the build.
Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure().
- get_target()#
Fetch the target being built or updated by this task.
- make_ready() None #
Marks all targets in a task ready for execution if any target is not current.
This is the default behavior for building only what’s necessary.
- make_ready_all() None #
Marks all targets in a task ready for execution.
This is used when the interface needs every target Node to be visited–the canonical example being the “scons -c” option.
- make_ready_current() None [source]#
Marks all targets in a task ready for execution if any target is not current.
This is the default behavior for building only what’s necessary.
- needs_execute() bool #
Always returns True (indicating this Task should always be executed).
Subclasses that need this behavior (as opposed to the default of only executing Nodes that are out of date w.r.t. their dependencies) can use this as follows:
- class MyTaskSubclass(SCons.Taskmaster.Task):
needs_execute = SCons.Taskmaster.AlwaysTask.needs_execute
- non_sconf_nodes = {}#
- postprocess() None [source]#
Post-processes a task after it’s been executed.
This examines all the targets just built (or not, we don’t care if the build was successful, or even if there was no build because everything was up-to-date) to see if they have any waiting parent Nodes, or Nodes waiting on a common side effect, that can be put back on the candidates list.
- prepare() None #
Called just before the task is executed.
This is mainly intended to give the target Nodes a chance to unlink underlying files and make all necessary directories before the Action is actually called to build the targets.
- trace_message(node, description: str = 'node') None #
- exception SCons.SConf.SConfError(msg)[source]#
Bases:
UserError
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception SCons.SConf.SConfWarning[source]#
Bases:
SConsWarning
- add_note()#
Exception.add_note(note) – add a note to the exception
- args#
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- SCons.SConf.SetCacheMode(mode)[source]#
Set the Configure cache mode. mode must be one of “auto”, “force”, or “cache”.
- SCons.SConf.SetProgressDisplay(display) None [source]#
Set the progress display to use (called from SCons.Script)
SCons.SConsign module#
Operations on signature database files (.sconsign).
- class SCons.SConsign.Base[source]#
Bases:
object
This is the controlling class for the signatures for the collection of entries associated with a specific directory. The actual directory association will be maintained by a subclass that is specific to the underlying storage method. This class provides a common set of methods for fetching and storing the individual bits of information that make up signature entry.
- class SCons.SConsign.DB(dir)[source]#
Bases:
Base
A Base subclass that reads and writes signature information from a global .sconsign.db* file–the actual file suffix is determined by the database module.
- do_not_set_entry(filename, obj) None #
- do_not_store_info(filename, node) None #
- get_entry(filename)#
Fetch the specified entry attribute.
- merge() None #
- set_entry(filename, obj) None #
Set the entry.
- store_info(filename, node) None #
- class SCons.SConsign.Dir(fp=None, dir=None)[source]#
Bases:
Base
- do_not_set_entry(filename, obj) None #
- do_not_store_info(filename, node) None #
- get_entry(filename)#
Fetch the specified entry attribute.
- merge() None #
- set_entry(filename, obj) None #
Set the entry.
- store_info(filename, node) None #
- class SCons.SConsign.DirFile(dir)[source]#
Bases:
Dir
Encapsulates reading and writing a per-directory .sconsign file.
- do_not_set_entry(filename, obj) None #
- do_not_store_info(filename, node) None #
- get_entry(filename)#
Fetch the specified entry attribute.
- merge() None #
- set_entry(filename, obj) None #
Set the entry.
- store_info(filename, node) None #
- write(sync: int = 1) None [source]#
Write the .sconsign file to disk.
Try to write to a temporary file first, and rename it if we succeed. If we can’t write to the temporary file, it’s probably because the directory isn’t writable (and if so, how did we build anything in this directory, anyway?), so try to write directly to the .sconsign file as a backup. If we can’t rename, try to copy the temporary contents back to the .sconsign file. Either way, always try to remove the temporary file at the end.
- SCons.SConsign.File(name, dbm_module=None) None [source]#
Arrange for all signatures to be stored in a global .sconsign.db* file.
- SCons.SConsign.Reset() None [source]#
Reset global state. Used by unit tests that end up using SConsign multiple times to get a clean slate for each test.
- class SCons.SConsign.SConsignEntry[source]#
Bases:
object
Wrapper class for the generic entry in a .sconsign file. The Node subclass populates it with attributes as it pleases.
XXX As coded below, we do expect a ‘.binfo’ attribute to be added, but we’ll probably generalize this in the next refactorings.
- binfo#
- current_version_id = 2#
- ninfo#
SCons.Subst module#
SCons string substitution.
- class SCons.Subst.CmdStringHolder(cmd, literal=None)[source]#
Bases:
UserString
This is a special class used to hold strings generated by scons_subst() and scons_subst_list(). It defines a special method escape(). When passed a function with an escape algorithm for a particular platform, it will return the contained string with the proper escape sequences inserted.
- _abc_impl = <_abc._abc_data object>#
- capitalize()#
- casefold()#
- center(width, *args)#
- count(value) integer -- return number of occurrences of value #
- encode(encoding='utf-8', errors='strict')#
- endswith(suffix, start=0, end=9223372036854775807)#
- escape(escape_func, quote_func=<function quote_spaces>)[source]#
Escape the string with the supplied function. The function is expected to take an arbitrary string, then return it with all special characters escaped and ready for passing to the command interpreter.
After calling this function, the next call to str() will return the escaped string.
- expandtabs(tabsize=8)#
- find(sub, start=0, end=9223372036854775807)#
- format(*args, **kwds)#
- format_map(mapping)#
- index(value[, start[, stop]]) integer -- return first index of value. #
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- isalnum()#
- isalpha()#
- isascii()#
- isdecimal()#
- isdigit()#
- isidentifier()#
- islower()#
- isnumeric()#
- isprintable()#
- isspace()#
- istitle()#
- isupper()#
- join(seq)#
- ljust(width, *args)#
- lower()#
- lstrip(chars=None)#
- maketrans()#
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
- partition(sep)#
- removeprefix(prefix, /)#
- removesuffix(suffix, /)#
- replace(old, new, maxsplit=-1)#
- rfind(sub, start=0, end=9223372036854775807)#
- rindex(sub, start=0, end=9223372036854775807)#
- rjust(width, *args)#
- rpartition(sep)#
- rsplit(sep=None, maxsplit=-1)#
- rstrip(chars=None)#
- split(sep=None, maxsplit=-1)#
- splitlines(keepends=False)#
- startswith(prefix, start=0, end=9223372036854775807)#
- strip(chars=None)#
- swapcase()#
- title()#
- translate(*args)#
- upper()#
- zfill(width)#
- class SCons.Subst.ListSubber(env, mode, conv, gvars)[source]#
Bases:
UserList
A class to construct the results of a scons_subst_list() call.
Like StringSubber, this class binds a specific construction environment, mode, target and source with two methods (substitute() and expand()) that handle the expansion.
In addition, however, this class is used to track the state of the result(s) we’re gathering so we can do the appropriate thing whenever we have to append another word to the result–start a new line, start a new word, append to the current word, etc. We do this by setting the “append” attribute to the right method so that our wrapper methods only need ever call ListSubber.append(), and the rest of the object takes care of doing the right thing internally.
- _abc_impl = <_abc._abc_data object>#
- add_to_current_word(x) None [source]#
Append the string x to the end of the current last word in the result. If that is not possible, then just add it as a new word. Make sure the entire concatenated string inherits the object attributes of x (in particular, the escape function) by wrapping it as CmdStringHolder.
- append(item)#
S.append(value) – append value to the end of the sequence
- clear() None -- remove all items from S #
- copy()#
- count(value) integer -- return number of occurrences of value #
- expand(s, lvars, within_list)[source]#
Expand a single “token” as necessary, appending the expansion to the current result.
This handles expanding different types of things (strings, lists, callables) appropriately. It calls the wrapper substitute() method to re-expand things as necessary, so that the results of expansions of side-by-side strings still get re-evaluated separately, not smushed together.
- expanded(s) bool [source]#
Determines if the string s requires further expansion.
Due to the implementation of ListSubber expand will call itself 2 additional times for an already expanded string. This method is used to determine if a string is already fully expanded and if so exit the loop early to prevent these recursive calls.
- extend(other)#
S.extend(iterable) – extend sequence by appending elements from the iterable
- index(value[, start[, stop]]) integer -- return first index of value. #
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- insert(i, item)#
S.insert(index, value) – insert value before index
- next_line() None [source]#
Arrange for the next word to start a new line. This is like starting a new word, except that we have to append another line to the result.
- pop([index]) item -- remove and return item at index (default last). #
Raise IndexError if list is empty or index is out of range.
- remove(item)#
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- reverse()#
S.reverse() – reverse IN PLACE
- sort(*args, **kwds)#
- class SCons.Subst.Literal(lstr)[source]#
Bases:
object
A wrapper for a string. If you use this object wrapped around a string, then it will be interpreted as literal. When passed to the command interpreter, all special characters will be escaped.
- class SCons.Subst.NLWrapper(list, func)[source]#
Bases:
object
A wrapper class that delays turning a list of sources or targets into a NodeList until it’s needed. The specified function supplied when the object is initialized is responsible for turning raw nodes into proxies that implement the special attributes like .abspath, .source, etc. This way, we avoid creating those proxies just “in case” someone is going to use $TARGET or the like, and only go through the trouble if we really have to.
In practice, this might be a wash performance-wise, but it’s a little cleaner conceptually…
- _create_nodelist()#
- class SCons.Subst.SpecialAttrWrapper(lstr, for_signature=None)[source]#
Bases:
object
This is a wrapper for what we call a ‘Node special attribute.’ This is any of the attributes of a Node that we can reference from Environment variable substitution, such as $TARGET.abspath or $SOURCES[1].filebase. We implement the same methods as Literal so we can handle special characters, plus a for_signature method, such that we can return some canonical string during signature calculation to avoid unnecessary rebuilds.
- class SCons.Subst.StringSubber(env, mode, conv, gvars)[source]#
Bases:
object
A class to construct the results of a scons_subst() call.
This binds a specific construction environment, mode, target and source with two methods (substitute() and expand()) that handle the expansion.
- expand(s, lvars)[source]#
Expand a single “token” as necessary, returning an appropriate string containing the expansion.
This handles expanding different types of things (strings, lists, callables) appropriately. It calls the wrapper substitute() method to re-expand things as necessary, so that the results of expansions of side-by-side strings still get re-evaluated separately, not smushed together.
- class SCons.Subst.Target_or_Source(nl)[source]#
Bases:
object
A class that implements $TARGET or $SOURCE expansions by in turn wrapping a NLWrapper. This class handles the different methods used to access an individual proxy Node, calling the NLWrapper to create a proxy on demand.
- class SCons.Subst.Targets_or_Sources(nl)[source]#
Bases:
UserList
A class that implements $TARGETS or $SOURCES expansions by in turn wrapping a NLWrapper. This class handles the different methods used to access the list, calling the NLWrapper to create proxies on demand.
Note that we subclass collections.UserList purely so that the is_Sequence() function will identify an object of this class as a list during variable expansion. We’re not really using any collections.UserList methods in practice.
- _abc_impl = <_abc._abc_data object>#
- append(item)#
S.append(value) – append value to the end of the sequence
- clear() None -- remove all items from S #
- copy()#
- count(value) integer -- return number of occurrences of value #
- extend(other)#
S.extend(iterable) – extend sequence by appending elements from the iterable
- index(value[, start[, stop]]) integer -- return first index of value. #
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- insert(i, item)#
S.insert(index, value) – insert value before index
- pop([index]) item -- remove and return item at index (default last). #
Raise IndexError if list is empty or index is out of range.
- remove(item)#
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- reverse()#
S.reverse() – reverse IN PLACE
- sort(*args, **kwds)#
- SCons.Subst.escape_list(mylist, escape_func)[source]#
Escape a list of arguments by running the specified escape_func on every object in the list that has an escape() method.
- SCons.Subst.quote_spaces(arg)[source]#
Generic function for putting double quotes around any string that has white space in it.
- SCons.Subst.scons_subst(strSubst, env, mode=1, target=None, source=None, gvars={}, lvars={}, conv=None, overrides: dict | None = None)[source]#
Expand a string or list containing construction variable substitutions.
This is the work-horse function for substitutions in file names and the like. The companion scons_subst_list() function (below) handles separating command lines into lists of arguments, so see that function if that’s what you’re looking for.
- SCons.Subst.scons_subst_list(strSubst, env, mode=1, target=None, source=None, gvars={}, lvars={}, conv=None, overrides: dict | None = None)[source]#
Substitute construction variables in a string (or list or other object) and separate the arguments into a command list.
The companion scons_subst() function (above) handles basic substitutions within strings, so see that function instead if that’s what you’re looking for.
- SCons.Subst.scons_subst_once(strSubst, env, key)[source]#
Perform single (non-recursive) substitution of a single construction variable keyword.
This is used when setting a variable when copying or overriding values in an Environment. We want to capture (expand) the old value before we override it, so people can do things like:
env2 = env.Clone(CCFLAGS = ‘$CCFLAGS -g’)
We do this with some straightforward, brute-force code here…
- SCons.Subst.subst_dict(target, source)[source]#
Create a dictionary for substitution of special construction variables.
This translates the following special arguments:
- target - the target (object or array of objects),
used to generate the TARGET and TARGETS construction variables
- source - the source (object or array of objects),
used to generate the SOURCES and SOURCE construction variables
SCons.Warnings module#
The SCons Warnings framework.
Enables issuing warnings in situations where it is useful to alert the user of a condition that does not warrant raising an exception that could terminate the program.
A new warning class should inherit (perhaps indirectly) from one of
two base classes: SConsWarning
or WarningOnByDefault
,
which are the same except warnings derived from the latter will start
out in an enabled state. Enabled warnings cause a message to be
printed when called, disabled warnings are silent.
There is also a hierarchy for indicating deprecations and future
changes: for these, derive from DeprecatedWarning
,
MandatoryDeprecatedWarning
, FutureDeprecatedWarning
or FutureReservedVariableWarning
.
Whether or not to display warnings, beyond those that are on by
default, is controlled through the command line (--warn
) or
through SetOption('warn')
. The names used there use a different
naming style than the warning class names. process_warn_strings()
converts the names before enabling/disabling.
The behavior of issuing only a message (for “enabled” warnings) can
be toggled to raising an exception instead by calling the
warningAsException()
function.
For new/removed warnings, the manpage needs to be kept in sync. Any warning class defined here is accepted, but we don’t want to make people have to dig around to find the names. Warnings do not have to be defined in this file, though it is preferred: those defined elsewhere cannot use the enable/disable functionality unless they monkeypatch the warning into this module’s namespace.
You issue a warning, either in SCons code or in a build project’s
SConscripts, by calling the warn()
function defined in this module.
Raising directly with an instance of a warning class bypasses the
framework and it will behave like an ordinary exception.
- exception SCons.Warnings.CacheCleanupErrorWarning[source]#
Bases:
SConsWarning
Problems removing retrieved target prior to rebuilding.
- exception SCons.Warnings.CacheVersionWarning[source]#
Bases:
WarningOnByDefault
The derived-file cache directory has an out of date config.
- exception SCons.Warnings.CacheWriteErrorWarning[source]#
Bases:
SConsWarning
Problems writing a derived file to the cache.
- exception SCons.Warnings.CorruptSConsignWarning[source]#
Bases:
WarningOnByDefault
Problems decoding the contents of the sconsign database.
- exception SCons.Warnings.DependencyWarning[source]#
Bases:
SConsWarning
A scanner identified a dependency but did not add it.
- exception SCons.Warnings.DeprecatedDebugOptionsWarning[source]#
Bases:
MandatoryDeprecatedWarning
Option-arguments to –debug that are deprecated.
- exception SCons.Warnings.DeprecatedOptionsWarning[source]#
Bases:
MandatoryDeprecatedWarning
Options that are deprecated.
- exception SCons.Warnings.DeprecatedWarning[source]#
Bases:
SConsWarning
Base class for deprecated features, will be removed in future.
- exception SCons.Warnings.DevelopmentVersionWarning[source]#
Bases:
WarningOnByDefault
Use of a deprecated feature.
- exception SCons.Warnings.DuplicateEnvironmentWarning[source]#
Bases:
WarningOnByDefault
A target appears in more than one consenv with identical actions.
A duplicate target with different rules cannot be built; with the same rule it can, but this could indicate a problem in the build configuration.
- exception SCons.Warnings.FortranCxxMixWarning[source]#
Bases:
LinkWarning
Fortran and C++ objects appear together in a link line.
Some compilers support this, others do not.
- exception SCons.Warnings.FutureDeprecatedWarning[source]#
Bases:
SConsWarning
Base class for features that will become deprecated in a future release.
- exception SCons.Warnings.FutureReservedVariableWarning[source]#
Bases:
WarningOnByDefault
Setting a variable marked to become reserved in a future release.
- exception SCons.Warnings.LinkWarning[source]#
Bases:
WarningOnByDefault
Base class for linker warnings.
- exception SCons.Warnings.MandatoryDeprecatedWarning[source]#
Bases:
DeprecatedWarning
Base class for deprecated features where warning cannot be disabled.
- exception SCons.Warnings.MisleadingKeywordsWarning[source]#
Bases:
WarningOnByDefault
Use of possibly misspelled kwargs in Builder calls.
- exception SCons.Warnings.MissingSConscriptWarning[source]#
Bases:
WarningOnByDefault
The script specified in an SConscript() call was not found.
TODO: this is now an error, so no need for a warning. Left in for a while in case anyone is using, remove eventually.
Manpage entry removed in 4.6.0.
- exception SCons.Warnings.NoObjectCountWarning[source]#
Bases:
WarningOnByDefault
Object counting (debug mode) could not be enabled.
- exception SCons.Warnings.NoParallelSupportWarning[source]#
Bases:
WarningOnByDefault
Fell back to single-threaded build, as no thread support found.
- exception SCons.Warnings.PythonVersionWarning[source]#
Bases:
DeprecatedWarning
SCons was run with a deprecated Python version.
- exception SCons.Warnings.ReservedVariableWarning[source]#
Bases:
WarningOnByDefault
Attempt to set reserved construction variable names.
- SCons.Warnings.SConsWarningOnByDefault#
alias of
WarningOnByDefault
- exception SCons.Warnings.StackSizeWarning[source]#
Bases:
WarningOnByDefault
Requested thread stack size could not be set.
- exception SCons.Warnings.TargetNotBuiltWarning[source]#
Bases:
SConsWarning
A target build indicated success but the file is not found.
- exception SCons.Warnings.ToolQtDeprecatedWarning[source]#
Bases:
DeprecatedWarning
- exception SCons.Warnings.VisualCMissingWarning[source]#
Bases:
WarningOnByDefault
Requested MSVC version not found and policy is to not fail.
- exception SCons.Warnings.VisualStudioMissingWarning[source]#
Bases:
SConsWarning
- exception SCons.Warnings.VisualVersionMismatch[source]#
Bases:
WarningOnByDefault
MSVC_VERSION
andMSVS_VERSION
do not match.Note
MSVS_VERSION
is deprecated, useMSVC_VERSION
.
- exception SCons.Warnings.WarningOnByDefault[source]#
Bases:
SConsWarning
Base class for SCons warnings that are enabled by default.
- SCons.Warnings.enableWarningClass(clazz) None [source]#
Enables all warnings of type clazz or derived from clazz.
- SCons.Warnings.process_warn_strings(arguments: Sequence[str]) None [source]#
Process requests to enable/disable warnings.
The requests come from the option-argument string passed to the
--warn
command line option or as the value passed to theSetOption
function with a first argument ofwarn
;The arguments are expected to be as documented in the SCons manual page for the
--warn
option, in the stylesome-type
, which is converted here to a camel-case name likeSomeTypeWarning
, to try to match the warning classes defined here, which are then passed toenableWarningClass()
orsuppressWarningClass()
.For example, a string``”deprecated”`` enables the
DeprecatedWarning
class, while a string``”no-dependency”`` disables theDependencyWarning
class.As a special case, the string
"all"
disables all warnings and a the string"no-all"
disables all warnings.
- SCons.Warnings.suppressWarningClass(clazz) None [source]#
Suppresses all warnings of type clazz or derived from clazz.
- SCons.Warnings.warn(clazz, *args) None [source]#
Issue a warning, accounting for SCons rules.
Check if warnings for this class are enabled. If warnings are treated as exceptions, raise exception. Use the global warning emitter
_warningOut
, which allows selecting different ways of presenting a traceback (see Script/Main.py).
SCons.cpp module#
SCons C Pre-Processor module
- SCons.cpp.CPP_to_Python(s)[source]#
Converts a C pre-processor expression into an equivalent Python expression that can be evaluated.
- SCons.cpp.CPP_to_Python_Ops_Sub(m)#
- class SCons.cpp.DumbPreProcessor(*args, **kw)[source]#
Bases:
PreProcessor
A preprocessor that ignores all #if/#elif/#else/#endif directives and just reports back all of the #include files (like the classic SCons scanner did).
This is functionally equivalent to using a regular expression to find all of the #include lines, only slower. It exists mainly as an example of how the main PreProcessor class can be sub-classed to tailor its behavior.
- __call__(file)#
Pre-processes a file.
This is the main public entry point.
- _do_if_else_condition(condition) None #
Common logic for evaluating the conditions on #if, #ifdef and #ifndef lines.
- _match_tuples(tuples)#
- _parse_tuples(contents)#
- _process_tuples(tuples, file=None)#
- all_include(t) None #
- do_define(t) None #
Default handling of a #define line.
- do_elif(t) None #
Default handling of a #elif line.
- do_else(t) None #
Default handling of a #else line.
- do_endif(t) None #
Default handling of a #endif line.
- do_if(t) None #
Default handling of a #if line.
- do_ifdef(t) None #
Default handling of a #ifdef line.
- do_ifndef(t) None #
Default handling of a #ifndef line.
- do_import(t) None #
Default handling of a #import line.
- do_include(t) None #
Default handling of a #include line.
- do_include_next(t) None #
Default handling of a #include line.
- do_nothing(t) None #
Null method for when we explicitly want the action for a specific preprocessor directive to do nothing.
- do_undef(t) None #
Default handling of a #undef line.
- eval_expression(t)#
Evaluates a C preprocessor expression.
This is done by converting it to a Python equivalent and eval()ing it in the C preprocessor namespace we use to track #define values.
- finalize_result(fname)#
- find_include_file(t)#
Finds the #include file for a given preprocessor tuple.
- initialize_result(fname) None #
- process_contents(contents)#
Pre-processes a file contents.
Is used by tests
- process_file(file)#
Pre-processes a file.
This is the main internal entry point.
- read_file(file) str #
- resolve_include(t)#
Resolve a tuple-ized #include line.
This handles recursive expansion of values without “” or <> surrounding the name until an initial “ or < is found, to handle #include FILE where FILE is a #define somewhere else.
- restore() None #
Pops the previous dispatch table off the stack and makes it the current one.
- save() None #
Pushes the current dispatch table on the stack and re-initializes the current dispatch table to the default.
- scons_current_file(t) None #
- start_handling_includes(t=None) None #
Causes the PreProcessor object to start processing #import, #include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif evaluates True, or when we reach the #else in a #if, #ifdef, #ifndef or #elif block where a condition already evaluated False.
- stop_handling_includes(t=None) None #
Causes the PreProcessor object to stop processing #import, #include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif evaluates False, or when we reach the #else in a #if, #ifdef, #ifndef or #elif block where a condition already evaluated True.
- tupleize(contents)#
Turns the contents of a file into a list of easily-processed tuples describing the CPP lines in the file.
The first element of each tuple is the line’s preprocessor directive (#if, #include, #define, etc., minus the initial ‘#’). The remaining elements are specific to the type of directive, as pulled apart by the regular expression.
- class SCons.cpp.FunctionEvaluator(name, args, expansion)[source]#
Bases:
object
Handles delayed evaluation of a #define function call.
- class SCons.cpp.PreProcessor(current='.', cpppath=(), dict={}, all: int = 0, depth=-1)[source]#
Bases:
object
The main workhorse class for handling C pre-processing.
- _do_if_else_condition(condition) None [source]#
Common logic for evaluating the conditions on #if, #ifdef and #ifndef lines.
- do_include_next(t) None #
Default handling of a #include line.
- do_nothing(t) None [source]#
Null method for when we explicitly want the action for a specific preprocessor directive to do nothing.
- eval_expression(t)[source]#
Evaluates a C preprocessor expression.
This is done by converting it to a Python equivalent and eval()ing it in the C preprocessor namespace we use to track #define values.
- resolve_include(t)[source]#
Resolve a tuple-ized #include line.
This handles recursive expansion of values without “” or <> surrounding the name until an initial “ or < is found, to handle #include FILE where FILE is a #define somewhere else.
- restore() None [source]#
Pops the previous dispatch table off the stack and makes it the current one.
- save() None [source]#
Pushes the current dispatch table on the stack and re-initializes the current dispatch table to the default.
- start_handling_includes(t=None) None [source]#
Causes the PreProcessor object to start processing #import, #include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif evaluates True, or when we reach the #else in a #if, #ifdef, #ifndef or #elif block where a condition already evaluated False.
- stop_handling_includes(t=None) None [source]#
Causes the PreProcessor object to stop processing #import, #include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif evaluates False, or when we reach the #else in a #if, #ifdef, #ifndef or #elif block where a condition already evaluated True.
- tupleize(contents)[source]#
Turns the contents of a file into a list of easily-processed tuples describing the CPP lines in the file.
The first element of each tuple is the line’s preprocessor directive (#if, #include, #define, etc., minus the initial ‘#’). The remaining elements are specific to the type of directive, as pulled apart by the regular expression.
SCons.dblite module#
dblite.py module contributed by Ralf W. Grosse-Kunstleve. Extended for Unicode by Steven Knight.
This is a very simple-minded “database” used for saved signature information, with an interface modeled on the Python dbm database interface module.
- class SCons.dblite._Dblite(file_base_name, flag='r', mode=438)[source]#
Bases:
object
Lightweight signature database class.
Behaves like a dict when in memory, loads from a pickled disk file on open and writes back out to it on close.
Open the database file using a path derived from file_base_name. The optional flag argument can be:
Value
Meaning
'r'
Open existing database for reading only (default)
'w'
Open existing database for reading and writing
'c'
Open database for reading and writing, creating it if it doesn’t exist
'n'
Always create a new, empty database, open for reading and writing
The optional mode argument is the POSIX mode of the file, used only when the database has to be created. It defaults to octal
0o666
.- static _open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)#
Open file and return a stream. Raise OSError upon failure.
file is either a text or byte string giving the name (and the path if the file isn’t in the current working directory) of the file to be opened or an integer file descriptor of the file to be wrapped. (If a file descriptor is given, it is closed when the returned I/O object is closed, unless closefd is set to False.)
mode is an optional string that specifies the mode in which the file is opened. It defaults to ‘r’ which means open for reading in text mode. Other common values are ‘w’ for writing (truncating the file if it already exists), ‘x’ for creating and writing to a new file, and ‘a’ for appending (which on some Unix systems, means that all writes append to the end of the file regardless of the current seek position). In text mode, if encoding is not specified the encoding used is platform dependent: locale.getencoding() is called to get the current locale encoding. (For reading and writing raw bytes use binary mode and leave encoding unspecified.) The available modes are:
Character
Meaning
‘r’
open for reading (default)
‘w’
open for writing, truncating the file first
‘x’
create a new file and open it for writing
‘a’
open for writing, appending to the end of the file if it exists
‘b’
binary mode
‘t’
text mode (default)
‘+’
open a disk file for updating (reading and writing)
The default mode is ‘rt’ (open for reading text). For binary random access, the mode ‘w+b’ opens and truncates the file to 0 bytes, while ‘r+b’ opens the file without truncation. The ‘x’ mode implies ‘w’ and raises an FileExistsError if the file already exists.
Python distinguishes between files opened in binary and text modes, even when the underlying operating system doesn’t. Files opened in binary mode (appending ‘b’ to the mode argument) return contents as bytes objects without any decoding. In text mode (the default, or when ‘t’ is appended to the mode argument), the contents of the file are returned as strings, the bytes having been first decoded using a platform-dependent encoding or using the specified encoding if given.
buffering is an optional integer used to set the buffering policy. Pass 0 to switch buffering off (only allowed in binary mode), 1 to select line buffering (only usable in text mode), and an integer > 1 to indicate the size of a fixed-size chunk buffer. When no buffering argument is given, the default buffering policy works as follows:
Binary files are buffered in fixed-size chunks; the size of the buffer is chosen using a heuristic trying to determine the underlying device’s “block size” and falling back on io.DEFAULT_BUFFER_SIZE. On many systems, the buffer will typically be 4096 or 8192 bytes long.
“Interactive” text files (files for which isatty() returns True) use line buffering. Other text files use the policy described above for binary files.
encoding is the name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is platform dependent, but any encoding supported by Python can be passed. See the codecs module for the list of supported encodings.
errors is an optional string that specifies how encoding errors are to be handled—this argument should not be used in binary mode. Pass ‘strict’ to raise a ValueError exception if there is an encoding error (the default of None has the same effect), or pass ‘ignore’ to ignore errors. (Note that ignoring encoding errors can lead to data loss.) See the documentation for codecs.register or run ‘help(codecs.Codec)’ for a list of the permitted encoding error strings.
newline controls how universal newlines works (it only applies to text mode). It can be None, ‘’, ‘n’, ‘r’, and ‘rn’. It works as follows:
On input, if newline is None, universal newlines mode is enabled. Lines in the input can end in ‘n’, ‘r’, or ‘rn’, and these are translated into ‘n’ before being returned to the caller. If it is ‘’, universal newline mode is enabled, but line endings are returned to the caller untranslated. If it has any of the other legal values, input lines are only terminated by the given string, and the line ending is returned to the caller untranslated.
On output, if newline is None, any ‘n’ characters written are translated to the system default line separator, os.linesep. If newline is ‘’ or ‘n’, no translation takes place. If newline is any of the other legal values, any ‘n’ characters written are translated to the given string.
If closefd is False, the underlying file descriptor will be kept open when the file is closed. This does not work when a file name is given and must be True in that case.
A custom opener can be used by passing a callable as opener. The underlying file descriptor for the file object is then obtained by calling opener with (file, flags). opener must return an open file descriptor (passing os.open as opener results in functionality similar to passing None).
open() returns a file object whose type depends on the mode, and through which the standard file operations such as reading and writing are performed. When open() is used to open a file in a text mode (‘w’, ‘r’, ‘wt’, ‘rt’, etc.), it returns a TextIOWrapper. When used to open a file in a binary mode, the returned class varies: in read binary mode, it returns a BufferedReader; in write binary and append binary modes, it returns a BufferedWriter, and in read/write mode, it returns a BufferedRandom.
It is also possible to use a string or bytearray as a file for both reading and writing. For strings StringIO can be used like a file opened in a text mode, and for bytes a BytesIO can be used like a file opened in a binary mode.
- static _os_chmod(path, mode, *, dir_fd=None, follow_symlinks=True)#
Change the access permissions of a file.
- path
Path to be modified. May always be specified as a str, bytes, or a path-like object. On some platforms, path may also be specified as an open file descriptor. If this functionality is unavailable, using it raises an exception.
- mode
Operating-system mode bitfield.
- dir_fd
If not None, it should be a file descriptor open to a directory, and path should be relative; path will then be relative to that directory.
- follow_symlinks
If False, and the last element of the path is a symbolic link, chmod will modify the symbolic link itself instead of the file the link points to.
- It is an error to use dir_fd or follow_symlinks when specifying path as
an open file descriptor.
- dir_fd and follow_symlinks may not be implemented on your platform.
If they are unavailable, using them will raise a NotImplementedError.
- static _os_chown(path, uid, gid, *, dir_fd=None, follow_symlinks=True)#
Change the owner and group id of path to the numeric uid and gid.
- path
Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int.
- dir_fd
If not None, it should be a file descriptor open to a directory, and path should be relative; path will then be relative to that directory.
- follow_symlinks
If False, and the last element of the path is a symbolic link, stat will examine the symbolic link itself instead of the file the link points to.
path may always be specified as a string. On some platforms, path may also be specified as an open file descriptor.
If this functionality is unavailable, using it raises an exception.
- If dir_fd is not None, it should be a file descriptor open to a directory,
and path should be relative; path will then be relative to that directory.
- If follow_symlinks is False, and the last element of the path is a symbolic
link, chown will modify the symbolic link itself instead of the file the link points to.
- It is an error to use dir_fd or follow_symlinks when specifying path as
an open file descriptor.
- dir_fd and follow_symlinks may not be implemented on your platform.
If they are unavailable, using them will raise a NotImplementedError.
- static _os_replace(src, dst, *, src_dir_fd=None, dst_dir_fd=None)#
Rename a file or directory, overwriting the destination.
- If either src_dir_fd or dst_dir_fd is not None, it should be a file
descriptor open to a directory, and the respective path string (src or dst) should be relative; the path will then be relative to that directory.
- src_dir_fd and dst_dir_fd, may not be implemented on your platform.
If they are unavailable, using them will raise a NotImplementedError.
- static _pickle_dump(obj, file, protocol=None, *, fix_imports=True, buffer_callback=None)#
Write a pickled representation of obj to the open file object file.
This is equivalent to
Pickler(file, protocol).dump(obj)
, but may be more efficient.The optional protocol argument tells the pickler to use the given protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default protocol is 4. It was introduced in Python 3.4, and is incompatible with previous versions.
Specifying a negative protocol version selects the highest protocol version supported. The higher the protocol used, the more recent the version of Python needed to read the pickle produced.
The file argument must have a write() method that accepts a single bytes argument. It can thus be a file object opened for binary writing, an io.BytesIO instance, or any other custom object that meets this interface.
If fix_imports is True and protocol is less than 3, pickle will try to map the new Python 3 names to the old module names used in Python 2, so that the pickle data stream is readable with Python 2.
If buffer_callback is None (the default), buffer views are serialized into file as part of the pickle stream. It is an error if buffer_callback is not None and protocol is None or smaller than 5.
- _pickle_protocol = 4#
- static _shutil_copyfile(src, dst, *, follow_symlinks=True)#
Copy data from src to dst in the most efficient way possible.
If follow_symlinks is not set and src is a symbolic link, a new symlink will be created instead of copying the file it points to.
- static _time_time()#
time() -> floating point number
Return the current time in seconds since the Epoch. Fractions of a second may be present if the system clock provides them.
- opener(path, flags)[source]#
Database open helper when creation may be needed.
The high-level Python open() function cannot specify a file mode for creation. Using this as the opener with the saved mode lets us do that.
SCons.exitfuncs module#
Register functions which are executed when SCons exits for any reason.