Skip to content

Conversation

@AkarinServer
Copy link
Contributor

⚠️ IMPORTANT / 注意事项

  • DO NOT MERGE INTO MAIN YET / 暂勿合并至主分支: This feature is currently experimental and specifically tailored for RISC-V boards (e.g., Spacemit K1). It introduces packaging scripts that might need further refinement before being part of the standard release pipeline.
  • Testing Required: Please verify on x64/arm64 to ensure no regression in standard build flows, although the changes are mostly isolated in new scripts.

Description

This PR introduces comprehensive support for building and packaging Netcatty for RISC-V architecture.

Key Changes

  • New Packaging Script (scripts/pack-riscv.sh):

    • A unified script that handles frontend building, resource assembly, and .deb package generation.
    • Supports generating dual packages:
      • netcatty_*.deb: Standard build (with --no-sandbox).
      • netcatty-debug_*.deb: Debug build (with --disable-gpu --no-sandbox) for boards with GPU driver issues.
    • No app.asar: Deliberately packages the app as a plain directory structure to avoid compatibility issues on certain RISC-V environments.
    • Automatically prunes node_modules to remove dev dependencies.
  • Config Helper (scripts/get-config.cjs):

    • Ensures packaging metadata (Version, Product Name, etc.) is consistent with package.json and electron-builder.json.
  • Documentation (RISCV_README.md):

    • Added detailed instructions for downloading dependencies (Node.js, Electron RISC-V) and running the build process.

Motivation

RISC-V support for Electron apps is still maturing. This PR provides a "manual but automated" way to build Netcatty for these devices without relying on electron-builder's missing RISC-V support.

How to Test (on RISC-V Board)

  1. Clone this branch.
  2. Ensure npm and electron (v39.x riscv64) are available.
  3. Run:
    ./scripts/pack-riscv.sh
  4. Install the generated .deb package.

This commit introduces comprehensive support for packaging Netcatty for RISC-V architecture.

Changes:
- Added 'scripts/pack-riscv.sh': A unified script for building, assembling, and packaging the application into .deb files for RISC-V. It supports standard and debug builds (with --disable-gpu).
- Added 'scripts/get-config.cjs': A helper script to read configuration from package.json and electron-builder.json, ensuring consistency across builds.
- Added 'RISCV_README.md': Documentation for building and running Netcatty on RISC-V devices.
- Updated 'package.json': Added 'pack:riscv' script.
- Removed obsolete scripts ('scripts/mkdeb-riscv.sh', 'scripts/monitor-pack.sh').

The new packaging flow avoids app.asar for better compatibility on some RISC-V boards and provides a clean separation between build assembly and package generation.
@AkarinServer
Copy link
Contributor Author

该分支可以作为独立分支单独存在,并且自动触发main code copy。问题是,GitHub actions是没有RV编译的,或者说也不是没有,就是用simulator编译非常慢,很耗token。所以无法被编入CI。只能是谁需要就自己下载下来编译了。以及我的fork中有RV release,需要的可以自取。

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