Skip to content

Commit a9ae97b

Browse files
authored
Align sdist vcpkg sha to in source sha (#642)
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
1 parent 4224d1d commit a9ae97b

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

setup.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,33 @@
3838
else:
3939
VCPKG_TRIPLET = None
4040

41+
VCPKG_SHA = "9c5c2a0ab75aff5bcd08142525f6ff7f6f7ddeee"
42+
4143
# This will be used for e.g. the sdist
4244
if CSP_USE_VCPKG:
4345
if not os.path.exists("vcpkg"):
44-
subprocess.call(["git", "clone", "https://github.com/Microsoft/vcpkg.git"])
46+
# Clone at the sha we want
47+
subprocess.call(
48+
[
49+
"git",
50+
"clone",
51+
"https://github.com/Microsoft/vcpkg.git",
52+
],
53+
)
54+
subprocess.call(["git", "checkout", VCPKG_SHA], cwd="vcpkg")
55+
else:
56+
# Ensure that the sha matches what we expect
57+
# First get the sha
58+
sha = (
59+
subprocess.check_output(
60+
["git", "rev-parse", "HEAD"],
61+
cwd="vcpkg",
62+
)
63+
.decode("utf-8")
64+
.strip()
65+
)
66+
if sha != VCPKG_SHA:
67+
raise RuntimeError(f"vcpkg sha {sha} does not match expected {VCPKG_SHA}")
4568
if not os.path.exists("vcpkg/ports"):
4669
subprocess.call(["git", "submodule", "update", "--init", "--recursive"])
4770
if not os.path.exists("vcpkg/buildtrees"):

0 commit comments

Comments
 (0)