curry.config module
Code related to the configuration of Sprite.
- curry.config.curry2icurry_tool(name=None)[source]
The name of the route from Curry to ICurry.
frontendruns the Curry front end and the built-in translation;icurryruns the icurry program.- Parameters:
name – A name given by the caller. It wins when it is not None.
The environment variable SPRITE_CURRY2ICURRY comes next, then the choice of configure, then whichever tool is installed, the front end first.
- curry.config.curry_frontend(cached=[])[source]
The Curry front end, if it is configured. Otherwise, None.
- curry.config.currypath(reset=False, cache=[])[source]
Gets the Curry path from the environment variable CURRYPATH and appends the system path.
- Parameters:
reset – If true, the cache will be cleared and the Curry path reloaded from the environment.
cache – A list into which the Cury path is cached.
- curry.config.cxx_compiler(cached=[])[source]
The compiler the installed C++ runtime was built with, as the build recorded it in sysconfig/cxx_compiler: the version and the target of CXX_POSTINSTALL (
g++ -dumpfullversionand-dumpmachine), one line. The ABI stamp of a compiled module digests it (curry.backends.cxx.toolchain.object_digest), so a runtime built with another compiler compiles every module again. The empty string for an installation that names no compiler: one staged before the record existed, or one configured without a compiler. Read once per process, as the other tools are.
- curry.config.cxx_flavor()[source]
The flavor of the installed C++ runtime: ‘release’, or ‘debug’ for a build with make DEBUG=1. The release flavor has no assertions. The C++ backend compiles generated modules in the same flavor unless the interpreter flag
debugis set (see curry.backends.cxx.toolchain.Cpp2So.flavor). An installation that names no flavor, one staged before the flavors existed, is a release build.
- curry.config.cxx_gc()[source]
The collector of the installed C++ runtime: ‘wdgc’, the block heap and the mark-and-sweep collector of the tree, or ‘mps’ for a build with make GC=mps, the Memory Pool System. The C++ backend compiles generated modules for the same collector (see curry.backends.cxx.toolchain.gc_flags). An installation that names no collector is a wdgc build.
- curry.config.cxx_gc_write_counters()[source]
True when the installed C++ runtime counts the writes into old nodes (make GC_WRITE_COUNTERS=1; see src/cyrt/graph/gc/wdgc.cpp). Some of the counted sites are in the runtime headers, so the C++ backend compiles generated modules with the same macro (see curry.backends.cxx.toolchain.gc_flags). An installation that names no value is a build without them.
- curry.config.cxx_pch_cache_dir()[source]
The root of the precompiled header in the cache directory of the user:
<user_cache_dir>/pch/<installation_key>. Each installation gets a directory of its own, because the toolchain removes the stale members of the directory it uses (PrecompiledHeader.remove_stale_members), and the members of two installations would otherwise remove each other.
- curry.config.cxx_pch_root()[source]
The directory under which the C++ backend keeps its precompiled header. Returns None when the header is disabled.
SPRITE_CXX_PCH_ROOT names the directory. Set it to the empty string to compile without the header. Without the variable the header lives beside the installed headers, where the C++ compiler finds it with no extra flag, unless the installation is a package: its include directory cannot be written, or it lies in a conda environment (see in_conda_prefix). Then the header goes to the cache directory of the user (see cxx_pch_cache_dir), so that nothing is written into the package at run time.
- curry.config.expression_modname(n)[source]
The name of the module that holds compiled expression number
n. Each expression gets its own name: the C++ backend resolves a module’s symbols against the same-named module loaded first, so two expression modules must never share a name.
- curry.config.icurry_tool(cached=[])[source]
The icurry program, if it is configured. Otherwise, None.
- curry.config.in_conda_prefix(path)[source]
Tells whether
pathlies in a conda environment: a directory with aconda-metaentry is the path or one of its parents, by real path. A conda package must not be written at run time; conda does not track the files, and they stay behind when the package is removed.
- curry.config.installation_key()[source]
A short digest of the real path of the installation. It names the files of this installation in a directory that several installations share.
- curry.config.is_anonymous_modname(name)[source]
Tells whether
namebelongs to an anonymous module: an interactive module compiled without a name, or an expression module. curry.compile numbers these per process, so the same text gets another name in another process. The ICurry cache leaves the name out of its key for these modules.
- curry.config.product_cache_dir()[source]
The root of the product cache (curry.toolchain._productcache), where the C++ backend keeps a copy of each shared object it compiles, with the generated C++ and the ABI stamp, so that a product compiled once is not compiled again by another tree of the same user, or by the same tree after its products were removed. Returns None when the cache is off.
SPRITE_PRODUCT_CACHE names the directory. Without the variable, or with the empty string, the cache is off: every product is compiled in place, as before the cache existed. The test runner and the worktree script name a directory of their own; a developer who wants one across trees names it, for instance
<user_cache_dir>/products.
- curry.config.supported_syslibs()[source]
The names of the system library modules that Sprite compiles, the Prelude first:
syslibs()withoutunsupported_syslibs(). The installation compiles them for both backends.
- curry.config.syslibs()[source]
The names of the modules of the system Curry library. Each one is found as a source under
system_curry_path().
- curry.config.unsupported_syslibs()[source]
The names of the system library modules that Sprite cannot compile: their externals have no implementation in a backend, they import such a module, or the importer cannot load them. See CURRYLIB_UNSUPPORTED_MODULES in Make.include.