Commit 457567d
feat(compat.openssl): add Windows support via VC-WIN64A + nmake sourc… (#211)
* feat(compat.openssl): add Windows support via VC-WIN64A + nmake source build
The last major package still marked "windows deferred". Unblocks the
Windows leg of compat.libmysqlclient, whose mcpp.toml is already wired
for it; openssl was the only missing dependency there.
- xpm: add a windows entry reusing the shared source tarball (same sha256)
- mcpp: add windows ldflags. lld-link resolves `-lX` to `X.lib`, so the
MSVC-built static libs must be spelled `-llibssl`/`-llibcrypto`; the
static libcrypto system deps (ws2_32, crypt32, advapi32, user32) are
listed explicitly, the same way the linux leg lists -ldl/-lpthread.
- install(): route windows to _install_windows() instead of erroring out.
- _install_windows(): one generated .bat runs under a single vcvars64
invocation and does Configure VC-WIN64A no-shared no-dso no-tests
no-apps no-engine no-asm + nmake + install_sw, then verifies
libssl.lib/libcrypto.lib exist and writes the anchor TU. Helpers:
find_vcvars (vswhere, then known paths), resolve_perl_windows /
perl_usable_windows, win_dirname.
Pitfalls found on real hardware, baked into the implementation:
- the xpkg hook env on Windows has no os.rm (must be pcall'd) and no
path.dirname (hand-rolled win_dirname)
- OpenSSL Configure needs Locale::Maketext::Simple, which MSYS perl
(Git-for-Windows) lacks; the existing module probe would wrongly accept
it, so the windows check requires Strawberry Perl
- os.exec("bash -c ...") silently returns true WITHOUT running the command
in the Windows hook env, so the windows build drives
`cmd /c <bat> > <log> 2>&1` directly instead of reusing the shared run()
- vcvars (cmd /c "vcvars64.bat & set") works fine on Windows 11 + VS
2022/18; the old "takes the whole process chain down" note was a
hook-env artifact, not a property of Windows
* test(openssl): run the openssl member on Windows too
compat.openssl now builds on Windows (VC-WIN64A + nmake), so the
tests/examples/openssl member no longer has to be a no-op main() there.
Declare the dependency and HAVE_OPENSSL on all three platforms; tls.cpp
compiles its real TLS-context + SHA-256 checks on Windows as well.
Verified on Windows (llvm/clang toolchain, MSVC-built libssl.lib +
libcrypto.lib): `mcpp test -p openssl` → tls ... ok (1 passed, 0 failed).
* fix(compat.openssl): find the VS toolset through cmd /c, not bash -c
Windows CI failed `mcpp test -p openssl` at install(): find_vcvars ran
vswhere through `os.exec("bash -c …")`, which this hook's Windows
environment silently swallows (returns true, runs nothing), so vswhere's
output file was never written. The search then fell back to hardcoded
vcvars64.bat paths that only covered Community editions — and GitHub
Actions runners carry VS **Enterprise**, so the toolset was never found.
- find_vcvars: drive vswhere through a generated .bat under `cmd /c`
(the same pattern _install_windows uses), which actually executes and
is edition-agnostic; keep the hardcoded fallback but expand it to
Enterprise/BuildTools across the 2022 (17) / 18 (2026) product lines.
- perl_usable_windows: the old probe ran perl via `bash -c`, which also
no-ops — it accepted ANY perl, including the MSYS perl that lacks
Locale::Maketext::Simple and dies inside Configure. Probe perl through
a generated .bat under `cmd /c` and require it to print a marker only
when the modules load; MSYS perl on PATH now correctly fails the probe.
Verified on hardware: the generated vswhere .bat returns the install
path (and the matching vcvars64.bat), and the perl probe prints `ok` for
Strawberry (scoop) perl while MSYS perl fails it with the missing-module
error. Descriptor still parses with the pinned CI client (2026.8.10.3).
---------
Co-authored-by: FARNA-HERRY-OFF\farna <farnaherryoffical@outlook.com>1 parent 0dd1e5d commit 457567d
3 files changed
Lines changed: 241 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
110 | 120 | | |
111 | 121 | | |
112 | 122 | | |
| |||
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
150 | 167 | | |
151 | 168 | | |
152 | 169 | | |
| |||
445 | 462 | | |
446 | 463 | | |
447 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
448 | 659 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | 660 | | |
453 | | - | |
454 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
455 | 671 | | |
456 | 672 | | |
457 | 673 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | | - | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | | - | |
| 51 | + | |
50 | 52 | | |
0 commit comments