{"id":15373091,"url":"https://github.com/vi/xargo-musl","last_synced_at":"2026-04-18T15:32:39.849Z","repository":{"id":137140283,"uuid":"174899883","full_name":"vi/xargo-musl","owner":"vi","description":"Docker image to build for musl targets with Xargo","archived":false,"fork":false,"pushed_at":"2019-03-11T01:07:40.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T21:49:38.718Z","etag":null,"topics":["arm","docker","docker-image","musl","rust","x86-64","xargo"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/vi0oss/xargo-musl","language":"Dockerfile","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/vi.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}},"created_at":"2019-03-11T00:46:18.000Z","updated_at":"2020-05-10T21:44:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"766d862b-b667-44e1-9841-26f9e85d42ad","html_url":"https://github.com/vi/xargo-musl","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"eacd11f3a08f0f74c037913767078f3b6a7ed7b0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vi/xargo-musl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fxargo-musl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fxargo-musl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fxargo-musl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fxargo-musl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vi","download_url":"https://codeload.github.com/vi/xargo-musl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fxargo-musl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31974324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["arm","docker","docker-image","musl","rust","x86-64","xargo"],"created_at":"2024-10-01T13:54:16.544Z","updated_at":"2026-04-18T15:32:39.808Z","avatar_url":"https://github.com/vi.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"This Docker script creates environment for building small static Linux musl executables for x86_64 and ARM \nfrom Rust with Xargo.\n\n# Project configuration\n\n`panic=abort` and `lto=1` is a requirement.\n\nDocker image contains pre-built toolchains for projects of approximately this layout:\n\n`Cargo.toml` contains\n\n```toml\n[profile.release]\npanic=\"abort\"\nlto=true\nopt-level=\"s\"\ncodegen-units=1\n```\n\n`Xargo.toml` contains\n\n```toml\n[dependencies]\nstd = {}\n```\n\nCompilation with those should be faster.\n\n\n# Usage\n\nSupposing you have a Rust project without system dependencies, you add a release profile and `Xargo.toml` listed above.\n\nThen you run\n\n    docker run --rm -it -w /wd -v $PWD:/wd vi0oss/xargo-musl xargo build --release --target=x86_64-unknown-linux-musl\n\nand see something like\n\n```\n   Compiling helloworld v0.1.0 (/wd)\n    Finished release [optimized] target(s) in 2.30s\n```\n\nYour unstripped executable is ready at `target/x86_64-unknown-linux-gnu/release`.\n\nTargets to use:\n\n* `x86_64-unknown-linux-musl`\n* `arm-unknown-linux-musleabi`\n* `arm-unknown-linux-musleabihf`\n* `mips-unknown-linux-musl` (non-static)\n* `mipsel-unknown-linux-musl` (non-static)\n\n# Building the image\n\nBuilding depends on the following external resources:\n\n* `rustlang/rust:nightly` base image, which contains `rustc 1.35.0-nightly (26b4cb484 2019-03-09)` at the moment of writing;\n* `github.com/rob-ward/rob-ward-toolchains` repository and Github allowing to download tar.gz\n\n`docker build -t vi0oss/xargo-musl .` should work and produce output similar to [this sample output](LOG).\n\n```\n68K arm\n68K armhf\n68K mips\n68K mipsel\n64K x86_64\n\nx86_64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=d2392e42038410a4f381d229b23da97198ee0209, stripped\narm:    ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped\narmhf:  ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped\nmips:   ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-mips.so.1, stripped\nmipsel: ELF 32-bit LSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-mipsel.so.1, stripped\n```\n\nUnfortunately mips executables are not static.\n\n\n# Hacks \n\nThe following hacks are applied during the build:\n\n* Usage of pre-built downloaded musl toolchains\n* Manually specifying `-L native=` to make it find `libc.a`\n* Creating dummy `libunwind.a` just to avoid it stopping compilation\n\n# See also\n\n* https://github.com/messense/rust-musl-cross\n* https://github.com/johnthagen/min-sized-rust\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fxargo-musl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvi%2Fxargo-musl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fxargo-musl/lists"}