@@ -622,15 +622,19 @@ is here to stay.
622
622
623
623
## The challenge and cachi2 boundaries
624
624
625
- Building projects that do DIRECTLY depend on both rust and python should be straighforward and
626
- similar to build with pip and cargo independently. The challenge comes with indirect rust
627
- dependencies. For instance, when you project is "pure python" but have dependencies that rely on
628
- rust.
625
+ Building projects that do DIRECTLY depend on both rust and python should be straightforward and
626
+ similar to build with pip and cargo independently. The developers of those projects can easily
627
+ have ` requirements.txt ` , ` Cargo.lock ` , etc readily available to them and have full control of
628
+ how to build their own software. The challenge comes with indirect rust dependencies. For instance,
629
+ when your project is "pure python" but have dependencies that rely on rust (like cryptography).
629
630
630
631
In this scenario, cargo vendor won't help unless you have all sources available. Also, users don't
631
632
have a way to explicitly declare those dependencies, and, henceforth, aren't necessarily doing
632
633
reproducible builds.
633
634
635
+ Another issue is how to configure cargo, something those developers are not even calling directly -
636
+ that will be made by the python build backend (hopefully ` maturin ` or ` setuptools-rust ` ).
637
+
634
638
In the following sections we are going to expose a bit of how ` maturin ` and ` setuptools-rust ` are
635
639
configured in order to come with ideas on how to tackle the problem of FINDING rust dependencies
636
640
on a pure-python project. This is probably outside of the scope of cachi2, but we will need to at
@@ -823,13 +827,17 @@ RUN source /tmp/cachi2.env && \
823
827
824
828
### Limitations
825
829
826
- - the process likely won't work with python packages lacking Cargo.lock.
830
+ - The process likely won't work with python packages lacking Cargo.lock.
827
831
- Interestingly, while inspecting some projects relying on maturin I saw many that didn't have a
828
832
Cargo.lock BUT their sources uploaded to pypi actually HAD those. I couldn't find in maturin
829
833
documentation if this is a behavior we could rely upon. Example library with this behavior:
830
834
[ css-inline] [ css-inline-github ]
831
835
- this might represent a risk for dependencies pointing to git sources instead of pypi/crates.io
832
-
836
+ - This approach might work well for setuptools-rust and maturin - and might work for some new tool
837
+ that resorts to invoke ` cargo ` at some point, but it won't work if a completely alien approach is
838
+ created.
839
+ - OTOH, that's not a problem for fetching dependencies, only for actually building the project.
840
+ Given this is only a big IF, this is probably fine.
833
841
834
842
<!-- REFERENCES -->
835
843
0 commit comments