Skip to content

Commit b88e182

Browse files
committed
a
1 parent 4279a6a commit b88e182

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/cache.zig

+9-6
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ fn saveCacheFile(file_cache_path: []const u8, file_binary: []const u8) SaveCache
100100
fn saveToCacheInternal(
101101
// SKILL_ISSUE: force my formatter to put the arguments in a vertical line
102102
allocator: Allocator,
103-
roc_cache_file: RocCacheFile,
104103
xdg_cache_home: ?[]const u8,
104+
roc_cache_file: RocCacheFile,
105105
comptime save: fn (file_cache_path: []const u8, file_binary: []const u8) SaveCacheFileError!void,
106106
) !void {
107107
const file_cache_path = switch (roc_cache_file) {
@@ -122,12 +122,15 @@ fn saveToCacheInternal(
122122
pub fn saveToCache(allocator: Allocator, roc_cache_file: RocCacheFile) !void {
123123
const xdg_cache_home = getXdgCacheHome(allocator);
124124
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);
126126
}
127127

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);
131134
//}
132135

133136
const test_cache_folder = "./test-cache";
@@ -158,7 +161,7 @@ test "Compiler cache should save in the correct place with the correct data" {
158161
};
159162
// SKILL_ISSUE: I'm not sure how to set the environment variable in a
160163
// 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);
162165
const expected_cache_file_local = try make_test_cache_file_path(allocator, "compiler/1.0.0");
163166
defer allocator.free(expected_cache_file_local);
164167

0 commit comments

Comments
 (0)