{"id":26282027,"url":"https://github.com/chainreactors/cross-rust","last_synced_at":"2025-05-07T07:34:02.088Z","repository":{"id":257115946,"uuid":"857290912","full_name":"chainreactors/cross-rust","owner":"chainreactors","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-23T08:05:29.000Z","size":64072,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T08:27:08.481Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chainreactors.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-09-14T09:01:50.000Z","updated_at":"2025-04-23T08:05:32.000Z","dependencies_parsed_at":"2024-09-18T16:00:03.419Z","dependency_job_id":"4eea23ad-715a-4922-9903-95c1431bb1bf","html_url":"https://github.com/chainreactors/cross-rust","commit_stats":null,"previous_names":["h3zh1/cross-rust","chainreactors/cross-rust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainreactors%2Fcross-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainreactors%2Fcross-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainreactors%2Fcross-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainreactors%2Fcross-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chainreactors","download_url":"https://codeload.github.com/chainreactors/cross-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252834012,"owners_count":21811295,"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","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":[],"created_at":"2025-03-14T16:19:19.744Z","updated_at":"2025-05-07T07:34:02.062Z","avatar_url":"https://github.com/chainreactors.png","language":"Shell","readme":"# cross-rust\n此项目主要用于维护[malefic](https://github.com/chainreactors/malefic/)的编译。\n\n项目使用了[cross](https://github.com/cross-rs/cross)的Dockerfile和script。\n考虑到编译环境足够干净的问题，重构了cross的结构，并因为一些限制放弃了`cargo build-docker-image`和`cross`等，修复了一些其他问题。\n\n## Usage\n### 准备操作\n1. 安装了docker环境可参考[官网介绍](https://www.docker.com/)\n2. 切换到项目路径\n    ```\n    # switch to the root dir of your rs project\n    cd /path/to/project_/\n    ```\n\n### 单行编译\n根据对应target，选择对应镜像来进行编译，此处以build`x86_64-pc-windows-msvc`简单举例。\n```\ndocker run -v \"$PWD/:/root/src\" --rm -it --name cross-builder ghcr.io/chainreactors/x86_64-pc-windows-msvc:nightly-2024-08-16 cargo build --release --target x86_64-pc-windows-msvc\n```\n\n### 交互式编译\n```\ndocker run -v \"$PWD/:/root/src\" --rm -it --name cross-builder ghcr.io/chainreactors/x86_64-pc-windows-msvc:nightly-2024-08-16 bash\ncargo build --release --target x86_64-pc-windows-msvc\n```\n### 注意\n1. 如果你想重复使用你的容器请不要使用--rm\n2. 所有的可用架构你可以在[package](https://github.com/orgs/chainreactors/packages?repo_name=cross-rust)中找到\n3. 欢迎补充新的架构，有其他问题请题issue\n\n## 其他\n如果你想FORK此项目，自行构建镜像可参考\".github/workflows/build.yml\"，自行配置对应的secrets。\n\n### Github Action构建\n```\ngh auth login\n```\n所有架构\n```\ngh workflow run build.yml -R your_username/cross-rust -f  targets=\"all\" -f tool_chain_version=\"nightly-2024-08-16\"\n```\n选择性build\n```\ngh workflow run build.yml -R your_username/cross-rust -f  targets=\"x86_64-pc-windows-msvc,i686-pc-windows-msvc\" -f tool_chain_version=\"nightly-2024-08-16\"\n\n```\n### 本地构建\n具体目录参考项目代码和github action的build.yaml\n```\ndocker build -t image_name:tag -f Dockerfiles/*/Dockerfile.* .\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainreactors%2Fcross-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainreactors%2Fcross-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainreactors%2Fcross-rust/lists"}