Provide roc_cache_dir everywhere

This commit is contained in:
Richard Feldman 2022-11-20 17:03:17 -05:00
parent 13bed30411
commit 721841fa1f
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
41 changed files with 303 additions and 114 deletions

View file

@ -1,10 +1,15 @@
use bumpalo::Bump;
use roc_load::{ExecutionMode, LoadConfig, LoadedModule, Threading};
use roc_packaging::cache::RocCacheDir;
use roc_reporting::report::DEFAULT_PALETTE;
use roc_target::TargetInfo;
use std::path::Path;
pub fn load_module(src_file: &Path, threading: Threading) -> LoadedModule {
pub fn load_module(
src_file: &Path,
roc_cache_dir: RocCacheDir<'_>,
threading: Threading,
) -> LoadedModule {
let subs_by_module = Default::default();
let load_config = LoadConfig {
@ -16,8 +21,13 @@ pub fn load_module(src_file: &Path, threading: Threading) -> LoadedModule {
};
let arena = Bump::new();
let loaded =
roc_load::load_and_typecheck(&arena, src_file.to_path_buf(), subs_by_module, load_config);
let loaded = roc_load::load_and_typecheck(
&arena,
src_file.to_path_buf(),
subs_by_module,
roc_cache_dir,
load_config,
);
match loaded {
Ok(x) => x,