Commit f7fadf0
committed
fix(openssl/windows): capture the VS environment instead of calling vcvars
Running vcvars in a child cmd did not help — the log gained '[bat] handing
build to child cmd' and vcvars' own success banner, and then stopped again with
no RESULT from the OUTER script either. Whatever vcvars does on exit here, it
is not something a caller can survive, in this process or a child of it.
So it is no longer called. It now runs in a cmd whose only job is to dump the
environment it produced, and those variables are imported into the build script:
cmd /c ""%MCPP_VCVARS%" & set" > vsenv.txt
for /f "tokens=1* delims==" %%a in (vsenv.txt) do set "%%a=%%b"
This is the standard way build systems capture a Visual Studio environment, and
it removes the dependency on vcvars returning to anybody. `&` is deliberate
rather than `&&`: `set` has to run whatever exit status vcvars leaves behind.
The dump also becomes evidence in its own right — if the toolset is not really
there, the file is missing or short, and that is now a named failure (13) rather
than a silent stop.1 parent bcbeb9c commit f7fadf0
1 file changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
479 | 481 | | |
480 | 482 | | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
485 | 494 | | |
486 | 495 | | |
487 | 496 | | |
| |||
0 commit comments