20 #ifndef BUILDCACHE_LUA_WRAPPER_HPP_
21 #define BUILDCACHE_LUA_WRAPPER_HPP_
23 #include <base/env_utils.hpp>
24 #include <wrappers/program_wrapper.hpp>
27 typedef struct lua_State lua_State;
39 const std::string& lua_script_path);
50 bool call(
const std::string& func);
52 const std::string& script()
const {
61 void init_lua_state();
62 void setup_lua_libs_and_globals();
63 [[noreturn]]
void bail(
const std::string& message);
65 lua_State* m_state =
nullptr;
66 const std::string m_script_path;
86 #endif // BUILDCACHE_LUA_WRAPPER_HPP_
string_list_t get_relevant_arguments() override
Get relevant command line arguments for hashing.
Definition: lua_wrapper.cpp:565
void resolve_args() override
Resolve arguments on the command line.
Definition: lua_wrapper.cpp:537
Path to an executable file.
Definition: file_utils.hpp:127
std::string get_program_id() override
Get a string that uniquely identifies the program.
Definition: lua_wrapper.cpp:558
Run results from an external command.
Definition: sys_utils.hpp:30
The top level namespace.
Definition: compressor.cpp:34
A convenient vector of strings container with support functions for program argument handling.
Definition: string_list.hpp:30
Definition: lua_wrapper.hpp:45
string_list_t get_input_files() override
Get the paths to the input files for the command.
Definition: lua_wrapper.cpp:579
The base class for all program wrappers.
Definition: program_wrapper.hpp:38
string_list_t get_implicit_input_files() override
Get a list of paths to implicit input files.
Definition: lua_wrapper.cpp:593
std::map< std::string, expected_file_t > get_build_files() override
Get the paths to the files that are to be generated by the command.
Definition: lua_wrapper.cpp:550
bool can_handle_command() override
Check if this class implements a wrapper for the given command.
Definition: lua_wrapper.cpp:517
A class for temporarily modifying an environment variable.
Definition: env_utils.hpp:55
std::map< std::string, std::string > get_relevant_env_vars() override
Get relevant environment variables for hashing.
Definition: lua_wrapper.cpp:572
string_list_t get_capabilities() override
Generate a list of supported capabilites.
Definition: lua_wrapper.cpp:543
std::string preprocess_source() override
Generate the preprocessed source text.
Definition: lua_wrapper.cpp:586
sys::run_result_t run_for_miss() override
Run the actual command (when there is a cache miss).
Definition: lua_wrapper.cpp:600
A program wrapper that wraps Lua scripts.
Definition: lua_wrapper.hpp:35