{"id":21603091,"url":"https://github.com/evmar/n2","last_synced_at":"2025-05-15T22:11:59.893Z","repository":{"id":42062225,"uuid":"400340703","full_name":"evmar/n2","owner":"evmar","description":"n2 (\"into\"), a ninja compatible build system","archived":false,"fork":false,"pushed_at":"2025-03-14T18:29:06.000Z","size":691,"stargazers_count":403,"open_issues_count":26,"forks_count":31,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-08T09:11:12.305Z","etag":null,"topics":["build-system","ninja"],"latest_commit_sha":null,"homepage":"","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/evmar.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":"2021-08-27T00:20:54.000Z","updated_at":"2025-03-23T20:06:30.000Z","dependencies_parsed_at":"2023-01-30T04:45:34.005Z","dependency_job_id":"dbc6a4a2-626b-4715-a987-02b6a1e2830e","html_url":"https://github.com/evmar/n2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evmar%2Fn2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evmar%2Fn2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evmar%2Fn2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evmar%2Fn2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evmar","download_url":"https://codeload.github.com/evmar/n2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254430331,"owners_count":22069909,"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-system","ninja"],"created_at":"2024-11-24T19:15:07.117Z","updated_at":"2025-05-15T22:11:54.883Z","avatar_url":"https://github.com/evmar.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# n2, an alternative ninja implementation\n\n![CI status](https://github.com/evmar/n2/actions/workflows/ci.yml/badge.svg)\n\nn2 (pronounced \"into\") implements enough of [Ninja](https://ninja-build.org/) to\nsuccessfully build some projects that build with Ninja. Compared to Ninja, n2\nmissing some features but is faster to build and has a better UI; see\n[a more detailed comparison](doc/comparison.md).\n\n\u003e [Here's a small demo](https://asciinema.org/a/F2E7a6nX4feoSSWVI4oFAm21T) of n2\n\u003e building some of Clang.\n\n## Install\n\n```\n$ cargo install --locked --git https://github.com/evmar/n2\n# (installs into ~/.cargo/bin/)\n# On Windows, add `--features crlf` to support files with CRLF linefeeds --\n# costs 10% in file parse time.\n\n$ n2 -C some/build/dir some-target\n```\n\n### Using with CMake\n\nWhen CMake generates Ninja files it attempts run a program named `ninja` with\nsome particular Ninja behaviors. In particular, it attempts to inform Ninja/n2\nthat its generated build files are up to date so that the build system doesn't\nattempt to rebuild them.\n\nn2 can emulate the expected CMake behavior when invoked as `ninja`. To do this\nyou create a symlink named `ninja` somewhere in your `$PATH`, such that CMake\ncan discover it.\n\n- UNIX: `ln -s path/to/n2 ninja`\n- Windows(cmd): `mklink ninja.exe path\\to\\n2`\n- Windows(PowerShell): `New-Item -Type Symlink ninja.exe -Target path\\to\\n2`\n\n\u003e **Warning**\\\n\u003e If you don't have Ninja installed at all, you must install such a symlink\n\u003e because CMake attempts to invoke `ninja` itself!\n\n## The console output\n\nWhile building, n2 displays build progress like this:\n\n```\n[=========================---------       ] 2772/4459 done, 8/930 running\nBuilding foo/bar (2s)\nBuilding foo/baz\n```\n\nThe progress bar always covers all build steps needed for the targets,\nregardless of whether they need to be executed or not.\n\nThe bar shows three categories of state:\n\n- **Done:** The `=` signs show the build steps that are already up to date.\n- **In progress:** The `-` signs show steps that are in-progress; if you had\n  enough CPUs they would all be executing. The `8/930 running` after shows that\n  n2 is currently executing 8 of the 930 available steps.\n- **Unknown:** The remaining empty space indicates steps whose status is yet to\n  be known, as they depend on the in progress steps. For example, if an\n  intermediate step doesn't write its outputs n2 may not need to execute the\n  dependent steps.\n\nThe lines below the progress bar show some build steps that are currrently\nrunning, along with how long they've been running if it has been a while. Their\ntext is controlled by the input `build.ninja` file.\n\n## More reading\n\nI wrote n2 to\n[explore some alternative ideas](http://neugierig.org/software/blog/2022/03/n2.html)\nI had around how to structure a build system. In a very real sense the\nexploration is more important than the actual software itself, so you can view\nthe design notes as one of the primary artifacts of this.\n\n- [Design notes](doc/design_notes.md).\n- [Development tips](doc/development.md).\n- [Comparison with Ninja / missing features](doc/comparison.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevmar%2Fn2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevmar%2Fn2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevmar%2Fn2/lists"}