Skip to content

Commit

Permalink
v.util: use temporary workaround for the vinix build problem (when VF…
Browse files Browse the repository at this point in the history
…LAGS is set, and `-ldflags ` is passed at the same time)
  • Loading branch information
spytheman committed Nov 10, 2024
1 parent 1818e63 commit e3dfe60
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions vlib/v/util/util.v
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down

0 comments on commit e3dfe60

Please sign in to comment.