riscv-forks / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
2 stars 3 forks source link

[HELP]在构建riscv64的软件包时出现了报错 #2

Closed lily-Robot closed 4 weeks ago

lily-Robot commented 4 weeks ago

您好,我最近想通过您维护的 riscv-forks/electron-builder 来尝试实现一些 electron 项目的 riscv 架构支持,但我目前遇到了一些无法解决的报错,以下是我的操作步骤,如有错误的地方,希望您能指正;

        "linux": {
            "target": [
                {
                    "target": "AppImage",
                    "arch": [
                        "x64",
                        "arm64"
                    ]
                },
                {
                    "target": "deb",
                    "arch": [
                        "x64",
                        "arm64",
                        "riscv64"
                    ]
                },
                {
                    "target": "rpm",
                    "arch": [
                        "x64",
                        "arm64",
                        "riscv64"
                    ]
                }
            ],
            "icon": "./src/assets/icons/png",
            "category": "Office"
        }

但我一使用 npx electron-builder ,就报错了,报错如下

  ⨯ Invalid configuration object. electron-builder 25.0.5 has been initialized using a configuration object that does not match the API schema.
 - configuration.linux.target[2].arch[2] should be one of these:
   "arm64" | "armv7l" | "ia32" | "universal" | "x64"
     How to fix:
     1. Open https://www.electron.build/configuration/linux
     2. Search the option name on the page (or type in into Search to find across the docs).
       * Not found? The option was deprecated or not exists (check spelling).
       * Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root

我比较想弄明白,是否是需要使用其他的参数,或者是我在打包时要手动提供一些额外的文件。

kxxt commented 4 weeks ago

但我一使用 npx electron-builder ⨯ Invalid configuration object. electron-builder 25.0.5 has been initialized using

You are still using upstream electron-builder. This fork only published 24.10.0 and 24.13.3. And you should use 24.13.3 because the published 24.10.0 lacks some changes.

As the README says, you should override the dependency resolution of three packages instead of installing @riscv-forks/electron-builder manually. https://github.com/riscv-forks/electron-builder?tab=readme-ov-file#usage

我比较想弄明白,是否是需要使用其他的参数,或者是我在打包时要手动提供一些额外的文件。

You need to manually override electron binary url to this repo(https://github.com/riscv-forks/electron-riscv-releases) or download an electron riscv64 binary from that repo and manually specify the electron dist zip to use.

lily-Robot commented 4 weeks ago

I see . I'll practice what you said later .

lily-Robot commented 4 weeks ago

First of all, thank you very much, if I am successful, can I put this method in my blog, With this issues and this warehouse? Chinese-English bilingual

Happy coding!

kxxt commented 4 weeks ago

if I am successful, can I put this method in my blog, With this issues and this warehouse?

Sure.

And FYI this is what Arch Linux RISC-V do when packaging bitwarden: https://github.com/felixonmars/archriscv-packages/blob/604e0e6f864d54f65e8654f2e09752540e360697/bitwarden/riscv64.patch#L44-L50

lily-Robot commented 4 weeks ago

This is really helpful, but I am still in class, so I should be Able to get results in the evening.

lily-Robot commented 4 weeks ago

Thank you very much. Following your method, I have successfully compiled it. Tomorrow, I will implement and test it on the RISC-V platform, although it seems that AppImage packaging is not yet supported.