mirror of
https://github.com/vlang/v.git
synced 2025-09-09 07:15:50 -04:00
all: finish bootstrapping of @VCURRENTHASH
(#19517)
This commit is contained in:
parent
fe41bda6f9
commit
8023e25bea
@ -50,7 +50,7 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) {
|
||||
eprintln(' function: ${fn_name}()')
|
||||
eprintln(' message: ${s}')
|
||||
eprintln(' file: ${file}:${line_no}')
|
||||
eprintln(' v hash: ${@VHASH}') // TODO: use @VCURRENTHASH when bootstrapped
|
||||
eprintln(' v hash: ${@VCURRENTHASH}')
|
||||
eprintln('=========================================')
|
||||
$if native {
|
||||
C.exit(1) // TODO: native backtraces
|
||||
@ -104,7 +104,7 @@ pub fn panic(s string) {
|
||||
} $else {
|
||||
eprint('V panic: ')
|
||||
eprintln(s)
|
||||
eprintln('v hash: ${@VHASH}') // TODO: use @VCURRENTHASH when bootstrapped
|
||||
eprintln('v hash: ${@VCURRENTHASH}')
|
||||
$if native {
|
||||
C.exit(1) // TODO: native backtraces
|
||||
} $else $if exit_after_panic_message ? {
|
||||
|
@ -135,7 +135,7 @@ mut:
|
||||
fn_return_type ast.Type
|
||||
orm_table_fields map[string][]ast.StructField // known table structs
|
||||
//
|
||||
v_current_commit_hash string // same as V_CURRENT_COMMIT_HASH
|
||||
v_current_commit_hash string // same as old C.V_CURRENT_COMMIT_HASH
|
||||
}
|
||||
|
||||
pub fn new_checker(table &ast.Table, pref_ &pref.Preferences) &Checker {
|
||||
|
@ -747,9 +747,7 @@ pub fn (mut g Gen) gen_file() {
|
||||
}
|
||||
|
||||
pub fn (g &Gen) hashes() string {
|
||||
mut res := c_commit_hash_default.replace('@@@', version.vhash())
|
||||
res += c_current_commit_hash_default.replace('@@@', version.githash(g.pref.building_v))
|
||||
return res
|
||||
return c_commit_hash_default.replace('@@@', version.vhash())
|
||||
}
|
||||
|
||||
pub fn (mut g Gen) init() {
|
||||
|
@ -14,13 +14,6 @@ const c_commit_hash_default = '
|
||||
#endif
|
||||
'
|
||||
|
||||
// V_CURRENT_COMMIT_HASH is updated, when V is rebuilt inside a git repo.
|
||||
const c_current_commit_hash_default = '
|
||||
#ifndef V_CURRENT_COMMIT_HASH
|
||||
#define V_CURRENT_COMMIT_HASH "@@@"
|
||||
#endif
|
||||
'
|
||||
|
||||
const c_concurrency_helpers = '
|
||||
typedef struct __shared_map __shared_map;
|
||||
struct __shared_map {
|
||||
|
@ -75,11 +75,6 @@ pub fn githash(should_get_from_filesystem bool) string {
|
||||
}
|
||||
break
|
||||
}
|
||||
mut buf := [50]u8{}
|
||||
buf[0] = 0
|
||||
unsafe {
|
||||
bp := &buf[0]
|
||||
C.snprintf(&char(bp), 50, c'%s', C.V_CURRENT_COMMIT_HASH)
|
||||
return tos_clone(bp)
|
||||
}
|
||||
|
||||
return @VCURRENTHASH
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user