@@ -100,8 +100,8 @@ fn saveCacheFile(file_cache_path: []const u8, file_binary: []const u8) SaveCache
100
100
fn saveToCacheInternal (
101
101
// SKILL_ISSUE: force my formatter to put the arguments in a vertical line
102
102
allocator : Allocator ,
103
- roc_cache_file : RocCacheFile ,
104
103
xdg_cache_home : ? []const u8 ,
104
+ roc_cache_file : RocCacheFile ,
105
105
comptime save : fn (file_cache_path : []const u8 , file_binary : []const u8 ) SaveCacheFileError ! void ,
106
106
) ! void {
107
107
const file_cache_path = switch (roc_cache_file ) {
@@ -122,12 +122,15 @@ fn saveToCacheInternal(
122
122
pub fn saveToCache (allocator : Allocator , roc_cache_file : RocCacheFile ) ! void {
123
123
const xdg_cache_home = getXdgCacheHome (allocator );
124
124
defer allocator .free (xdg_cache_home );
125
- try saveToCacheInternal (allocator , roc_cache_file , xdg_cache_home , saveCacheFile );
125
+ try saveToCacheInternal (allocator , xdg_cache_home , roc_cache_file , saveCacheFile );
126
126
}
127
127
128
- //pub fn setRocCompiler(allocator: Allocator, compilerCacheFile: CompilerCacheFile) !void {
129
- //const parts = [_][]const u8{ test_cache_folder, "roc", relative_path };
130
- //const sss = try std.fs.path.join(allocator, &parts);
128
+ //pub fn setRocCompilerInternal(allocator: Allocator, version_name: []const u8) !void {
129
+ //}
130
+ //pub fn setRocCompiler(allocator: Allocator, version_name: []const u8) !void {
131
+ //const xdg_cache_home = getXdgCacheHome(allocator);
132
+ //defer allocator.free(xdg_cache_home);
133
+ //try setRocCompilerInternal(allocator, roc_cache_file, xdg_cache_home, saveCacheFile);
131
134
//}
132
135
133
136
const test_cache_folder = "./test-cache" ;
@@ -158,7 +161,7 @@ test "Compiler cache should save in the correct place with the correct data" {
158
161
};
159
162
// SKILL_ISSUE: I'm not sure how to set the environment variable in a
160
163
// cross-platform way so my tests don't call this function
161
- try saveToCacheInternal (allocator , RocCacheFile { .compiler = cache_file }, test_cache_folder , saveCacheFile );
164
+ try saveToCacheInternal (allocator , test_cache_folder , RocCacheFile { .compiler = cache_file }, saveCacheFile );
162
165
const expected_cache_file_local = try make_test_cache_file_path (allocator , "compiler/1.0.0" );
163
166
defer allocator .free (expected_cache_file_local );
164
167
0 commit comments