embed_file: rename debug_embed_file_in_prod -> force_embed_file (#14523)

master
Larpon 2022-05-25 17:26:17 +02:00 committed by GitHub
parent 59e57f0c62
commit 6c08af63ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -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_codegen` | Prints automatically generated V code during the scanning phase |
| `debug_interface_table` | Prints generated interfaces during C generation | | `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_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 | | `print_vweb_template_expansions` | Prints vweb compiled HTML files |
| `time_checking` | Prints the time spent checking files and other related information | | `time_checking` | Prints the time spent checking files and other related information |
| `time_parsing` | Prints the time spent parsing 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_thirdparty_obj_files` | Prints details about built thirdparty obj files |
| `trace_usecache` | Prints details when -usecache is used | | `trace_usecache` | Prints details when -usecache is used |
| `trace_embed_file` | Prints details when $embed_file is used | | `trace_embed_file` | Prints details when $embed_file is used |
| `force_embed_file` | Force embedding of file(s) with `$embed_file('somefile')` |

View File

@ -111,7 +111,7 @@ pub fn find_index_entry_by_path(start voidptr, path string, algo string) &EmbedF
x++ 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)}') eprintln('>> v.embed_file find_index_entry_by_path ${ptr_str(start)}, id: $x.id, path: "$path", algo: "$algo" => ${ptr_str(x)}')
} }
return x return x

View File

@ -6,7 +6,7 @@ import v.ast
import v.pref import v.pref
fn (mut g Gen) embed_file_is_prod_mode() bool { 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 true
} }
return false return false

View File

@ -165,7 +165,7 @@ fn (mut p Parser) comptime_call() ast.ComptimeCall {
} }
p.register_auto_import('v.preludes.embed_file') p.register_auto_import('v.preludes.embed_file')
if embed_compression_type == 'zlib' 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') p.register_auto_import('v.preludes.embed_file.zlib')
} }
return ast.ComptimeCall{ return ast.ComptimeCall{