add shallow_since to a bunch of git deps
This commit is contained in:
parent
8f5474bef0
commit
ef79596c5b
2
cargo/Cargo.lock
generated
2
cargo/Cargo.lock
generated
@ -269,7 +269,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "coarsetime"
|
name = "coarsetime"
|
||||||
version = "0.1.14"
|
version = "0.1.14"
|
||||||
source = "git+https://github.com/ankitects/rust-coarsetime.git?branch=old-mac-compat#f9e2c86216f0f4803bc75404828318fc206dab29"
|
source = "git+https://github.com/ankitects/rust-coarsetime.git?tag=anki-2020-11-03#f9e2c86216f0f4803bc75404828318fc206dab29"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libc",
|
"libc",
|
||||||
|
@ -325,6 +325,7 @@ def raze_fetch_remote_crates():
|
|||||||
new_git_repository,
|
new_git_repository,
|
||||||
name = "raze__coarsetime__0_1_14",
|
name = "raze__coarsetime__0_1_14",
|
||||||
remote = "https://github.com/ankitects/rust-coarsetime.git",
|
remote = "https://github.com/ankitects/rust-coarsetime.git",
|
||||||
|
shallow_since = "1594611111 +1000",
|
||||||
commit = "f9e2c86216f0f4803bc75404828318fc206dab29",
|
commit = "f9e2c86216f0f4803bc75404828318fc206dab29",
|
||||||
build_file = Label("//cargo/remote:coarsetime-0.1.14.BUILD.bazel"),
|
build_file = Label("//cargo/remote:coarsetime-0.1.14.BUILD.bazel"),
|
||||||
init_submodules = True,
|
init_submodules = True,
|
||||||
@ -912,6 +913,7 @@ def raze_fetch_remote_crates():
|
|||||||
new_git_repository,
|
new_git_repository,
|
||||||
name = "raze__hyper_timeout__0_3_1",
|
name = "raze__hyper_timeout__0_3_1",
|
||||||
remote = "https://github.com/ankitects/hyper-timeout.git",
|
remote = "https://github.com/ankitects/hyper-timeout.git",
|
||||||
|
shallow_since = "1604362633 +1000",
|
||||||
commit = "f9ef687120d88744c1da50a222e19208b4553503",
|
commit = "f9ef687120d88744c1da50a222e19208b4553503",
|
||||||
build_file = Label("//cargo/remote:hyper-timeout-0.3.1.BUILD.bazel"),
|
build_file = Label("//cargo/remote:hyper-timeout-0.3.1.BUILD.bazel"),
|
||||||
init_submodules = True,
|
init_submodules = True,
|
||||||
@ -1530,6 +1532,7 @@ def raze_fetch_remote_crates():
|
|||||||
new_git_repository,
|
new_git_repository,
|
||||||
name = "raze__prost__0_6_1",
|
name = "raze__prost__0_6_1",
|
||||||
remote = "https://github.com/danburkert/prost.git",
|
remote = "https://github.com/danburkert/prost.git",
|
||||||
|
shallow_since = "1598739849 -0700",
|
||||||
commit = "4ded4a98ef339da0b7babd4efee3fbe8adaf746b",
|
commit = "4ded4a98ef339da0b7babd4efee3fbe8adaf746b",
|
||||||
build_file = Label("//cargo/remote:prost-0.6.1.BUILD.bazel"),
|
build_file = Label("//cargo/remote:prost-0.6.1.BUILD.bazel"),
|
||||||
init_submodules = True,
|
init_submodules = True,
|
||||||
@ -1539,6 +1542,7 @@ def raze_fetch_remote_crates():
|
|||||||
new_git_repository,
|
new_git_repository,
|
||||||
name = "raze__prost_build__0_6_1",
|
name = "raze__prost_build__0_6_1",
|
||||||
remote = "https://github.com/danburkert/prost.git",
|
remote = "https://github.com/danburkert/prost.git",
|
||||||
|
shallow_since = "1598739849 -0700",
|
||||||
commit = "4ded4a98ef339da0b7babd4efee3fbe8adaf746b",
|
commit = "4ded4a98ef339da0b7babd4efee3fbe8adaf746b",
|
||||||
build_file = Label("//cargo/remote:prost-build-0.6.1.BUILD.bazel"),
|
build_file = Label("//cargo/remote:prost-build-0.6.1.BUILD.bazel"),
|
||||||
init_submodules = True,
|
init_submodules = True,
|
||||||
@ -1548,6 +1552,7 @@ def raze_fetch_remote_crates():
|
|||||||
new_git_repository,
|
new_git_repository,
|
||||||
name = "raze__prost_derive__0_6_1",
|
name = "raze__prost_derive__0_6_1",
|
||||||
remote = "https://github.com/danburkert/prost.git",
|
remote = "https://github.com/danburkert/prost.git",
|
||||||
|
shallow_since = "1598739849 -0700",
|
||||||
commit = "4ded4a98ef339da0b7babd4efee3fbe8adaf746b",
|
commit = "4ded4a98ef339da0b7babd4efee3fbe8adaf746b",
|
||||||
build_file = Label("//cargo/remote:prost-derive-0.6.1.BUILD.bazel"),
|
build_file = Label("//cargo/remote:prost-derive-0.6.1.BUILD.bazel"),
|
||||||
init_submodules = True,
|
init_submodules = True,
|
||||||
@ -1557,6 +1562,7 @@ def raze_fetch_remote_crates():
|
|||||||
new_git_repository,
|
new_git_repository,
|
||||||
name = "raze__prost_types__0_6_1",
|
name = "raze__prost_types__0_6_1",
|
||||||
remote = "https://github.com/danburkert/prost.git",
|
remote = "https://github.com/danburkert/prost.git",
|
||||||
|
shallow_since = "1598739849 -0700",
|
||||||
commit = "4ded4a98ef339da0b7babd4efee3fbe8adaf746b",
|
commit = "4ded4a98ef339da0b7babd4efee3fbe8adaf746b",
|
||||||
build_file = Label("//cargo/remote:prost-types-0.6.1.BUILD.bazel"),
|
build_file = Label("//cargo/remote:prost-types-0.6.1.BUILD.bazel"),
|
||||||
init_submodules = True,
|
init_submodules = True,
|
||||||
@ -1716,6 +1722,7 @@ def raze_fetch_remote_crates():
|
|||||||
new_git_repository,
|
new_git_repository,
|
||||||
name = "raze__reqwest__0_10_8",
|
name = "raze__reqwest__0_10_8",
|
||||||
remote = "https://github.com/ankitects/reqwest.git",
|
remote = "https://github.com/ankitects/reqwest.git",
|
||||||
|
shallow_since = "1604362745 +1000",
|
||||||
commit = "eab12efe22f370f386d99c7d90e7a964e85dd071",
|
commit = "eab12efe22f370f386d99c7d90e7a964e85dd071",
|
||||||
build_file = Label("//cargo/remote:reqwest-0.10.8.BUILD.bazel"),
|
build_file = Label("//cargo/remote:reqwest-0.10.8.BUILD.bazel"),
|
||||||
init_submodules = True,
|
init_submodules = True,
|
||||||
@ -2195,6 +2202,7 @@ def raze_fetch_remote_crates():
|
|||||||
new_git_repository,
|
new_git_repository,
|
||||||
name = "raze__tokio_io_timeout__0_4_0",
|
name = "raze__tokio_io_timeout__0_4_0",
|
||||||
remote = "https://github.com/ankitects/tokio-io-timeout.git",
|
remote = "https://github.com/ankitects/tokio-io-timeout.git",
|
||||||
|
shallow_since = "1598411535 +1000",
|
||||||
commit = "96e1358555c49905de89170f2b1102a7d8b6c4c2",
|
commit = "96e1358555c49905de89170f2b1102a7d8b6c4c2",
|
||||||
build_file = Label("//cargo/remote:tokio-io-timeout-0.4.0.BUILD.bazel"),
|
build_file = Label("//cargo/remote:tokio-io-timeout-0.4.0.BUILD.bazel"),
|
||||||
init_submodules = True,
|
init_submodules = True,
|
||||||
|
@ -6,10 +6,32 @@ EXTRA_DEPS = [
|
|||||||
'pyo3 = { version = "0.12.3", features = ["extension-module"] }'
|
'pyo3 = { version = "0.12.3", features = ["extension-module"] }'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# If you get a message like the following during a build:
|
||||||
|
#
|
||||||
|
# DEBUG: Rule 'raze__reqwest__0_10_8' indicated that a canonical reproducible
|
||||||
|
# form can be obtained by modifying arguments shallow_since = "1604362745 +1000"
|
||||||
|
|
||||||
|
# ...then the commit and shallow_since argument should be added below, as this
|
||||||
|
# will remove the debug warning, and speed up the git clone.
|
||||||
|
|
||||||
|
COMMITS_SHALLOW_SINCE = {
|
||||||
|
# reqwest
|
||||||
|
"eab12efe22f370f386d99c7d90e7a964e85dd071": "1604362745 +1000",
|
||||||
|
# hyper-timeout
|
||||||
|
"f9ef687120d88744c1da50a222e19208b4553503": "1604362633 +1000",
|
||||||
|
# tokio-io-timeout
|
||||||
|
"96e1358555c49905de89170f2b1102a7d8b6c4c2": "1598411535 +1000",
|
||||||
|
# prost
|
||||||
|
"4ded4a98ef339da0b7babd4efee3fbe8adaf746b": "1598739849 -0700",
|
||||||
|
# coarsetime
|
||||||
|
"f9e2c86216f0f4803bc75404828318fc206dab29": "1594611111 +1000",
|
||||||
|
}
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import shutil
|
import shutil
|
||||||
|
import re
|
||||||
|
|
||||||
if os.getcwd() != os.path.abspath(os.path.dirname(__file__)):
|
if os.getcwd() != os.path.abspath(os.path.dirname(__file__)):
|
||||||
print("Run this from the cargo/ folder")
|
print("Run this from the cargo/ folder")
|
||||||
@ -31,12 +53,33 @@ with open("../rslib/Cargo.toml") as file:
|
|||||||
|
|
||||||
deps.extend(EXTRA_DEPS)
|
deps.extend(EXTRA_DEPS)
|
||||||
|
|
||||||
|
# write out Cargo.toml
|
||||||
with open("Cargo.toml", "w") as file:
|
with open("Cargo.toml", "w") as file:
|
||||||
file.write(header)
|
file.write(header)
|
||||||
file.write("\n".join(deps))
|
file.write("\n".join(deps))
|
||||||
|
|
||||||
|
# update Cargo.lock
|
||||||
subprocess.run(["cargo", "update"], check=True)
|
subprocess.run(["cargo", "update"], check=True)
|
||||||
|
|
||||||
|
# generate cargo-raze files
|
||||||
if os.path.exists("remote"):
|
if os.path.exists("remote"):
|
||||||
shutil.rmtree("remote")
|
shutil.rmtree("remote")
|
||||||
subprocess.run(["cargo-raze"], check=True)
|
subprocess.run(["cargo-raze"], check=True)
|
||||||
os.remove("Cargo.toml")
|
os.remove("Cargo.toml")
|
||||||
|
|
||||||
|
output_lines = []
|
||||||
|
commit_re = re.compile('\s+commit = "([0-9a-f]+)",')
|
||||||
|
with open("crates.bzl") as file:
|
||||||
|
for line in file.readlines():
|
||||||
|
if match := commit_re.match(line):
|
||||||
|
commit = match.group(1)
|
||||||
|
if commit in line:
|
||||||
|
if since := COMMITS_SHALLOW_SINCE.get(commit):
|
||||||
|
output_lines.append(f' shallow_since = "{since}",\n')
|
||||||
|
else:
|
||||||
|
print(f"{commit} not in COMMITS_SHALLOW_SINCE")
|
||||||
|
output_lines.append(line)
|
||||||
|
|
||||||
|
with open("crates.bzl", "w") as file:
|
||||||
|
for line in output_lines:
|
||||||
|
file.write(line)
|
||||||
|
@ -32,7 +32,7 @@ async-compression = { version = "0.3.5", features = ["stream", "gzip"] }
|
|||||||
blake3 = "0.3.5"
|
blake3 = "0.3.5"
|
||||||
bytes = "0.5.5"
|
bytes = "0.5.5"
|
||||||
chrono = "0.4.13"
|
chrono = "0.4.13"
|
||||||
coarsetime = { git = "https://github.com/ankitects/rust-coarsetime.git", branch="old-mac-compat" }
|
coarsetime = { git = "https://github.com/ankitects/rust-coarsetime.git", tag="anki-2020-11-03" }
|
||||||
failure = "0.1.8"
|
failure = "0.1.8"
|
||||||
flate2 = "1.0.16"
|
flate2 = "1.0.16"
|
||||||
fluent = { git = "https://github.com/ankitects/fluent-rs.git", branch="32bit-panic" }
|
fluent = { git = "https://github.com/ankitects/fluent-rs.git", branch="32bit-panic" }
|
||||||
|
Loading…
Reference in New Issue
Block a user