Fandango File Locations#
Where Does Fandango Look for Included Specs?#
In a Fandango spec, the include() function searches for Fandango files in a number of locations.
The actual rules for where Fandango searches are complex, versatile, and adhere to common standards.
Specifically, when including a .fan file using include(), Fandango searches for .fan files in the following locations, in this order:
In any directory
DIRexplicitly specified by-I DIRor--include-dir DIR.In any directory specified by the
$FANDANGO_PATHenvironment variable, if set. This variable is a colon-separated list of directories, e.g.$HOME/my_cool_fan_specs:/Volumes/Fandango:/opt/local/fandango-1.27which are searched from left to right.In the directory of the including file. This is the most common usage. If the including file has no file name (say, because it is a stream), the current directory is used.
In the directory
$HOME/.local/share/fandango. You can control this location by setting the$XDG_DATA_HOMEenvironment variable; see the XDG Base Directory Specification. On a Mac, the location$HOME/Library/Fandangois searched first.In one of the system directories
/usr/local/share/fandangoor/usr/share/fandango. You can control these locations by setting the$XDG_DATA_DIRSenvironment variable; see the XDG Base Directory Specification. On a Mac, the location/Library/Fandangois searched first.If the file to be included cannot be found in any of these locations, a
FileNotFoundErroris raised.
And then, there are two extra rules:
If the included file has an absolute path (say,
/usr/local/specs/spec.fan), only this absolute path will be used.If the included file has a relative path (say,
../spec.fan), then this relative path will be applied to the locations above. This is mostly useful when you have a path relative to the including file.
Tip
We recommend to store included Fandango specs either
in the directory where the including specs are, or
in
$HOME/.local/share/fandango(or$HOME/Library/Fandangoon a Mac).
Finally, keep in mind that include() is a Python function, so in principle, your spec can compute the file name and location in any way you like.
The simplest solution, however, is to use one of the “standard” locations as listed above.
Where Does Fandango Store Parsed Files?#
Fandango maintains a cache for parsed .fan files in order to retrieve them faster.
Use fandango clear-cache -n to retrieve its location:
$ fandango clear-cache -n
Would clear /home/runner/.cache/fandango
If you want to reclaim space, or if there is some incompatibility between parsed and cached files, use fandango clear-cache to clear the cache:
$ fandango clear-cache
Clearing /home/runner/.cache/fandango
Where is Fandango installed?#
This depends on your Python installation. You can query the location using
$ pip show fandango-fuzzer | grep Location
Location: /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages