Skip to content

Commit 0c229d7

Browse files
alambcomphead
andauthored
Minor: Document the rationale for the lack of Cargo.lock (#14071)
* Minor: Document the rationale for the lack of Cargo.lock * Update README.md --------- Co-authored-by: Oleks V <comphead@users.noreply.github.com>
1 parent 80d3131 commit 0c229d7

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,27 @@ stable API, we also improve the API over time. As a result, we typically
146146
deprecate methods before removing them, according to the [deprecation guidelines].
147147

148148
[deprecation guidelines]: https://datafusion.apache.org/library-user-guide/api-health.html
149+
150+
## Dependencies and a `Cargo.lock`
151+
152+
`datafusion` is intended for use as a library and thus purposely does not have a
153+
`Cargo.lock` file checked in. You can read more about the distinction in the
154+
[Cargo book].
155+
156+
CI tests always run against the latest compatible versions of all dependencies
157+
(the equivalent of doing `cargo update`), as suggested in the [Cargo CI guide]
158+
and we rely on Dependabot for other upgrades. This strategy has two problems
159+
that occasionally arise:
160+
161+
1. CI failures when downstream libraries upgrade in some non compatible way
162+
2. Local development builds that fail when DataFusion inadvertently relies on
163+
a feature in a newer version of a dependency than declared in `Cargo.toml`
164+
(e.g. a new method is added to a trait that we use).
165+
166+
However, we think the current strategy is the best tradeoff between maintenance
167+
overhead and user experience and ensures DataFusion always works with the latest
168+
compatible versions of all dependencies. If you encounter either of these
169+
problems, please open an issue or PR.
170+
171+
[cargo book]: https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
172+
[cargo ci guide]: https://doc.rust-lang.org/cargo/guide/continuous-integration.html#verifying-latest-dependencies

datafusion-cli/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ The reason `datafusion-cli` is not part of the main workspace in
4141
checked in `Cargo.lock` file to ensure reproducible builds.
4242

4343
However, the `datafusion` and sub crates are intended for use as libraries and
44-
thus do not have a `Cargo.lock` file checked in.
44+
thus do not have a `Cargo.lock` file checked in, as described in the [main
45+
README] file.
4546

4647
[`datafusion cargo.toml`]: https://github.com/apache/datafusion/blob/main/Cargo.toml
48+
[main readme]: ../README.md

0 commit comments

Comments
 (0)