{"id":15785794,"url":"https://github.com/fenollp/supergreen","last_synced_at":"2025-04-30T07:28:28.943Z","repository":{"id":202752065,"uuid":"661267868","full_name":"fenollp/supergreen","owner":"fenollp","description":"`RUSTC_WRAPPER` that uses `docker buildx build`","archived":false,"fork":false,"pushed_at":"2024-10-01T16:35:50.000Z","size":643,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-05T20:41:35.911Z","etag":null,"topics":["bake","buildkit","buildx","docker","hacktoberfest","rustc"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/fenollp.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}},"created_at":"2023-07-02T10:11:21.000Z","updated_at":"2024-09-24T20:12:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"d94a17eb-8e2c-459d-b3bc-85ef7da604c4","html_url":"https://github.com/fenollp/supergreen","commit_stats":null,"previous_names":["fenollp/rustcbuildx","fenollp/supergreen"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenollp%2Fsupergreen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenollp%2Fsupergreen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenollp%2Fsupergreen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenollp%2Fsupergreen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fenollp","download_url":"https://codeload.github.com/fenollp/supergreen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246326601,"owners_count":20759436,"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":["bake","buildkit","buildx","docker","hacktoberfest","rustc"],"created_at":"2024-10-04T20:41:31.405Z","updated_at":"2025-03-31T13:31:13.330Z","avatar_url":"https://github.com/fenollp.png","language":"Rust","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# [`supergreen`](https://github.com/fenollp/supergreen)\n\nFaster Rust builds!\n\n* [`cargo-green`](./cargo-green): Cargo plugin and `$RUSTC_WRAPPER` to sandbox, cache \u0026 remote exec `cargo` builds\n\n![A rusty crab character named Ferris, featuring a unique hairstyle resembling 'Ruby Road', a vibrant and textured hairdo often seen in flamboyant red](./hack/logo.jpg)\n\n## Goals\n* [x] seamlessly build on another machine (with more cores, more cache)\n  * [x] support remote builds by setting env `DOCKER_HOST=` with e.g. `ssh://me@beaffy-machine.internal.net`\n    * [x] Build cache is saved remotely, artifacts are saved locally\n    * [x] Tests building happens on remote machine, execution happens on local machine\n* [x] seamlessly integrate with normal `cargo` usage\n  * [x] only pull sources from local filesystem\n  * [x] produce the same intermediary artefacts as local `cargo` does\n  * [x] fallback to normal, local `rustc` anytime\n    * switching from this wrapper back to local `rustc` does necessitate a fresh build\n* [ ] wrap `rustc` calls in `buildkit`-like calls (`docker`, `podman`)\n  * [x] `docker`\n  * [x] `podman`\n  * [ ] deps compatibility\n    * [x] handle Rust-only deps\n    * [ ] handle all the other deps (expand this list) (use `crater`)\n      * [x] `C` deps\n      * [ ] ...\n  * [x] runner compatibility\n    * [x] set `.dockerignore`s (to be authoritative on srcs)\n  * [x] trace these outputs (STDOUT/STDERR) for debugging\n* [x] available as a `rustc` wrapper through `$RUSTC_WRAPPER`\n* [ ] available as a `cargo` subcommand\n  * [ ] configuration profiles (user, team, per-workspace, per-crate, CI, ...)\n  * [x] seamlessly use current/local `rustc` version\n    * [x] support overriding `rustc` base image\n  * [ ] seamlessly use current/local tools (`mold`, ...)\n    * [ ] config expressions on top of base image config?\n    * [ ] just suggest an inline `Dockerfile` stage?\n  * [ ] support CRUD-ish operations on local/remotes cache\n  * [x] `[SEC]` support building a crate without it having network access\n* [ ] integrate with shipping OCI images\n* [ ] share cache with the World cf. [`user-wide-cache`](https://rust-lang.github.io/rust-project-goals/2024h2/user-wide-cache.html)\n  * [x] never rebuild a dep (for a given version of `rustc`, ...)\n  * [ ] share cache with other projects on local machine\n    * [ ] fix `WORKDIR`s + rewrite paths with `remap-path-prefix` \n  * [ ] share cache with CI and team\n    * [ ] share cache with CI (at least for a single user)\n  * [ ] `[SEC]` ensure private deps don't leak through/to cache\n  * [ ] CLI gives the Dockerfile that `cargo install`'s any crate\n* [ ] suggest a global cache -faciliting configuration profile\n* [ ] integrate with `cross`\n  * [ ] build for a non-local target\n\n\n## Upstream issues \u0026 patches\n* [ ] [`rust`: Compile a crate from its source archive directly](https://github.com/rust-lang/rust/issues/128884)\n* [ ] [`cargo`: Tell `rustc` wrappers which envs to pass through to allow env sandboxing](https://github.com/rust-lang/cargo/issues/14444)\n* TODO\n  1. buildkit flags to prefix stdout and stderr progress\n  1. buildkit flag to disable dockerignore and save disk read\n    * --ignore-file (closed) https://github.com/moby/moby/issues/12886\n    * --no-ignore-file\n  1. docker build support multiple input files\n    * --file-part\n    * \u003e=1 stage per Dockerfile part file\n      * order doesn't matter: order is fixed when consolidation happens (internally)\n  1. cargo + docker\n    * https://github.com/rust-lang/cargo/issues/2644#issuecomment-2304774192\n\n\n## Origins\n* PoC originally written in Bash: https://github.com/fenollp/buildxargs/blob/buildx/tryin.sh\n* Initial blog post https://fenollp.github.io/faster-rust-builds-docker_host\n\n\n## Hacking\nSee `./hack/`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenollp%2Fsupergreen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffenollp%2Fsupergreen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenollp%2Fsupergreen/lists"}