You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
cmd/v: export the build facts and defines to the test runner again (#28801)
`v test <dir>` evaluates every `// vtest build:` expression through
`cmd/tools/testing`, which reads its facts from the `VBUILD_FACTS` and
`VBUILD_DEFINES` environment variables. Nothing has set them since
2a7447b removed the launcher's `setup_vbuild_env_vars`, so the runner
saw an empty fact set: `amd64`, `windows`, `tinyc`, `gcc` were all false
and `!windows`, `!tinyc` always true, on every host (`v test vlib/context`
skipped its four `amd64 || arm64` tests). The compiler's own evaluation
for `v file_test.v` (`v3_test_build_facts`) was unaffected, so the two
disagreed.
Factor the C compiler selection and the libc define out of `driver.run`
into `v3_select_c_compiler` / `v3_apply_libc_define`, build the facts and
defines of a set of compiler options on top of them in
`driver.vtest_build_environment`, and have the launcher export the result
with `pref.set_build_flags_and_defines` before it starts a tool that runs
a test session (`test`, `test-self`, `test-cleancode`, `test-fmt`,
`build-examples`, `build-tools`, `build-vbinaries`).
`cmd/tools/vtest_build_facts_test.v` runs `v test` on fixtures constrained
by the host OS and arch, their negations and an optional define, and
checks which ones executed; it fails on the previous launcher.
`vlib/v/driver/vtest_build_environment_test.v` pins the resolver.
Fixes#28798
Co-authored-by: Richard Wheeler <18647491+PythonWillRule@users.noreply.github.com>
Co-authored-by: WOZCODE <contact@withwoz.com>
0 commit comments