Skip to content

fix(build): use Huawei registry for packaged OpenClaw resources - #374

Merged
Angnuo (angnuoli) merged 1 commit into
mainfrom
angnuoli-microsoft-build-resource-registry
Nov 12, 2026
Merged

Angnuo (angnuoli) merged 1 commit into
mainfrom
angnuoli-microsoft-build-resource-registry

Conversation

@angnuoli

Copy link
Copy Markdown
Collaborator

Description

Fix packaged OpenClaw resource preparation in build.ps1 when a machine-wide npm proxy lacks the pinned release and returns ETARGET. Default this resource acquisition to the Huawei npm registry without changing ordinary dependency installation or the pinned OpenClaw target.

Related Issue

N/A — reported build failure; no linked issue.

Changes

  • Apply MICROCLAW_NPM_REGISTRY > MSIX_NPM_REGISTRY > https://repo.huaweicloud.com/repository/npm/ only around Step 1's existing prepare-packaged-resources call.
  • Preserve caller overrides and restore the original process environment and working directory on success, nonzero exit, or exception. Do not change ordinary npm registry settings, .npmrc, or user/global configuration.
  • Log only the selected registry origin, excluding credentials, path, and query; reject invalid registry URLs explicitly. No silent source fallback, version downgrade, or relaxed version/engine/resource checks.
  • Add focused subprocess regressions for a Microsoft-proxy ordinary registry, both resource overrides, environment restoration, safe diagnostics, explicit failures, and cache bypass; update English and Chinese build documentation.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • CI/CD or build configuration change
  • Refactoring (no functional changes)

Testing

  • Tests pass locally (cd desktop && npm run test)
  • Renderer tests pass locally (cd desktop/renderer && npm run test)
  • Build succeeds (cd desktop && npm run build)
  • Manual testing performed (describe below)

Focused checks passed on the submitted content; the full-suite/build items above were not run:

  • python -m unittest discover -s tests -p test_build_resource_registry.py -v — before the fix, 5 expected failing assertions reproduced missing registry propagation/diagnostics; after the fix, all 5 tests passed.
  • python -m unittest discover -s tests -p 'test_build*.py' -v — passed, 51 tests, including build-script PowerShell parsing.
  • npm --prefix .\desktop run test:prepared-resources — passed, 19 tests, including exact target, engine policy, resource integrity, and publication checks.
  • python -c "import shutil, sys, unittest; sys.path.insert(0, 'tests'); import test_build_resource_registry as checks; checks.POWERSHELL = shutil.which('powershell'); unittest.main(module=checks, verbosity=2)" — passed, 5 tests on Windows PowerShell 5.1; the normal build test run uses PowerShell 7.
  • python -m ruff check .\tests\test_build_resource_registry.py — passed with session-isolated Ruff 0.16.3.
  • python -m ruff format --check .\tests\test_build_resource_registry.py — passed with session-isolated Ruff 0.16.3.
  • git diff --check and git diff --cached --check — passed.

The new harness executes the actual dependency/resource stage snippets with a real child-process environment probe instead of downloading or packaging OpenClaw. Real OpenClaw acquisition and the complete native/installer packaging pipeline were not run locally; this PR does not claim end-to-end build success. No manual full-build test was performed.

Checklist

  • My code follows the coding guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code where necessary
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@angnuoli
Angnuo (angnuoli) merged commit ea9c5bc into main Nov 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant