Skip to content

refactor: deduplicate build scripts and fix fragile patterns #64

Description

@andreabadesso

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions