rb_ctx.h
¶
Internal tracked context for the Rootbeer execution environment.
When executing the lua script, Rootbeer needs to keep track of the context in which the script is running to accurately generate a revision. The actual logic for generating a revision is in rb_revision.h. This context merely keeps tracks of all the necessary inputs and desired outputs which can be used to deterministically generate a revision.
Defines
-
LUA_LIB¶
The path to the Lua library used by Rootbeer.
This is the directory where the Lua scripts are located. It is used to set up the Lua environment so that it can require files from this directory.
-
RB_CTX_LUAFILES_MAX¶
Maximum number of Lua files that can be tracked in the context.
-
RB_CTX_EXTFILES_MAX¶
Maximum number of extra files that can be tracked in the context.
-
RB_CTX_TRANSFORMS_MAX¶
Maximum number of plugin transforms that can be tracked in the context.
-
RB_MAX_INTERMEDIATE_ID_LENGTH¶
Maximum length of an intermediate ID.
-
struct rb_ctx_t
- #include <rb_ctx.h>
Rootbeer context structure. This is the main structure that keeps track of all the necessary parameters to deterministically generate a revision. It gets populated when
rb apply <file>
is called.Public Members
-
lua_State *lua_state¶
Lua state from starting the LuaJIT VM.
-
char *script_path¶
Absolute path to the Lua script being executed.
-
char *script_dir¶
Directory containing script_path.
-
rb_strlist_t lua_modules¶
Extra Lua modules that are required by the script. These are tracked through our
require
hook in the Lua VM.
-
rb_strlist_t static_inputs¶
Additional static inputs that are used by the script. These can be templates, files to link, anything non-generated.
-
rb_idlist_t intermediates¶
Internal list of files generated by plugins to aid revision storage. These are stored inside the revision and store historical data.
-
rb_strlist_t generated¶
Outputs of the entire revision generation which go out of the store. This list is tracked to easily revert the revision if needed.
-
char **lua_files¶
Filenames of extra lua scripts loaded, relative to the script path. The lua VM is setup to allow requiring files in
lua/
.
-
size_t lua_files_count¶
The number of extra lua scripts loaded, relative to the script path.
-
char **ext_files¶
Any extra files that are used as inputs to the plugins. They are always relative to the script path. Think similar to Nix’s
builtins.readFile
.
-
size_t ext_files_count¶
The number of extra files that are used as inputs to the plugins.
-
char **plugin_transforms¶
Any intermediate files generated by plugins to populate inputs. The best example of this is how packaging is structured, where given an array of packages, the plugin resolves all versions and package hashes.
-
size_t plugin_transforms_count¶
The number of intermediate files generated by plugins.
-
lua_State *lua_state¶