From f3351b6a290bdabfaa3d9f6f738eb59cc4b7f6a3 Mon Sep 17 00:00:00 2001 From: Joe Conigliaro Date: Sun, 12 Jun 2022 02:22:04 +1000 Subject: [PATCH] pref: maintain order of 'debug' in compile defines as mod cache key depends on it --- vlib/v/pref/default.v | 5 +++++ vlib/v/pref/pref.v | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vlib/v/pref/default.v b/vlib/v/pref/default.v index 03fa934a4f..0d89451a6a 100644 --- a/vlib/v/pref/default.v +++ b/vlib/v/pref/default.v @@ -92,11 +92,16 @@ pub fn (mut p Preferences) fill_with_defaults() { } else { // enable the GC by default p.gc_mode = .boehm_full_opt + // NOTE: these are added to p.compile_defines[_all] + // more than once when building modules for usecache p.parse_define('gcboehm') p.parse_define('gcboehm_full') p.parse_define('gcboehm_opt') } } + if p.is_debug { + p.parse_define('debug') + } if p.os == ._auto { // No OS specifed? Use current system p.os = get_host_os() diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index 5adbfca353..4a2e52beb9 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -733,9 +733,6 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin } } } - if res.is_debug { - res.parse_define('debug') - } if command == 'crun' { res.is_crun = true }