rninja-cli 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rninja_cli-0.1.1/MANIFEST.in +2 -0
- rninja_cli-0.1.1/PKG-INFO +63 -0
- rninja_cli-0.1.1/README.md +42 -0
- rninja_cli-0.1.1/pyproject.toml +35 -0
- rninja_cli-0.1.1/rninja/__init__.py +3 -0
- rninja_cli-0.1.1/rninja/cli.py +138 -0
- rninja_cli-0.1.1/rninja_cli.egg-info/PKG-INFO +63 -0
- rninja_cli-0.1.1/rninja_cli.egg-info/SOURCES.txt +11 -0
- rninja_cli-0.1.1/rninja_cli.egg-info/dependency_links.txt +1 -0
- rninja_cli-0.1.1/rninja_cli.egg-info/entry_points.txt +4 -0
- rninja_cli-0.1.1/rninja_cli.egg-info/top_level.txt +1 -0
- rninja_cli-0.1.1/setup.cfg +4 -0
- rninja_cli-0.1.1/setup.py +5 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rninja-cli
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A drop-in replacement for Ninja build system with caching and improved scheduling
|
|
5
|
+
Author: Dipankar Sarkar
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/neul-labs/rninja
|
|
8
|
+
Project-URL: Repository, https://github.com/neul-labs/rninja
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Rust
|
|
18
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# rninja
|
|
23
|
+
|
|
24
|
+
[](https://pypi.org/project/rninja/)
|
|
25
|
+
[](https://opensource.org/licenses/MIT)
|
|
26
|
+
|
|
27
|
+
**Build faster. Cache smarter. Drop-in ready.**
|
|
28
|
+
|
|
29
|
+
A Rust-powered drop-in replacement for [Ninja](https://ninja-build.org/) with built-in caching and modern scheduling. Cut your build times without changing your build files.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install rninja-cli
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The package downloads the correct prebuilt binary for your platform on first use (macOS Intel/Apple Silicon, Linux x86_64/aarch64).
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
After installation, use `rninja` exactly like `ninja`:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
rninja
|
|
45
|
+
rninja -C out/Release
|
|
46
|
+
rninja -j8 my_target
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Features
|
|
50
|
+
|
|
51
|
+
- **Drop-in compatible** — Works with existing `.ninja` files from CMake, GN, Meson, or any generator
|
|
52
|
+
- **Built-in caching** — Content-addressed cache skips redundant work automatically
|
|
53
|
+
- **Modern scheduler** — Rust async runtime keeps all cores busy
|
|
54
|
+
- **Remote cache ready** — Share cached artifacts across machines and CI runners
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
- [Full documentation](https://docs.neullabs.com/rninja)
|
|
59
|
+
- [GitHub repository](https://github.com/neul-labs/rninja)
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# rninja
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/rninja/)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
**Build faster. Cache smarter. Drop-in ready.**
|
|
7
|
+
|
|
8
|
+
A Rust-powered drop-in replacement for [Ninja](https://ninja-build.org/) with built-in caching and modern scheduling. Cut your build times without changing your build files.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install rninja-cli
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The package downloads the correct prebuilt binary for your platform on first use (macOS Intel/Apple Silicon, Linux x86_64/aarch64).
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
After installation, use `rninja` exactly like `ninja`:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
rninja
|
|
24
|
+
rninja -C out/Release
|
|
25
|
+
rninja -j8 my_target
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
- **Drop-in compatible** — Works with existing `.ninja` files from CMake, GN, Meson, or any generator
|
|
31
|
+
- **Built-in caching** — Content-addressed cache skips redundant work automatically
|
|
32
|
+
- **Modern scheduler** — Rust async runtime keeps all cores busy
|
|
33
|
+
- **Remote cache ready** — Share cached artifacts across machines and CI runners
|
|
34
|
+
|
|
35
|
+
## Documentation
|
|
36
|
+
|
|
37
|
+
- [Full documentation](https://docs.neullabs.com/rninja)
|
|
38
|
+
- [GitHub repository](https://github.com/neul-labs/rninja)
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
MIT
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "rninja-cli"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "A drop-in replacement for Ninja build system with caching and improved scheduling"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "Dipankar Sarkar"},
|
|
13
|
+
]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.8",
|
|
19
|
+
"Programming Language :: Python :: 3.9",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Rust",
|
|
24
|
+
"Topic :: Software Development :: Build Tools",
|
|
25
|
+
]
|
|
26
|
+
requires-python = ">=3.8"
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
rninja = "rninja.cli:main"
|
|
30
|
+
rninja-cached = "rninja.cli:cached_main"
|
|
31
|
+
rninja-daemon = "rninja.cli:daemon_main"
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://github.com/neul-labs/rninja"
|
|
35
|
+
Repository = "https://github.com/neul-labs/rninja"
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"""Thin CLI wrapper that delegates to the downloaded rninja binary."""
|
|
2
|
+
|
|
3
|
+
import hashlib
|
|
4
|
+
import os
|
|
5
|
+
import platform
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
import tarfile
|
|
9
|
+
import urllib.request
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from importlib.metadata import version as get_version
|
|
14
|
+
except ImportError:
|
|
15
|
+
from importlib_metadata import version as get_version # type: ignore[no-redef]
|
|
16
|
+
|
|
17
|
+
GITHUB_OWNER = "neul-labs"
|
|
18
|
+
REPO = "rninja"
|
|
19
|
+
VERSION = get_version("rninja-cli")
|
|
20
|
+
|
|
21
|
+
ARCH_MAP = {
|
|
22
|
+
"x86_64": "x86_64",
|
|
23
|
+
"AMD64": "x86_64",
|
|
24
|
+
"arm64": "aarch64",
|
|
25
|
+
"aarch64": "aarch64",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _get_binary_dir() -> Path:
|
|
30
|
+
"""Return the directory where binaries are installed."""
|
|
31
|
+
return Path(__file__).parent / "bin"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _get_download_url() -> str:
|
|
35
|
+
"""Determine the correct tarball URL for this platform."""
|
|
36
|
+
system = platform.system().lower()
|
|
37
|
+
machine = platform.machine()
|
|
38
|
+
arch = ARCH_MAP.get(machine, machine)
|
|
39
|
+
|
|
40
|
+
if system == "darwin":
|
|
41
|
+
platform_name = "apple-darwin"
|
|
42
|
+
elif system == "linux":
|
|
43
|
+
platform_name = "unknown-linux-gnu"
|
|
44
|
+
else:
|
|
45
|
+
raise RuntimeError(f"Unsupported platform: {system}")
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
f"https://github.com/{GITHUB_OWNER}/{REPO}/releases/download/"
|
|
49
|
+
f"v{VERSION}/rninja-{VERSION}-{arch}-{platform_name}.tar.gz"
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _download_and_extract(dest_dir: Path) -> None:
|
|
54
|
+
"""Download the prebuilt binary tarball and extract to dest_dir."""
|
|
55
|
+
url = _get_download_url()
|
|
56
|
+
print(f"Downloading rninja {VERSION} from {url}")
|
|
57
|
+
|
|
58
|
+
dest_dir.mkdir(parents=True, exist_ok=True)
|
|
59
|
+
tarball_path = dest_dir / "rninja.tar.gz"
|
|
60
|
+
try:
|
|
61
|
+
urllib.request.urlretrieve(url, tarball_path)
|
|
62
|
+
except Exception as e:
|
|
63
|
+
raise RuntimeError(f"Failed to download rninja: {e}") from e
|
|
64
|
+
|
|
65
|
+
print("Extracting binaries...")
|
|
66
|
+
with tarfile.open(tarball_path, "r:gz") as tf:
|
|
67
|
+
tf.extractall(path=dest_dir)
|
|
68
|
+
|
|
69
|
+
tarball_path.unlink()
|
|
70
|
+
|
|
71
|
+
# Make binaries executable on Unix
|
|
72
|
+
if platform.system() != "Windows":
|
|
73
|
+
for binary in ["rninja", "rninja-cached", "rninja-daemon"]:
|
|
74
|
+
binary_path = dest_dir / binary
|
|
75
|
+
if binary_path.exists():
|
|
76
|
+
binary_path.chmod(0o755)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _ensure_binary(name: str) -> str:
|
|
80
|
+
"""Return the path to a binary, downloading if necessary."""
|
|
81
|
+
bin_dir = _get_binary_dir()
|
|
82
|
+
|
|
83
|
+
if platform.system() == "Windows":
|
|
84
|
+
path = bin_dir / f"{name}.exe"
|
|
85
|
+
if path.exists():
|
|
86
|
+
return str(path)
|
|
87
|
+
else:
|
|
88
|
+
path = bin_dir / name
|
|
89
|
+
if path.exists():
|
|
90
|
+
return str(path)
|
|
91
|
+
|
|
92
|
+
# Binary not found — download it
|
|
93
|
+
if os.environ.get("RNINJA_SKIP_DOWNLOAD"):
|
|
94
|
+
raise RuntimeError(
|
|
95
|
+
f"Binary '{name}' not found in {bin_dir} and RNINJA_SKIP_DOWNLOAD is set."
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
_download_and_extract(bin_dir)
|
|
99
|
+
|
|
100
|
+
# Check again after download
|
|
101
|
+
if platform.system() == "Windows":
|
|
102
|
+
path = bin_dir / f"{name}.exe"
|
|
103
|
+
else:
|
|
104
|
+
path = bin_dir / name
|
|
105
|
+
|
|
106
|
+
if path.exists():
|
|
107
|
+
return str(path)
|
|
108
|
+
|
|
109
|
+
raise RuntimeError(
|
|
110
|
+
f"Binary '{name}' not found in {bin_dir} after download. "
|
|
111
|
+
"Please reinstall the package."
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def _run(name: str) -> None:
|
|
116
|
+
"""Run the named binary with forwarded arguments."""
|
|
117
|
+
binary = _ensure_binary(name)
|
|
118
|
+
result = subprocess.run([binary] + sys.argv[1:])
|
|
119
|
+
sys.exit(result.returncode)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def main() -> None:
|
|
123
|
+
"""Run rninja."""
|
|
124
|
+
_run("rninja")
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def cached_main() -> None:
|
|
128
|
+
"""Run rninja-cached."""
|
|
129
|
+
_run("rninja-cached")
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def daemon_main() -> None:
|
|
133
|
+
"""Run rninja-daemon."""
|
|
134
|
+
_run("rninja-daemon")
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
if __name__ == "__main__":
|
|
138
|
+
main()
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rninja-cli
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A drop-in replacement for Ninja build system with caching and improved scheduling
|
|
5
|
+
Author: Dipankar Sarkar
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/neul-labs/rninja
|
|
8
|
+
Project-URL: Repository, https://github.com/neul-labs/rninja
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Rust
|
|
18
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# rninja
|
|
23
|
+
|
|
24
|
+
[](https://pypi.org/project/rninja/)
|
|
25
|
+
[](https://opensource.org/licenses/MIT)
|
|
26
|
+
|
|
27
|
+
**Build faster. Cache smarter. Drop-in ready.**
|
|
28
|
+
|
|
29
|
+
A Rust-powered drop-in replacement for [Ninja](https://ninja-build.org/) with built-in caching and modern scheduling. Cut your build times without changing your build files.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install rninja-cli
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The package downloads the correct prebuilt binary for your platform on first use (macOS Intel/Apple Silicon, Linux x86_64/aarch64).
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
After installation, use `rninja` exactly like `ninja`:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
rninja
|
|
45
|
+
rninja -C out/Release
|
|
46
|
+
rninja -j8 my_target
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Features
|
|
50
|
+
|
|
51
|
+
- **Drop-in compatible** — Works with existing `.ninja` files from CMake, GN, Meson, or any generator
|
|
52
|
+
- **Built-in caching** — Content-addressed cache skips redundant work automatically
|
|
53
|
+
- **Modern scheduler** — Rust async runtime keeps all cores busy
|
|
54
|
+
- **Remote cache ready** — Share cached artifacts across machines and CI runners
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
- [Full documentation](https://docs.neullabs.com/rninja)
|
|
59
|
+
- [GitHub repository](https://github.com/neul-labs/rninja)
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
MANIFEST.in
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
setup.py
|
|
5
|
+
rninja/__init__.py
|
|
6
|
+
rninja/cli.py
|
|
7
|
+
rninja_cli.egg-info/PKG-INFO
|
|
8
|
+
rninja_cli.egg-info/SOURCES.txt
|
|
9
|
+
rninja_cli.egg-info/dependency_links.txt
|
|
10
|
+
rninja_cli.egg-info/entry_points.txt
|
|
11
|
+
rninja_cli.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rninja
|