Skip to content

Commit 44bf75c

Browse files
authored
Merge pull request #15 from scikit-build/update-to-ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1
Update to Ninja 1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1
2 parents 4da99ef + 134e41c commit 44bf75c

File tree

5 files changed

+65
-40
lines changed

5 files changed

+65
-40
lines changed

NinjaUrls.cmake

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11

22
#-----------------------------------------------------------------------------
33
# Ninja sources
4-
set(unix_source_url "https://github.com/ninja-build/ninja/archive/v1.8.2.tar.gz")
5-
set(unix_source_sha256 "86b8700c3d0880c2b44c2ff67ce42774aaf8c28cbf57725cb881569288c1c6f4")
4+
set(unix_source_url "https://github.com/kitware/ninja/archive/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1.tar.gz")
5+
set(unix_source_sha256 "121c432cec32c8aea730a71a256a81442ac8446c6f0e7652ea3121da9e0d482d")
66

7-
set(windows_source_url "https://github.com/ninja-build/ninja/archive/v1.8.2.zip")
8-
set(windows_source_sha256 "b4301eab214959a13865047e0741cbbf5f98ee94fc84b3aeb3066a27a8ce18a2")
7+
set(windows_source_url "https://github.com/kitware/ninja/archive/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1.zip")
8+
set(windows_source_sha256 "01a2bb09bb2f6e6c0e4c9634e0491ad137fde80c3e99de581ee311401d07976a")
9+
10+
if(MSVC AND (MSVC_VERSION EQUAL 1600 OR MSVC_VERSION LESS 1600))
11+
# Fix compilation using "Microsoft Visual C++ Compiler for Python 2.7" or "Visual Studio 2010"
12+
set(windows_source_url "https://github.com/jcfr/ninja/archive/kitware-staged-features-support-vs2008-vs2010.zip")
13+
set(windows_source_sha256 "d64d6ae2eaeed28832e9a9c28901b01f9d070d3f440346e585f68d490447f262")
14+
endif()
915

1016
#-----------------------------------------------------------------------------
1117
# Ninja binaries
1218
set(linux32_binary_url "NA") # Linux 32-bit binaries not available
1319
set(linux32_binary_sha256 "NA")
1420

15-
set(linux64_binary_url "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip")
16-
set(linux64_binary_sha256 "d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07")
21+
set(linux64_binary_url "https://github.com/Kitware/ninja/releases/download/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1/ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1_x86_64-linux-gnu.tar.gz")
22+
set(linux64_binary_sha256 "d0c1c112edbbee421509540764086a2aeaba72d9f552f31423390f8cd254d332")
1723

18-
set(macosx_binary_url "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip")
19-
set(macosx_binary_sha256 "0347d55c66061652b26f48769d566761630ffde3143793b29064a57f356542cc")
24+
set(macosx_binary_url "https://github.com/Kitware/ninja/releases/download/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1/ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1_x86_64-apple-darwin.tar.gz")
25+
set(macosx_binary_sha256 "d71dfa6ec1c15fca4c559ef5d8e7170639e791d499a742eb814e104e82352338")
2026

2127
set(win32_binary_url "NA") # Windows 32-bit binaries not available
2228
set(win32_binary_sha256 "NA")
2329

24-
set(win64_binary_url "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip")
25-
set(win64_binary_sha256 "c80313e6c26c0b9e0c241504718e2d8bbc2798b73429933adf03fdc6d84f0e70")
30+
set(win64_binary_url "https://github.com/Kitware/ninja/releases/download/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1/ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1_i686-pc-windows-msvc.zip")
31+
set(win64_binary_sha256 "665581a875ffa16bcb410972fd8cb419035ce66cf4760b55ba8a57774b2afa61")

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Ninja Python Distributions
44

55
`Ninja <http://www.ninja-build.org>`_ is a small build system with a focus on speed.
66

7-
The latest Ninja python wheels provide `ninja 1.8.2 <https://ninja-build.org/manual.html>`_ executable
7+
The latest Ninja python wheels provide `ninja 1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1 <https://ninja-build.org/manual.html>`_ executable
88
and `ninja_syntax.py` for generating `.ninja` files.
99

