Constrain tract to <0.21.7 so libDF compiles - #703
Open
svaningelgem wants to merge 1 commit into
Open
Conversation
libDF requests tract-core = "^0.21.4" and uses ndarray ^0.15, but tract-data
switched from ndarray ^0.15.3 to ^0.16 in 0.21.7. Cargo therefore resolves a
fresh build to 0.21.17 today, and libDF/src/tract.rs no longer compiles:
error[E0308]: mismatched types
--> libDF/src/tract.rs:443:30
|
443 | let ch = spec.len_of(Axis(0));
| ------ ^^^^^^^ expected `tract_core::ndarray::Axis`,
| found `ndarray::Axis`
with the same error at tract.rs:446 and :535. Its own Axis and tract's
re-exported one are two unrelated types.
This is the minimal fix: hold tract on the ndarray-0.15 side of the split so
`cargo build --features tract` works again. Verified on Windows with
tract-core 0.21.4.
Bumping libDF to ndarray 0.16 would be the more forward-looking change and
would let tract move on, but it touches transforms.rs and dataset.rs as well,
so it seemed better to leave that choice to you than to bundle it here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cargo build --features tractdoes not compile on a fresh checkout today.libDF/Cargo.tomlasks fortract-core = "^0.21.4"and usesndarray ^0.15. Buttract-dataswitched fromndarray ^0.15.3to^0.16in 0.21.7, so cargo resolves to 0.21.17 and the twoAxistypes stop being the same type:Same at
tract.rs:446andtract.rs:535.Where the boundary is, from the published metadata:
^0.15.3^0.15.3^0.16^0.16This PR is the minimal fix — hold tract on the ndarray-0.15 side so the build works again. Verified on Windows:
cargo build --features tract --no-default-featuresnow compiles, picking tract-core 0.21.4.Bumping libDF to
ndarray 0.16instead would be the more forward-looking change, and would let tract move on rather than pinning it back. It touchestransforms.rsanddataset.rstoo, though, so it seemed better to leave that call to you than to bundle it in here. Happy to do that version instead if you prefer.Found while exporting DeepFilterNet3 to ONNX and running it through your tract runner — which, once it compiles, works very well. Thanks for the model.