fix(windows-build): make hdwallet git-dep and zcash-cli sidecar build on Windows - #416
Open
BitHighlander wants to merge 1 commit into
Open
fix(windows-build): make hdwallet git-dep and zcash-cli sidecar build on Windows#416BitHighlander wants to merge 1 commit into
BitHighlander wants to merge 1 commit into
Conversation
… on Windows
Three issues blocked scripts/build-windows-production.ps1 on Windows (the
prior Windows build never completed, so these were never hit before):
1. hdwallet-keepkey pulls @keepkey/device-protocol as a GIT dependency, whose
`prepare` runs `mkdir -p ./lib && grpc_tools_node_protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts ...`.
That fails under cmd.exe (`mkdir -p` invalid) and even under bash, because
native protoc cannot exec the extensionless plugin wrapper ("%1 is not a
valid Win32 application"). yarn (even with --ignore-scripts) still runs the
git-dep prepare and returns non-zero, but node_modules is fully linked by
then. Tolerate only that specific prepare failure, seed the git-dep's
gitignored lib/ from the top-level device-protocol lib (same pinned commit
-> identical output), and treat `yarn build` (tsc) as the real gate.
2. The zcash-cli sidecar's build.rs (tonic-build/prost) needs a system protoc,
which Windows lacks on PATH. Resolve PROTOC: honor $env:PROTOC, else protoc
on PATH, else the protoc.exe bundled with grpc-tools in device-protocol's
node_modules.
3. Guard the protoc-on-PATH lookup against Set-StrictMode null-property access.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three fixes to
scripts/build-windows-production.ps1that were required to complete a Windows production build (surfaced while cutting the signed v1.5.3 installer — the prior Windows build never got this far, so these had never been hit).hdwallet device-protocol git-dep prepare —
hdwallet-keepkeypulls@keepkey/device-protocolas a git dependency, whosepreparerunsmkdir -p ./lib && grpc_tools_node_protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts .... That fails under cmd.exe (mkdir -pis invalid) and even under bash (nativeprotoccan't exec the extensionless plugin wrapper →%1 is not a valid Win32 application). yarn runs the git-dep prepare even with--ignore-scriptsand returns non-zero, butnode_modulesis fully linked by then. We now tolerate only that specific prepare failure, seed the git-dep's gitignoredlib/from the top-levelmodules/device-protocollib (same pinned commit → identical output), and gate onyarn build(tsc).zcash-cli sidecar needs
protoc— itsbuild.rs(tonic-build/prost) needs a systemprotoc, absent from PATH on Windows. ResolvePROTOC: honor$env:PROTOC, elseprotocon PATH, else theprotoc.exebundled with grpc-tools in device-protocol'snode_modules.StrictMode null guard — the protoc-on-PATH lookup dereferenced
.Sourceon a possibly-nullGet-Commandresult, which throws underSet-StrictMode -Version Latest.Testing
Used to produce and EV-sign the v1.5.3 Windows installer end-to-end (18/18 binaries signed, installer Authenticode Valid,
version.json= 1.5.3). hdwalletyarn build(tsc) and the zcash-clicargo build --releaseboth verified green with these changes.Notes
🤖 Generated with Claude Code