cargo-zigbuild


Namecargo-zigbuild JSON
Version 0.12.3 PyPI version JSON
download
home_pageNone
SummaryCompile Cargo project with zig as linker
upload_time2022-09-15 04:55:30
maintainerNone
docs_urlNone
authorNone
requires_python
licenseMIT
keywords zig cargo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cargo-zigbuild

[![CI](https://github.com/messense/cargo-zigbuild/workflows/CI/badge.svg)](https://github.com/messense/cargo-zigbuild/actions?query=workflow%3ACI)
[![Crates.io](https://img.shields.io/crates/v/cargo-zigbuild.svg)](https://crates.io/crates/cargo-zigbuild)
[![docs.rs](https://docs.rs/cargo-zigbuild/badge.svg)](https://docs.rs/cargo-zigbuild/)
[![PyPI](https://img.shields.io/pypi/v/cargo-zigbuild.svg)](https://pypi.org/project/cargo-zigbuild)
[![Docker Image](https://img.shields.io/docker/pulls/messense/cargo-zigbuild.svg?maxAge=2592000)](https://hub.docker.com/r/messense/cargo-zigbuild/)

> 🚀 Help me to become a full-time open-source developer by [sponsoring me on GitHub](https://github.com/sponsors/messense)

Compile Cargo project with [zig as linker](https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html) for [easier cross compiling](https://actually.fyi/posts/zig-makes-rust-cross-compilation-just-work/).

## Installation

```bash
cargo install cargo-zigbuild
```

You can also install it using pip which will also install [`ziglang`](https://pypi.org/project/ziglang/) automatically:

```bash
pip install cargo-zigbuild
```

We also provide a [Docker image](https://hub.docker.com/r/messense/cargo-zigbuild) which has macOS SDK pre-installed in addition to cargo-zigbuild and Rust,
for example to build for x86_64 macOS:

```bash
docker run --rm -it -v $(pwd):/io -w /io messense/cargo-zigbuild \
  cargo zigbuild --release --target x86_64-apple-darwin
```

[![Packaging status](https://repology.org/badge/vertical-allrepos/cargo-zigbuild.svg?columns=4)](https://repology.org/project/cargo-zigbuild/versions)

## Usage

1. Install [zig](https://ziglang.org/) following the [official documentation](https://ziglang.org/learn/getting-started/#installing-zig),
on macOS, Windows and Linux you can also install zig from PyPI via `pip3 install ziglang`
2. Install Rust target via rustup, for example, `rustup target add aarch64-unknown-linux-gnu`
3. Run `cargo zigbuild`, for example, `cargo zigbuild --target aarch64-unknown-linux-gnu`

### Specify glibc version

`cargo zigbuild` supports passing glibc version in `--target` option, for example,
to compile for glibc 2.17 with the `aarch64-unknown-linux-gnu` target:

```bash
cargo zigbuild --target aarch64-unknown-linux-gnu.2.17
```

## Caveats

1. Currently only Linux, macOS and Windows gnu targets are supported,
   other target platforms can be added if you can make it work,
   pull requests are welcome.
2. Only current Rust **stable** and **nightly** versions are regularly tested on CI, other versions may not work.

Known upstream zig [issues](https://github.com/ziglang/zig/labels/zig%20cc):

1. [zig cc: parse `-target` and `-mcpu`/`-march`/`-mtune` flags according to clang](https://github.com/ziglang/zig/issues/4911):
   Some Rust targets aren't recognized by `zig cc`, for example `armv7-unknown-linux-gnueabihf`
2. [glibc 2.27 or older: fcntl64 not found, but zig's glibc headers refer it](https://github.com/ziglang/zig/issues/9485)

## License

This work is released under the MIT license. A copy of the license is provided
in the [LICENSE](./LICENSE) file.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cargo-zigbuild",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": null,
    "keywords": "zig,cargo",
    "author": null,
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# cargo-zigbuild\n\n[![CI](https://github.com/messense/cargo-zigbuild/workflows/CI/badge.svg)](https://github.com/messense/cargo-zigbuild/actions?query=workflow%3ACI)\n[![Crates.io](https://img.shields.io/crates/v/cargo-zigbuild.svg)](https://crates.io/crates/cargo-zigbuild)\n[![docs.rs](https://docs.rs/cargo-zigbuild/badge.svg)](https://docs.rs/cargo-zigbuild/)\n[![PyPI](https://img.shields.io/pypi/v/cargo-zigbuild.svg)](https://pypi.org/project/cargo-zigbuild)\n[![Docker Image](https://img.shields.io/docker/pulls/messense/cargo-zigbuild.svg?maxAge=2592000)](https://hub.docker.com/r/messense/cargo-zigbuild/)\n\n> \ud83d\ude80 Help me to become a full-time open-source developer by [sponsoring me on GitHub](https://github.com/sponsors/messense)\n\nCompile Cargo project with [zig as linker](https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html) for [easier cross compiling](https://actually.fyi/posts/zig-makes-rust-cross-compilation-just-work/).\n\n## Installation\n\n```bash\ncargo install cargo-zigbuild\n```\n\nYou can also install it using pip which will also install [`ziglang`](https://pypi.org/project/ziglang/) automatically:\n\n```bash\npip install cargo-zigbuild\n```\n\nWe also provide a [Docker image](https://hub.docker.com/r/messense/cargo-zigbuild) which has macOS SDK pre-installed in addition to cargo-zigbuild and Rust,\nfor example to build for x86_64 macOS:\n\n```bash\ndocker run --rm -it -v $(pwd):/io -w /io messense/cargo-zigbuild \\\n  cargo zigbuild --release --target x86_64-apple-darwin\n```\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/cargo-zigbuild.svg?columns=4)](https://repology.org/project/cargo-zigbuild/versions)\n\n## Usage\n\n1. Install [zig](https://ziglang.org/) following the [official documentation](https://ziglang.org/learn/getting-started/#installing-zig),\non macOS, Windows and Linux you can also install zig from PyPI via `pip3 install ziglang`\n2. Install Rust target via rustup, for example, `rustup target add aarch64-unknown-linux-gnu`\n3. Run `cargo zigbuild`, for example, `cargo zigbuild --target aarch64-unknown-linux-gnu`\n\n### Specify glibc version\n\n`cargo zigbuild` supports passing glibc version in `--target` option, for example,\nto compile for glibc 2.17 with the `aarch64-unknown-linux-gnu` target:\n\n```bash\ncargo zigbuild --target aarch64-unknown-linux-gnu.2.17\n```\n\n## Caveats\n\n1. Currently only Linux, macOS and Windows gnu targets are supported,\n   other target platforms can be added if you can make it work,\n   pull requests are welcome.\n2. Only current Rust **stable** and **nightly** versions are regularly tested on CI, other versions may not work.\n\nKnown upstream zig [issues](https://github.com/ziglang/zig/labels/zig%20cc):\n\n1. [zig cc: parse `-target` and `-mcpu`/`-march`/`-mtune` flags according to clang](https://github.com/ziglang/zig/issues/4911):\n   Some Rust targets aren't recognized by `zig cc`, for example `armv7-unknown-linux-gnueabihf`\n2. [glibc 2.27 or older: fcntl64 not found, but zig's glibc headers refer it](https://github.com/ziglang/zig/issues/9485)\n\n## License\n\nThis work is released under the MIT license. A copy of the license is provided\nin the [LICENSE](./LICENSE) file.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Compile Cargo project with zig as linker",
    "version": "0.12.3",
    "split_keywords": [
        "zig",
        "cargo"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "md5": "bc86e5998b774fcd37ba3bc101e9706c",
                "sha256": "63815e15ac8bfa69e3ac5de8912a4e385227a0f56724335660e46b094d03a2ec"
            },
            "downloads": -1,
            "filename": "cargo_zigbuild-0.12.3-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl",
            "has_sig": false,
            "md5_digest": "bc86e5998b774fcd37ba3bc101e9706c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1343556,
            "upload_time": "2022-09-15T04:55:30",
            "upload_time_iso_8601": "2022-09-15T04:55:30.389383Z",
            "url": "https://files.pythonhosted.org/packages/37/36/cc848b292dcca320808dcfae4f5bed15c22cfb7cc2c0ab213052e2693ab0/cargo_zigbuild-0.12.3-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "md5": "b115ed65ea16893e1305e12a3fc78798",
                "sha256": "f1eb0449f89647cdf059b1b6b9f078d64028a66cc0009a1196b535aedac18043"
            },
            "downloads": -1,
            "filename": "cargo_zigbuild-0.12.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "b115ed65ea16893e1305e12a3fc78798",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 692324,
            "upload_time": "2022-09-15T04:55:32",
            "upload_time_iso_8601": "2022-09-15T04:55:32.566502Z",
            "url": "https://files.pythonhosted.org/packages/cd/2a/1c0a7334c5f40a22128679d07057a25cb1244a65f01c58e45c92601aa321/cargo_zigbuild-0.12.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "md5": "97338017eff7ba62df11f318e4854421",
                "sha256": "f7132c3129c13063202d3f275889aa9b8e7643141663cf212b18b2954756b39b"
            },
            "downloads": -1,
            "filename": "cargo_zigbuild-0.12.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "has_sig": false,
            "md5_digest": "97338017eff7ba62df11f318e4854421",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 667008,
            "upload_time": "2022-09-15T04:55:34",
            "upload_time_iso_8601": "2022-09-15T04:55:34.329043Z",
            "url": "https://files.pythonhosted.org/packages/6a/1b/cca0e705fc8e028a8cc09a4c0490d317ebb1070960a115faa121898537fb/cargo_zigbuild-0.12.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "md5": "40159753db09f8142e32907bee07e636",
                "sha256": "1827ba7081400e69d8229030af31b76fd477f812ca715dbbdcf3d252981707df"
            },
            "downloads": -1,
            "filename": "cargo_zigbuild-0.12.3-py3-none-manylinux_2_5_i686.manylinux1_i686.whl",
            "has_sig": false,
            "md5_digest": "40159753db09f8142e32907bee07e636",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 781086,
            "upload_time": "2022-09-15T04:55:36",
            "upload_time_iso_8601": "2022-09-15T04:55:36.230926Z",
            "url": "https://files.pythonhosted.org/packages/b2/f7/6e1163843df5c3138226a82b32992af22a2ad96ef972853b367ed228c984/cargo_zigbuild-0.12.3-py3-none-manylinux_2_5_i686.manylinux1_i686.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "md5": "1bc89823c3b42b2a9c1d2dde4b1c06cb",
                "sha256": "9666b76e5d41ddd6e137f5cdd12fcb51e8b97816926e077f33a4c7f79a351c27"
            },
            "downloads": -1,
            "filename": "cargo_zigbuild-0.12.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "1bc89823c3b42b2a9c1d2dde4b1c06cb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 745018,
            "upload_time": "2022-09-15T04:55:38",
            "upload_time_iso_8601": "2022-09-15T04:55:38.023450Z",
            "url": "https://files.pythonhosted.org/packages/ae/cc/bb4c2ae3d16e83781b38d7649f474f5b070e2c82e42a514ba43690157b22/cargo_zigbuild-0.12.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "md5": "7be37f8661b9c3028f4a906402799532",
                "sha256": "3715acb4a18b634301234f770ff82b2fee307de054d577ebe6e65f973359591e"
            },
            "downloads": -1,
            "filename": "cargo_zigbuild-0.12.3-py3-none-win32.whl",
            "has_sig": false,
            "md5_digest": "7be37f8661b9c3028f4a906402799532",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 604345,
            "upload_time": "2022-09-15T04:55:39",
            "upload_time_iso_8601": "2022-09-15T04:55:39.833439Z",
            "url": "https://files.pythonhosted.org/packages/9b/5a/912fc2dd78d4712077613df0955d40a876b81da852241bd663bc208d842e/cargo_zigbuild-0.12.3-py3-none-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "md5": "0525e13f2c88b2802e0fdeaf02b9c446",
                "sha256": "4faf1b8200e89280e7d287bfe8aebf0316817e8479dff2b2fe717493b82704e5"
            },
            "downloads": -1,
            "filename": "cargo_zigbuild-0.12.3-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "0525e13f2c88b2802e0fdeaf02b9c446",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 638778,
            "upload_time": "2022-09-15T04:55:41",
            "upload_time_iso_8601": "2022-09-15T04:55:41.363452Z",
            "url": "https://files.pythonhosted.org/packages/c7/7d/216b5a39e8ebf9a601faa12436b6dfadb179c8602d172c0b5596b4c625ae/cargo_zigbuild-0.12.3-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "md5": "fa29111c84ca54c240349e5f6581ec82",
                "sha256": "0d9cd21135081fe8631a8f452e663d2723edf723acc251d5af8f721198738248"
            },
            "downloads": -1,
            "filename": "cargo_zigbuild-0.12.3-py3-none-win_arm64.whl",
            "has_sig": false,
            "md5_digest": "fa29111c84ca54c240349e5f6581ec82",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 610880,
            "upload_time": "2022-09-15T04:55:43",
            "upload_time_iso_8601": "2022-09-15T04:55:43.183452Z",
            "url": "https://files.pythonhosted.org/packages/0d/4a/d86767f0dea2dd8d4e4d2453330fdc4a95663d40dc0006ec5d3e7e255524/cargo_zigbuild-0.12.3-py3-none-win_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-09-15 04:55:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "cargo-zigbuild"
}
        
Elapsed time: 0.38913s