Skip to content

Commit 07b4149

Browse files
authored
Update ndc-spec to get the build working. (#111)
### What ndc-spec v0.1.0-rc.8 uses workspace inheritance to set the version and edition, which unfortunately does not work with Crane for Nix (when using Git targets). I have inlined the version and edition to solve this, but we also need to release a new version of ndc-spec and update ndc-sdk. Until that happens, let's just override it (transitively) using `patch` in _Cargo.toml_. ### How [`[patch."..."]`, in _Cargo.toml_](https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section), allows us to hijack a dependency and point it somewhere else. Unlike just setting the version, this works transitively, so it will also update ndc-sdk. This is important because it's the dependency build step which fails in Crane, so we need to ensure we have no reference to the previous version. Unfortunately, there's an open bug in Cargo which means that [patch overrides can't use the same Git repository](rust-lang/cargo#10756), even if the commit reference is different. We work around this by adding an extra "/" to trick Cargo into thinking it's a different repository.
1 parent 24033b1 commit 07b4149

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ members = [
1515
"crates/tests/other-db-tests",
1616
"crates/tests/tests-common"
1717
]
18+
19+
# Temporary patch to get the build working. We shall remove this once a new
20+
# version of ndc-spec is published, and ndc-sdk is updated accordingly.
21+
# The "//" is to convince Cargo to accept this, due to
22+
# https://github.com/rust-lang/cargo/issues/10756 .
23+
[patch."https://github.com/hasura/ndc-spec.git"]
24+
ndc-client = { git = "https://github.com/hasura//ndc-spec.git", rev = "3778605" }
25+
ndc-test = { git = "https://github.com/hasura//ndc-spec.git", rev = "3778605" }

0 commit comments

Comments
 (0)