HathorNetwork / HathorNetwork/hathor-forge

refactor: deduplicate build scripts and fix fragile patterns

Open
#64 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## Problem

### PyInstaller entry scripts duplicated 3x
The same entry script and runtime hook are copy-pasted in:
- \`scripts/build-hathor-core.sh\` (lines 62-122)
- \`scripts/build-tx-mining-service.sh\` (lines 75-126)
- \`scripts/windows/build-hathor-core.ps1\` (lines 40-79)

### Target triple detection duplicated
Same \`if [[ \"\$OSTYPE\" == \"darwin\"* ]]\` block in 3 scripts.

### tx-mining-service deps hardcoded
\`scripts/build-tx-mining-service.sh:56-62\` manually lists pip dependencies instead of using the project's lock file. Will silently diverge.

### wallet-headless runs npm install twice
\`scripts/build-wallet-headless.sh:57-58\` runs \`npm install\` twice — second call re-downloads everything.

### build-explorer uses npm install instead of npm ci
Non-deterministic; can update lock file.

## Proposed Solution

- Extract shared PyInstaller template to \`scripts/lib/pyinstaller-entry.py\`
- Extract target triple detection to \`scripts/lib/detect-target.sh\`
- Use \`pip install -r requirements.txt\` or poetry export for tx-mining-service
- Fix wallet-headless to use \`npm run postinstall\` instead of second \`npm install\`
- Use \`npm ci\` in explorer build

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.