From e3dfe60e9b0fd88a9bde6ed2985ea07cd779a171 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 10 Nov 2024 17:33:17 +0200 Subject: [PATCH] v.util: use temporary workaround for the vinix build problem (when VFLAGS is set, and `-ldflags ` is passed at the same time) --- vlib/v/util/util.v | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v index ffa105fe9f5d9d..d5771e2d01f4b6 100644 --- a/vlib/v/util/util.v +++ b/vlib/v/util/util.v @@ -510,10 +510,12 @@ pub fn replace_op(s string) string { } } +// join_env_vflags_and_os_args returns all the arguments (the ones from the env variable VFLAGS too), passed on the command line. pub fn join_env_vflags_and_os_args() []string { + // TODO: use a proper parser, instead of splitting on ' ' vosargs := os.getenv('VOSARGS') if vosargs != '' { - return non_empty(vosargs.split(' ')) + return vosargs.split(' ') } mut args := []string{} vflags := os.getenv('VFLAGS') @@ -523,15 +525,11 @@ pub fn join_env_vflags_and_os_args() []string { if os.args.len > 1 { args << os.args[1..] } - return non_empty(args) + return args } return os.args } -fn non_empty(arg []string) []string { - return arg.filter(it != '') -} - pub fn check_module_is_installed(modulename string, is_verbose bool, need_update bool) !bool { mpath := os.join_path_single(os.vmodules_dir(), modulename) mod_v_file := os.join_path_single(mpath, 'v.mod')