{"id":21816442,"url":"https://github.com/darkyzhou/electron-loong64","last_synced_at":"2025-10-08T02:31:57.109Z","repository":{"id":264102660,"uuid":"886729420","full_name":"darkyzhou/electron-loong64","owner":"darkyzhou","description":"Electron ports for LoongArch","archived":false,"fork":false,"pushed_at":"2025-09-02T11:14:45.000Z","size":185,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-09-02T13:20:09.066Z","etag":null,"topics":["electron","javascript","loong64","loongarch","loongarch64","loongson"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darkyzhou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-11T13:55:05.000Z","updated_at":"2025-09-02T11:14:48.000Z","dependencies_parsed_at":"2024-12-06T16:24:42.559Z","dependency_job_id":"7fdfd030-25fe-49b2-bd4f-a01afb21ee27","html_url":"https://github.com/darkyzhou/electron-loong64","commit_stats":null,"previous_names":["darkyzhou/electron-loong64"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/darkyzhou/electron-loong64","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkyzhou%2Felectron-loong64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkyzhou%2Felectron-loong64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkyzhou%2Felectron-loong64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkyzhou%2Felectron-loong64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkyzhou","download_url":"https://codeload.github.com/darkyzhou/electron-loong64/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkyzhou%2Felectron-loong64/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278877672,"owners_count":26061491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electron","javascript","loong64","loongarch","loongarch64","loongson"],"created_at":"2024-11-27T15:34:28.239Z","updated_at":"2025-10-08T02:31:57.103Z","avatar_url":"https://github.com/darkyzhou.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Electron for LoongArch (Loong64)\n\nThis project aims to build a version of Electron that supports the Loong64 architecture.\n\n**Note:** The Electron binaries require `glibc \u003e= 2.38`.\n\n## Usage\n\n1. Check [releases](https://github.com/darkyzhou/electron-loong64/releases) for available versions.\n2. Install the `electron` npm package with corresponding version and specify the download mirror like this:\n\n```\nELECTRON_MIRROR=\"https://github.com/darkyzhou/electron-loong64/releases/download/\" electron_use_remote_checksums=1 npm install electron@THE_VERSION\n```\n\nYou may also refer to [darkyzhou/electron-builder-loong64](https://github.com/darkyzhou/electron-builder-loong64) for insturctions on how to build your Electron project with [electron-builder](https://github.com/electron-userland/electron-builder).\n\n## Branches\n\n- `dev`: The development branch, containing the latest patches and build scripts.\n- `X.Y.Z`: The release branches, corresponding to the release versions of Electron.\n\n## Acknowledgments\n\nSpecial thanks to [@jiegec](https://github.com/jiegec) and AOSC team for their invaluable Chromium patches in [AOSC-Dev/chromium-loongarch64](https://github.com/AOSC-Dev/chromium-loongarch64), which make this project possible.\n\n## How This Project Works\n\n1. This project builds upon the official Electron repository by applying custom patches. See `electron.patch` for details.\n2. The build process runs in a dedicated container environment that includes all necessary build tools and dependencies. See `Dockerfile.builder` for details.\n\n## Development\n\n### Environment Requirements\n\n- Linux host machine with Loong64 architecture\n- Docker with [docker-buildx](https://github.com/docker/buildx) installed\n- [LATX](https://github.com/deuso/latx-build) version 1.4.4 (required for running `ghcr.io/darkyzhou/electron-buildtools` image)\n- System resources: minimum 32GiB RAM and 200GiB free disk space\n\n### Building from Source\n\n1. Launch a `ghcr.io/darkyzhou/electron-buildtools` container. All subsequent steps should be executed inside this container.\n2. Change the variables inside `./scripts/env.sh` according to your environment and needs.\n3. Run following scripts in sequence.\n\n```bash\n# Clone or update the local electron repository\n./scripts/update.sh\n\n# Apply patches from electron-loong64\n./scripts/patch.sh\n\n# Fetch or update the dependencies of electron\n# Note: This could take a really long time, grab your coffee or take a sleep!\n./scripts/sync.sh\n```\n\n4. Launch a `ghcr.io/darkyzhou/electron-builder:deepin-25-llvm-20-rustc-188` container. All subsequent steps should be executed inside this container.\n5. Run following scripts in sequence.\n\n```bash\n# Replace binaries with native ones\n./scripts/binaries.sh\n./scripts/rollup.sh\n\n# Build the electron\n# Note: This could also take a long time, better get some sleep.\n./scripts/build.sh\n\n# Package the electron\n./scripts/package.sh\n```\n\n### Updating Patches\n\n1. Launch a `ghcr.io/darkyzhou/electron-buildtools` container. All subsequent steps should be executed inside this container.\n\n2. Update versions and sync sources:\n   - Edit `ELECTRON_VERSION` to point to the new version to build in `env.sh`.\n   - Run `scripts/update.sh`.\n\n3. Update dependencies:\n   - Run `scripts/sync.sh`. This will apply all original patches from the Electron repository.\n\n4. Apply Chromium patches:\n   - Apply the consolidated Chromium patch file (e.g., `chromium-131.0.6778.85.diff`) to `$BUILD_ROOT/src`.\n   - Resolve any conflicts if any.\n\n5. Export Chromium patches using `npx e patches` command:\n   \u003e Note: `$BUILD_ROOT/src` is a git repository containing submodules, including `$BUILD_ROOT/src/electron` and *a few folders* in `$BUILD_ROOT/src/third_party`.\n\n   1. Run `scripts/export.sh` to commit changes for both chromium and submodule changes.\n   2. Run `npx e patches $NAME` to export patches for submodule commits.\n   3. Export changes in `$BUILD_ROOT/src/electron` to `patches/`.\n\n6. Apply Electron patches from `patches/electron.patch`.\n\n7. Run `scripts/sync.sh` again to sync the sources and apply all patches.\n\n### Troubleshooting\n\nCommon compilation errors:\n\n- `relocation R_LARCH_B26 out of range: 172745664 is not in [-134217728, 134217727]`\n   - Root cause: The library was compiled *without* the `-mcmodel=medium` flag. For more details, see [laelf.adoc](https://github.com/loongson/la-abi-specs/blob/release/laelf.adoc#code_models).\n   - Resolution: Recompile the library with the `-mcmodel=medium` flag. See `Dockerfile.libffi` for implementation examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkyzhou%2Felectron-loong64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkyzhou%2Felectron-loong64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkyzhou%2Felectron-loong64/lists"}