{"id":33904816,"url":"https://github.com/hyperlight-dev/cargo-hyperlight","last_synced_at":"2026-04-06T07:01:54.120Z","repository":{"id":322659236,"uuid":"1089618108","full_name":"hyperlight-dev/cargo-hyperlight","owner":"hyperlight-dev","description":"A cargo subcommand to build hyperlight guest binaries","archived":false,"fork":false,"pushed_at":"2026-03-31T20:15:39.000Z","size":202,"stargazers_count":1,"open_issues_count":7,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-31T21:31:06.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperlight-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2025-11-04T15:29:30.000Z","updated_at":"2026-03-16T11:57:33.000Z","dependencies_parsed_at":"2025-11-29T22:06:37.860Z","dependency_job_id":null,"html_url":"https://github.com/hyperlight-dev/cargo-hyperlight","commit_stats":null,"previous_names":["hyperlight-dev/cargo-hyperlight"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/hyperlight-dev/cargo-hyperlight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fcargo-hyperlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fcargo-hyperlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fcargo-hyperlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fcargo-hyperlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperlight-dev","download_url":"https://codeload.github.com/hyperlight-dev/cargo-hyperlight/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperlight-dev%2Fcargo-hyperlight/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31463015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"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":[],"created_at":"2025-12-12T01:39:16.767Z","updated_at":"2026-04-06T07:01:54.112Z","avatar_url":"https://github.com/hyperlight-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cargo-hyperlight\n\nA cargo subcommand to build [hyperlight](https://github.com/hyperlight-dev/hyperlight) guest binaries.\n\nWrite a hyperlight guest binary in Rust, and build it with a simple\n```sh\ncargo hyperlight build\n```\n\nAnd there's no need for any extra configuration.\n\nYour binary, or any of its dependencies, can have a `build.rs` script using `cc` and `bindgen` to compile C code and generate bindings.\nThey will work out of the box!\n\n\u003e [!NOTE]\n\u003e Your crate **must** have `hyperlight-guest-bin` as a transitive dependency.\n\n## Installation\n\n```sh\ncargo install cargo-hyperlight\n```\n\n## Usage\n\nCreate a new crate for your hyperlight guest binary:\n\nIn your `Cargo.toml`\n```toml\n[package]\nname = \"guest\"\nversion = \"0.1.0\"\nedition = \"2024\"\n\n[dependencies]\nhyperlight-common = { version = \"0.11.0\", default-features = false }\nhyperlight-guest = \"0.11.0\"\nhyperlight-guest-bin = \"0.11.0\"\n```\n\nThe in your `src/main.rs`\n```rust\n#![no_std]\n#![no_main]\n\nextern crate alloc;\n\nuse alloc::vec::Vec;\n\nuse hyperlight_common::flatbuffer_wrappers::{function_call::*, function_types::*, util::*};\nuse hyperlight_guest::error::Result;\nuse hyperlight_guest_bin::guest_function::{definition::*, register::*};\nuse hyperlight_guest_bin::host_comm::*;\n\npub fn hello_world(_: \u0026FunctionCall) -\u003e Result\u003cVec\u003cu8\u003e\u003e {\n    call_host_function::\u003ci32\u003e(\n        \"HostPrint\",\n        Some([ParameterValue::String(\"hello world\".into())].into()),\n        ReturnType::Int,\n    )?;\n    Ok(get_flatbuffer_result(()))\n}\n\n#[unsafe(no_mangle)]\npub extern \"C\" fn hyperlight_main() {\n    register_function(GuestFunctionDefinition::new(\n        \"HelloWorld\".into(),\n        [ParameterType::String].into(),\n        ReturnType::Void,\n        hello_world as usize,\n    ));\n}\n\n#[unsafe(no_mangle)]\npub fn guest_dispatch_function(_: FunctionCall) -\u003e Result\u003cVec\u003cu8\u003e\u003e {\n    panic!(\"Invalid guest function call\");\n}\n```\n\nThen to build the hyperlight guest binary, run\n\n```sh\ncargo hyperlight build --release\n```\n\nYour binary will be built for the `x86_64-hyperlight-none` target by default, and placed in `target/x86_64-hyperlight-none/release/guest`.\n\nThere's no need for any extra configuration, the command will take care of everything.\n\n## Releasing\n\nTo publish a new version:\n\n1. Update the version in `Cargo.toml`\n2. Commit the change: `git commit -S -s -am  \"Bump version to X.Y.Z\"` and open a PR\n3. Create and push a tag: `git tag -s vX.Y.Z \u0026\u0026 git push origin vX.Y.Z`\n\nThe CI will automatically run tests, publish to crates.io, and create a GitHub release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperlight-dev%2Fcargo-hyperlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperlight-dev%2Fcargo-hyperlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperlight-dev%2Fcargo-hyperlight/lists"}