Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: Use vcpkg for openssl dep #73

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

joncinque
Copy link

@joncinque joncinque commented Mar 4, 2024

Problem

The windows build of solana-test-validator.exe does not currently work on a fresh windows machine. Users get two errors:

The code execution cannot proceed because libssl-3-x64.dll was not found. Reinstalling the program may fix the problem.

And also for libcrypto-3-x64.dll. This is happening because these libraries are linked dynamically into the executable, but machines don't have them unless they are installed with choco, just like during the CI build.

Summary of Changes

Rather than picking up the dynamic libs with choco, use vcpkg to fetch the static versions of the libraries, and link them directly into the executable.

I triggered the run on my own branch, and you'll see when running ldd solana-test-validator (at the end of the run) that libcrypto-3 and libssl-3 are not linked dynamically anymore: https://github.com/joncinque/solana/actions/runs/8147872620/job/22269501499

	ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ffc32010000)
	KERNEL32.DLL => /c/Windows/System32/KERNEL32.DLL (0x7ffc315c0000)
	KERNELBASE.dll => /c/Windows/System32/KERNELBASE.dll (0x7ffc2f6a0000)
	apphelp.dll => /c/Windows/SYSTEM32/apphelp.dll (0x7ffc2d6a0000)
	USER32.dll => /c/Windows/System32/USER32.dll (0x7ffc30790000)
	POWRPROF.dll => /c/Windows/SYSTEM32/POWRPROF.dll (0x7ffc2f470000)
	win32u.dll => /c/Windows/System32/win32u.dll (0x7ffc2fa10000)
	ucrtbase.dll => /c/Windows/System32/ucrtbase.dll (0x7ffc2f590000)
	GDI32.dll => /c/Windows/System32/GDI32.dll (0x7ffc31680000)
	gdi32full.dll => /c/Windows/System32/gdi32full.dll (0x7ffc2fb50000)
	RPCRT4.dll => /c/Windows/System32/RPCRT4.dll (0x7ffc31ad0000)
	msvcp_win.dll => /c/Windows/System32/msvcp_win.dll (0x7ffc2fa40000)
	CRYPT32.dll => /c/Windows/System32/CRYPT32.dll (0x7ffc2fc70000)
	SHLWAPI.dll => /c/Windows/System32/SHLWAPI.dll (0x7ffc30730000)
	msvcrt.dll => /c/Windows/System32/msvcrt.dll (0x7ffc31360000)
	ws2_32.dll => /c/Windows/System32/ws2_32.dll (0x7ffc30ac0000)
	shell32.dll => /c/Windows/System32/shell32.dll (0x7ffc30c00000)
	ole32.dll => /c/Windows/System32/ole32.dll (0x7ffc31d60000)
	combase.dll => /c/Windows/System32/combase.dll (0x7ffc2ff40000)
	advapi32.dll => /c/Windows/System32/advapi32.dll (0x7ffc30b40000)
	secur32.dll => /c/Windows/SYSTEM32/secur32.dll (0x7ffc22a90000)
	sechost.dll => /c/Windows/System32/sechost.dll (0x7ffc31740000)
	bcrypt.dll => /c/Windows/System32/bcrypt.dll (0x7ffc2fe50000)
	VCRUNTIME140.dll => /c/Windows/SYSTEM32/VCRUNTIME140.dll (0x7ffc22ca0000)
	MSVCP140.dll => /c/Windows/SYSTEM32/MSVCP140.dll (0x7ffc22cc0000)
	VCRUNTIME140_1.dll => /c/Windows/SYSTEM32/VCRUNTIME140_1.dll (0x7ffc22c90000)
	SSPICLI.DLL => /c/Windows/SYSTEM32/SSPICLI.DLL (0x7ffc2ef50000)
	CRYPTBASE.DLL => /c/Windows/SYSTEM32/CRYPTBASE.DLL (0x7ffc2ed10000)

Fixes #34793 Fixes #32372

Copy link

mergify bot commented Mar 5, 2024

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

Copy link
Member

@yihau yihau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪖

@joncinque joncinque merged commit b78c070 into anza-xyz:master Mar 5, 2024
16 checks passed
@joncinque joncinque deleted the winbuildstatic branch March 5, 2024 11:28
mergify bot pushed a commit that referenced this pull request Mar 5, 2024
yihau pushed a commit that referenced this pull request Mar 5, 2024
windows: Use vcpkg for openssl dep (#73)

(cherry picked from commit b78c070)

Co-authored-by: Jon C <me@jonc.dev>
anwayde pushed a commit to firedancer-io/agave that referenced this pull request Jul 23, 2024
…nza-xyz#86)

windows: Use vcpkg for openssl dep (anza-xyz#73)

(cherry picked from commit b78c070)

Co-authored-by: Jon C <me@jonc.dev>
codebender828 pushed a commit to codebender828/agave that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work in Windows: CLI app: solana-test-validator Libcrypto-1_1-x64.dll was not found.
2 participants