From 6c08af63ff09e8f210948b709fdef6644a086a58 Mon Sep 17 00:00:00 2001 From: Larpon Date: Wed, 25 May 2022 17:26:17 +0200 Subject: [PATCH] embed_file: rename debug_embed_file_in_prod -> force_embed_file (#14523) --- CONTRIBUTING.md | 2 +- vlib/v/embed_file/embed_file.v | 2 +- vlib/v/gen/c/embed.v | 2 +- vlib/v/parser/comptime.v | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eda847aec9..626ca9a26e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -191,7 +191,6 @@ to create a copy of the compiler rather than replacing it with `v self`. | `debug_codegen` | Prints automatically generated V code during the scanning phase | | `debug_interface_table` | Prints generated interfaces during C generation | | `debug_interface_type_implements` | Prints debug information when checking that a type implements in interface | -| `debug_embed_file_in_prod` | Prints debug information about the embedded files with `$embed_file('somefile')` | | `print_vweb_template_expansions` | Prints vweb compiled HTML files | | `time_checking` | Prints the time spent checking files and other related information | | `time_parsing` | Prints the time spent parsing files and other related information | @@ -204,3 +203,4 @@ to create a copy of the compiler rather than replacing it with `v self`. | `trace_thirdparty_obj_files` | Prints details about built thirdparty obj files | | `trace_usecache` | Prints details when -usecache is used | | `trace_embed_file` | Prints details when $embed_file is used | +| `force_embed_file` | Force embedding of file(s) with `$embed_file('somefile')` | diff --git a/vlib/v/embed_file/embed_file.v b/vlib/v/embed_file/embed_file.v index 7c8d63f098..afca2ceedc 100644 --- a/vlib/v/embed_file/embed_file.v +++ b/vlib/v/embed_file/embed_file.v @@ -111,7 +111,7 @@ pub fn find_index_entry_by_path(start voidptr, path string, algo string) &EmbedF x++ } } - $if debug_embed_file_in_prod ? { + $if trace_embed_file ? { eprintln('>> v.embed_file find_index_entry_by_path ${ptr_str(start)}, id: $x.id, path: "$path", algo: "$algo" => ${ptr_str(x)}') } return x diff --git a/vlib/v/gen/c/embed.v b/vlib/v/gen/c/embed.v index ce4778fbc8..5fb8fbb410 100644 --- a/vlib/v/gen/c/embed.v +++ b/vlib/v/gen/c/embed.v @@ -6,7 +6,7 @@ import v.ast import v.pref fn (mut g Gen) embed_file_is_prod_mode() bool { - if g.pref.is_prod || 'debug_embed_file_in_prod' in g.pref.compile_defines { + if g.pref.is_prod || 'force_embed_file' in g.pref.compile_defines { return true } return false diff --git a/vlib/v/parser/comptime.v b/vlib/v/parser/comptime.v index 54e1f2a8df..6f2a9f8ef9 100644 --- a/vlib/v/parser/comptime.v +++ b/vlib/v/parser/comptime.v @@ -165,7 +165,7 @@ fn (mut p Parser) comptime_call() ast.ComptimeCall { } p.register_auto_import('v.preludes.embed_file') if embed_compression_type == 'zlib' - && (p.pref.is_prod || 'debug_embed_file_in_prod' in p.pref.compile_defines) { + && (p.pref.is_prod || 'force_embed_file' in p.pref.compile_defines) { p.register_auto_import('v.preludes.embed_file.zlib') } return ast.ComptimeCall{