16 std::filesystem::path canonical = std::filesystem::canonical(located->path, ec);
18 canonical = located->path;
23 return std::unexpected(std::move(loaded.error()));
31 const std::filesystem::path& directory,
32 std::string_view marker_file)
41 return std::unexpected(std::move(added.error()));
47 std::string_view file_name,
48 std::span<const std::filesystem::path> roots)
50 Failure failure {
"header not found: " + std::string(file_name), {} };
52 for (
const auto& root : roots) {
60 const std::filesystem::path header = *found / file_name;
61 if (
auto included =
eval_file(header); !included) {
62 return std::unexpected(std::move(included.error()));
67 return std::unexpected(std::move(failure));
76 const std::filesystem::path& prefix,
77 std::string_view base_name)
86 return std::unexpected(
Failure {
"empty compile flag", {} });
Failure to_failure(const Platform::AcquireFailure &failure)
Result< void > apply_or_stage(Stage stage, std::string value)
Apply an item to the running session, or stage it until start_session.
Result< std::filesystem::path > load_library_from_prefix(const std::filesystem::path &prefix, std::string_view base_name)
Load a shared library by name from one prefix.
std::expected< T, Failure > Result
Result of a Host call.
Result< void > add_compile_flag(const std::string &flag)
Add a compile flag to the JIT.
Result< std::filesystem::path > add_include_root(const std::filesystem::path &directory, std::string_view marker_file)
Add a directory to the JIT include search path.
Result< std::filesystem::path > add_header(std::string_view file_name, std::span< const std::filesystem::path > roots)
Include a header in the session.
Result< void > eval_file(const std::filesystem::path &path)
Evaluate a source file by including it.
Result< std::filesystem::path > load_library(const std::filesystem::path &path)
Load a shared library from an explicit file path.
std::vector< std::filesystem::path > tried
Why a Host call was refused, with every path that was checked.