diff --git a/.github/workflows/c2v_ci.yml b/.github/workflows/c2v_ci.yml index 0ed2b4a8ae..4cac63e62c 100644 --- a/.github/workflows/c2v_ci.yml +++ b/.github/workflows/c2v_ci.yml @@ -38,6 +38,15 @@ jobs: - uses: actions/checkout@v4 - name: Build V run: make -j4 && ./v symlink + + - name: Set 8.8.8.8 as dns server + run: | + sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf + sudo systemctl daemon-reload + sudo systemctl restart systemd-networkd + sudo systemctl restart systemd-resolved + dig distro.ibiblio.org + - name: Install C2V run: | v retry -- v install --git https://github.com/vlang/c2v @@ -73,6 +82,15 @@ jobs: - uses: actions/checkout@v4 - name: Build V run: make -j4 && ./v symlink + + - name: Set 8.8.8.8 as dns server + run: | + sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf + sudo systemctl daemon-reload + sudo systemctl restart systemd-networkd + sudo systemctl restart systemd-resolved + dig distro.ibiblio.org + - name: Install C2V run: | v retry -- v install --git https://github.com/vlang/c2v diff --git a/vlib/v/markused/markused.v b/vlib/v/markused/markused.v index e5deed36a0..99fb2ced41 100644 --- a/vlib/v/markused/markused.v +++ b/vlib/v/markused/markused.v @@ -42,12 +42,9 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a 'error', 'builtin_init', 'fast_string_eq', - // TODO: process the _vinit const initializations automatically too - 'main.vtest_init', - 'main.vtest_new_metainfo', - 'main.vtest_new_filemetainfo', 'println', ] + $if debug_used_features ? { dump(table.used_features) } @@ -295,7 +292,7 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a } // testing framework: if pref_.is_test { - if k.starts_with('test_') || k.contains('.test_') { + if k.starts_with('test_') || k.contains('.test_') || k.contains('.vtest_') { all_fn_root_names << k continue } @@ -400,6 +397,7 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a all_fn_root_names << 'time.unix' // used by json table.used_features.used_maps++ // json needs new_map etc } + mut walker := Walker.new( table: table files: ast_files