Module v.builder stdlib

Dependencies from vmod:
Imported by:
Show selected OS-specific symbols.
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.


This section is empty.


#constant no_compiler_error

pub const no_compiler_error = '
Error: no C compiler detected.

You can find instructions on how to install one in the V wiki:

If you think you have one installed, make sure it is in your PATH.
If you do have one in your PATH, please raise an issue on GitHub:

You can also use `v doctor`, to see what V knows about your current environment.

You can also seek #help on Discord:

Sum types

This section is empty.


#fn compile

fn compile(command string, pref_ &v.pref.Preferences, backend_cb fn (mut &Builder))

#fn module_path

fn module_path(mod string) string

#fn msvc_string_flags

fn msvc_string_flags(cflags []v.cflag.CFlag) MsvcStringFlags

pub fn (cflags []CFlag) msvc_string_flags() MsvcStringFlags {

#fn verror

fn verror(s string)


#struct Builder

pub struct Builder {
	compiled_dir string // contains os.real_path() of the dir of the final file being compiled, or the dir itself when doing `v .`
	module_path  string
pub mut:
	checker             &checker.Checker = unsafe { nil }
	transformer         &transformer.Transformer = unsafe { nil }
	out_name_c          string
	out_name_js         string
	stats_lines         int // size of backend generated source code in lines
	stats_bytes         int // size of backend generated source code in bytes
	nr_errors           int // accumulated error count of scanner, parser, checker, and builder
	nr_warnings         int // accumulated warning count of scanner, parser, checker, and builder
	nr_notices          int // accumulated notice count of scanner, parser, checker, and builder
	pref                &pref.Preferences = unsafe { nil }
	module_search_paths []string
	parsed_files        []&ast.File
	//$if windows {
	cached_msvc MsvcResult
	table     &ast.Table = unsafe { nil }
	ccoptions CcompilerOptions
	// Note: changes in mod `builtin` force invalidation of every other .v file
	mod_invalidates_paths map[string][]string // changes in mod `os`, invalidate only .v files, that do `import os`
	mod_invalidates_mods  map[string][]string // changes in mod `os`, force invalidation of mods, that do `import os`
	path_invalidates_mods map[string][]string // changes in a .v file from `os`, invalidates `os`
	crun_cache_keys       []string // target executable + top level source files; filled in by Builder.should_rebuild
	executable_exists     bool     // if the executable already exists, don't remove new executable after `v run`

#fn new_builder

fn new_builder(pref_ &v.pref.Preferences) Builder

#fn (&Builder) interpret_text

fn (mut b &Builder) interpret_text(code string, v_files []string) !

#fn (&Builder) front_stages

fn (mut b &Builder) front_stages(v_files []string) !

#fn (&Builder) middle_stages

fn (mut b &Builder) middle_stages() !

#fn (&Builder) front_and_middle_stages

fn (mut b &Builder) front_and_middle_stages(v_files []string) !

#fn (&Builder) parse_imports

fn (mut b &Builder) parse_imports()

parse all deps from already parsed files

#fn (&Builder) resolve_deps

fn (mut b &Builder) resolve_deps()

#fn (&Builder) import_graph

fn (b &Builder) import_graph() &v.depgraph.DepGraph

graph of all imported modules

#fn (&Builder) v_files_from_dir

fn (b &Builder) v_files_from_dir(dir string) []string

#fn (&Builder) log

fn (b &Builder) log(s string)

#fn (&Builder) info

fn (b &Builder) info(s string)

#fn (&Builder) find_module_path

fn (b &Builder) find_module_path(mod string, fpath string) !string

TODO: try to merge this & util.module functions to create a reliable multi use function. see comments in util/module.v

#fn (&Builder) show_total_warns_and_errors_stats

fn (b &Builder) show_total_warns_and_errors_stats()

#fn (&Builder) print_warnings_and_errors

fn (mut b &Builder) print_warnings_and_errors()

#fn (&Builder) error_with_pos

fn (b &Builder) error_with_pos(s string, fpath string, pos v.token.Pos) v.errors.Error

#fn (&Builder) show_c_compiler_output

fn (mut v &Builder) show_c_compiler_output(res os.Result)

#fn (&Builder) post_process_c_compiler_output

fn (mut v &Builder) post_process_c_compiler_output(res os.Result)

#fn (&Builder) show_cc

fn (mut v &Builder) show_cc(cmd string, response_file string, response_file_content string)

#fn (&Builder) setup_ccompiler_options

fn (mut v &Builder) setup_ccompiler_options(ccompiler string)

#fn (&Builder) all_args

fn (v &Builder) all_args(ccoptions CcompilerOptions) []string

#fn (&Builder) thirdparty_object_args

fn (v &Builder) thirdparty_object_args(ccoptions CcompilerOptions, middle []string) []string

#fn (&Builder) setup_output_name

fn (mut v &Builder) setup_output_name()

#fn (&Builder) cc

fn (mut v &Builder) cc()

#fn (&Builder) ensure_linuxroot_exists

fn (mut b &Builder) ensure_linuxroot_exists(sysroot string)

#fn (&Builder) cc_linux_cross

fn (mut b &Builder) cc_linux_cross()

#fn (&Builder) cc_windows_cross

fn (mut c &Builder) cc_windows_cross()

#fn (&Builder) build_thirdparty_obj_files

fn (mut b &Builder) build_thirdparty_obj_files()

#fn (&Builder) build_thirdparty_obj_file

fn (mut v &Builder) build_thirdparty_obj_file(mod string, path string, moduleflags []v.cflag.CFlag)

#fn (&Builder) quote_compiler_name

fn (mut v &Builder) quote_compiler_name(name string) string

#fn (&Builder) find_win_cc

fn (mut v &Builder) find_win_cc() !

#fn (&Builder) get_os_cflags

fn (mut v &Builder) get_os_cflags() []v.cflag.CFlag

get flags for current os

#fn (&Builder) get_rest_of_module_cflags

fn (mut v &Builder) get_rest_of_module_cflags(c &v.cflag.CFlag) []v.cflag.CFlag

#fn (&Builder) myfree

fn (mut b &Builder) myfree()

Temporary, will be done by -autofree

#fn (&Builder) exit_on_invalid_syntax

fn (b &Builder) exit_on_invalid_syntax()

#fn (&Builder) run_compiled_executable_and_exit

fn (mut b &Builder) run_compiled_executable_and_exit()

#fn (&Builder) cleanup_run_executable_after_exit

fn (mut v &Builder) cleanup_run_executable_after_exit(exefile string)

#fn (&Builder) set_module_lookup_paths

fn (mut v &Builder) set_module_lookup_paths()

'strings' => 'VROOT/vlib/strings' 'installed_mod' => '~/.vmodules/installed_mod' 'local_mod' => '/path/to/current/dir/local_mod'

#fn (&Builder) get_builtin_files

fn (v &Builder) get_builtin_files() []string

#fn (&Builder) get_user_files

fn (v &Builder) get_user_files() []string

#fn (&Builder) dump_c_options

fn (b &Builder) dump_c_options(all_args []string)

#fn (&Builder) dump_modules

fn (b &Builder) dump_modules(mods []string)

#fn (&Builder) dump_files

fn (b &Builder) dump_files(files []string)

#fn (&Builder) cc_msvc

fn (mut v &Builder) cc_msvc()

#fn (&Builder) build_thirdparty_obj_file_with_msvc

fn (mut v &Builder) build_thirdparty_obj_file_with_msvc(mod string, path string, moduleflags []v.cflag.CFlag)

#fn (&Builder) rebuild_modules

fn (mut b &Builder) rebuild_modules()

#fn (&Builder) find_invalidated_modules_by_files

fn (mut b &Builder) find_invalidated_modules_by_files(all_files []string) []string

#fn (&Builder) v_build_module

fn (mut b &Builder) v_build_module(vexe string, imp_path string)

#fn (&Builder) rebuild_cached_module

fn (mut b &Builder) rebuild_cached_module(vexe string, imp_path string) string

#fn (&Builder) handle_usecache

fn (mut b &Builder) handle_usecache(vexe string)

#fn (&Builder) should_rebuild

fn (mut b &Builder) should_rebuild() bool

#fn (&Builder) rebuild

fn (mut b &Builder) rebuild(backend_cb fn (mut &Builder))

#fn (&Builder) get_vtmp_filename

fn (mut b &Builder) get_vtmp_filename(base_file_name string, postfix string) string


This section is empty.


This section is empty.