{"id":18787192,"url":"https://github.com/michaelforney/samurai","last_synced_at":"2025-05-14T16:03:17.577Z","repository":{"id":39616994,"uuid":"97347481","full_name":"michaelforney/samurai","owner":"michaelforney","description":"ninja-compatible build tool written in C","archived":false,"fork":false,"pushed_at":"2025-03-03T20:27:58.000Z","size":273,"stargazers_count":877,"open_issues_count":30,"forks_count":52,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-06T09:01:27.362Z","etag":null,"topics":["build","ninja"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelforney.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":"2017-07-15T23:17:43.000Z","updated_at":"2025-04-04T01:43:57.000Z","dependencies_parsed_at":"2024-02-23T20:29:51.215Z","dependency_job_id":"4f8611c1-1410-48d3-81fd-2408e9abcd75","html_url":"https://github.com/michaelforney/samurai","commit_stats":{"total_commits":356,"total_committers":19,"mean_commits":"18.736842105263158","dds":0.0786516853932584,"last_synced_commit":"67b3dc5309142b06404eca8084b8c048bb69f0f4"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Fsamurai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Fsamurai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Fsamurai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Fsamurai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelforney","download_url":"https://codeload.github.com/michaelforney/samurai/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248716667,"owners_count":21150363,"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":["build","ninja"],"created_at":"2024-11-07T20:53:47.405Z","updated_at":"2025-04-13T12:39:40.494Z","avatar_url":"https://github.com/michaelforney.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# samurai\n\n[![builds.sr.ht status](https://builds.sr.ht/~mcf/samurai.svg)](https://builds.sr.ht/~mcf/samurai)\n[![GitHub build status](https://github.com/michaelforney/samurai/workflows/build/badge.svg)](https://github.com/michaelforney/samurai/actions)\n\nsamurai is a ninja-compatible build tool written in C99 with a focus on\nsimplicity, speed, and portability.\n\n## Status\n\nsamurai implements the ninja build language through version 1.9.0 except\nfor MSVC dependency handling (`deps = msvc`). It uses the same format\nfor `.ninja_log` and `.ninja_deps` as ninja, currently version 5 and 4\nrespectively.\n\nIt is feature-complete and supports most of the same options as ninja.\n\n## Requirements\n\nsamurai requires various POSIX.1-2008 interfaces.\n\nScheduling jobs based on load average requires the non-standard\n`getloadavg` function. This feature can be enabled by defining\n`HAVE_GETLOADAVG` in your `CFLAGS`, along with any other necessary\ndefinitions for your platform.\n\n## Differences from ninja\n\nsamurai tries to match ninja behavior as much as possible, but there\nare several cases where it is slightly different:\n\n- samurai uses the [variable lookup order] documented in the ninja manual,\n  while ninja has a quirk ([ninja-build/ninja#1516]) that if the build\n  edge has no variable bindings, the variable is looked up in file scope\n  *before* the rule-level variables.\n- samurai schedules jobs using a stack, so the last scheduled job is\n  the first to execute, while ninja schedules jobs based on the pointer\n  value of the edge structure (they are stored in a `std::set\u003cEdge*\u003e`),\n  so the first to execute depends on the address returned by `malloc`.\n  This may result in build failures due to insufficiently specified\n  dependencies in the project's build system.\n- samurai does not post-process the job output in any way, so if it\n  includes escape sequences they will be preserved, while ninja strips\n  escape sequences if standard output is not a terminal. Some build\n  systems, like meson, force color output from gcc by default using\n  `-fdiagnostics-color=always`, so if you plan to save the output to a\n  log, you should pass `-Db_colorout=auto` to meson.\n- samurai follows the [POSIX Utility Syntax Guidelines], in particular\n  guideline 9, so it requires that any command-line options precede\n  the operands. It does not do GNU-style argument permutation.\n\n[ninja-build/ninja#1516]: https://github.com/ninja-build/ninja/issues/1516\n[variable lookup order]: https://ninja-build.org/manual.html#ref_scope\n[POSIX Utility Syntax Guidelines]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelforney%2Fsamurai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelforney%2Fsamurai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelforney%2Fsamurai/lists"}