From dc30089c74051fbb085820ad015cca02b71f4a48 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 31 May 2022 09:30:45 +0300 Subject: [PATCH] v.util, v.builder: fix util.module_is_builtin on macos with -usecache --- vlib/v/builder/rebuilding.v | 2 +- vlib/v/util/util.v | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/vlib/v/builder/rebuilding.v b/vlib/v/builder/rebuilding.v index ee8aac0c1f..c2f13547d1 100644 --- a/vlib/v/builder/rebuilding.v +++ b/vlib/v/builder/rebuilding.v @@ -211,7 +211,7 @@ fn (mut b Builder) handle_usecache(vexe string) { // strconv is already imported inside builtin, so skip generating its object file // TODO: incase we have other modules with the same name, make sure they are vlib // is this even doign anything? - if imp in ['strconv', 'strings', 'dlmalloc'] { + if util.module_is_builtin(imp) { continue } if imp in built_modules { diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v index 0178ef749d..12e0372348 100644 --- a/vlib/v/util/util.v +++ b/vlib/v/util/util.v @@ -37,12 +37,8 @@ const ( ] ) -const builtin_module_names = ['builtin', 'strconv', 'strings', 'dlmalloc', 'math'] - pub fn module_is_builtin(mod string) bool { - // NOTE: using util.builtin_module_parts here breaks -usecache on macos - return mod in util.builtin_module_names - // return mod in util.builtin_module_parts + return mod in util.builtin_module_parts } pub fn tabs(n int) string {