1010
.. image:: https://raw.githubusercontent.com/scikit-build/ninja-python-distributions/master/ninja-python-distributions-logo.png

docs/update_ninja_version.rst

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Updating the Ninja version
77
A developer should use the following steps to update the version ``X.Y.Z``
88
of Ninja associated with the current Ninja python distributions.
99

10-
Available Ninja archives can be found `here <https://github.com/ninja-build/ninja/releases>`_.
10+
Available Ninja archives can be found `here <https://github.com/kitware/ninja/releases>`_.
1111

1212
1. Install `requests` and `githubrelease`::
1313

@@ -16,23 +16,23 @@ Available Ninja archives can be found `here <https://github.com/ninja-build/ninj
1616
2. Execute `scripts/update_ninja_version.py` command line tool with the desired
1717
``X.Y.Z`` Ninja version available for download. For example::
1818

19-
$ release=1.8.2
19+
$ release=1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1
2020
$ python scripts/update_ninja_version.py ${release}
2121

22-
Collecting URLs and SHA256s from 'https://github.com/ninja-build/ninja/releases'
23-
Downloading https://github.com/ninja-build/ninja/archive/v1.8.2.tar.gz
24-
Downloading https://github.com/ninja-build/ninja/archive/v1.8.2.tar.gz - done
25-
Downloading https://github.com/ninja-build/ninja/archive/v1.8.2.zip
26-
Downloading https://github.com/ninja-build/ninja/archive/v1.8.2.zip - done
27-
Downloading https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
28-
Downloading https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip - done
29-
Downloading https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip
30-
Downloading https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip - done
31-
Downloading https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip
32-
Downloading https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip - done
33-
Collecting URLs and SHA256s from 'https://github.com/ninja-build/ninja/releases' - done
34-
Updating 'NinjaUrls.cmake' with CMake version 1.8.2
35-
Updating 'NinjaUrls.cmake' with CMake version 1.8.2 - done
22+
Collecting URLs and SHA256s from 'https://github.com/kitware/ninja/releases'
23+
Downloading https://github.com/kitware/ninja/archive/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1.tar.gz
24+
Downloading https://github.com/kitware/ninja/archive/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1.tar.gz - done
25+
Downloading https://github.com/kitware/ninja/archive/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1.zip
26+
Downloading https://github.com/kitware/ninja/archive/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1.zip - done
27+
Downloading https://github.com/Kitware/ninja/releases/download/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1/ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1_i686-pc-windows-msvc.zip
28+
Downloading https://github.com/Kitware/ninja/releases/download/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1/ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1_i686-pc-windows-msvc.zip - done
29+
Downloading https://github.com/Kitware/ninja/releases/download/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1/ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1_x86_64-apple-darwin.tar.gz
30+
Downloading https://github.com/Kitware/ninja/releases/download/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1/ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1_x86_64-apple-darwin.tar.gz - done
31+
Downloading https://github.com/Kitware/ninja/releases/download/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1/ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1_x86_64-linux-gnu.tar.gz
32+
Downloading https://github.com/Kitware/ninja/releases/download/v1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1/ninja-1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1_x86_64-linux-gnu.tar.gz - done
33+
Collecting URLs and SHA256s from 'https://github.com/kitware/ninja/releases' - done
34+
Updating 'NinjaUrls.cmake' with CMake version 1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1
35+
Updating 'NinjaUrls.cmake' with CMake version 1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1 - done
3636
Updating README.rst
3737
Updating README.rst - done
3838
Updating docs/update_ninja_version.rst
@@ -44,7 +44,7 @@ Available Ninja archives can be found `here <https://github.com/ninja-build/ninj
4444
3. Create a topic named `update-to-ninja-X.Y.Z` and commit the changes.
4545
For example::
4646

47-
release=1.8.2
47+
release=1.8.2.g3bbbe.kitware.dyndep-1.jobserver-1
4848
git checkout -b update-to-ninja-${release}
4949
git add NinjaUrls.cmake README.rst docs/update_ninja_version.rst tests/test_distribution.py
5050
git commit -m "Update to Ninja ${release}"

scripts/update_ninja_version.py

+30-11
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
REQ_BUFFER_SIZE = 65536 # Chunk size when iterating a download body
2828

29-
NINJA_RELEASES_GITHUB_REPO = "ninja-build/ninja"
29+
NINJA_RELEASES_GITHUB_REPO = "kitware/ninja"
3030

3131
NINJA_SRC_ARCHIVE_URL_TEMPLATE = \
3232
"https://github.com/" + NINJA_RELEASES_GITHUB_REPO + "/archive/%s"
@@ -108,11 +108,18 @@ def get_ninja_archive_urls_and_sha256s(version):
108108
tag_name + ".zip")
109109
}
110110

111-
expected = {
112-
"ninja-linux.zip": "linux64_binary",
113-
"ninja-mac.zip": "macosx_binary",
114-
"ninja-win.zip": "win64_binary",
115-
}
111+
if NINJA_RELEASES_GITHUB_REPO == "ninja-build/ninja":
112+
expected = {
113+
"ninja-linux.zip": "linux64_binary",
114+
"ninja-mac.zip": "macosx_binary",
115+
"ninja-win.zip": "win64_binary",
116+
}
117+
else:
118+
expected = {
119+
"ninja-%s_x86_64-linux-gnu.tar.gz" % version: "linux64_binary",
120+
"ninja-%s_x86_64-apple-darwin.tar.gz" % version: "macosx_binary",
121+
"ninja-%s_i686-pc-windows-msvc.zip" % version: "win64_binary",
122+
}
116123

117124
found = 0
118125
for asset in release["assets"]:
@@ -180,9 +187,9 @@ def update_cmake_urls_script(version):
180187
cmake_file.write(content)
181188

182189

183-
def _update_file(filepath, regex, replacement):
190+
def _update_file(filepath, regex, replacement, verbose=True):
184191
msg = "Updating %s" % os.path.relpath(filepath, ROOT_DIR)
185-
with _log(msg):
192+
with _log(msg, verbose=verbose):
186193
pattern = re.compile(regex)
187194
with open(filepath, 'r') as doc_file:
188195
lines = doc_file.readlines()
@@ -195,21 +202,33 @@ def _update_file(filepath, regex, replacement):
195202

196203

197204
def update_docs(version):
198-
pattern = re.compile(r"ninja \d.\d.\d")
205+
pattern = re.compile(r"ninja \d.\d.\d(\.[\w\-]+)*")
199206
replacement = "ninja %s" % version
200207
_update_file(
201208
os.path.join(ROOT_DIR, "README.rst"),
202209
pattern, replacement)
203210

204-
pattern = re.compile(r"\d.\d.\d")
211+
pattern = re.compile(r"(?<=v)\d.\d.\d(?:\.[\w\-]+)*(?=(?:\.zip|\.tar\.gz|\/))")
205212
replacement = version
206213
_update_file(
207214
os.path.join(ROOT_DIR, "docs/update_ninja_version.rst"),
208215
pattern, replacement)
209216

217+
pattern = re.compile(r"(?<!v)\d.\d.\d(?:\.[\w\-]+)*")
218+
replacement = version
219+
_update_file(
220+
os.path.join(ROOT_DIR, "docs/update_ninja_version.rst"),
221+
pattern, replacement, verbose=False)
222+
223+
pattern = re.compile(r"github\.com\/[\w\-_]+\/[\w\-_]+(?=\/(?:release|archive))")
224+
replacement = "github.com/" + NINJA_RELEASES_GITHUB_REPO
225+
_update_file(
226+
os.path.join(ROOT_DIR, "docs/update_ninja_version.rst"),
227+
pattern, replacement, verbose=False)
228+
210229

211230
def update_tests(version):
212-
pattern = re.compile(r'expected_version = "\d.\d.\d"')
231+
pattern = re.compile(r'expected_version = "\d.\d.\d(\.[\w\-]+)*"')
213232
replacement = 'expected_version = "%s"' % version
214233
_update_file(os.path.join(
215234
ROOT_DIR, "tests/test_distribution.py"), pattern, replacement)

tests/test_distribution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
def _check_ninja_install(virtualenv):
11-
expected_version = "1.8.2"
11+
expected_version = "1.8.2.git.kitware.dyndep-1.jobserver-1"
1212

1313
for executable_name in ["ninja"]:
1414
output = virtualenv.run(

0 commit comments

Comments
 (0)