-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Cargo has an unstable feature that allow a crate to have a dependency on binary targets of another crate, allowing the dependency to be built for another target. https://doc.rust-lang.org/cargo/reference/unstable.html#artifact-dependencies
The point is to allow publishing of this repo's crates to crates.io and permit installation using cargo install.
I just tried using that new feature (see branch https://github.com/Gui-Yom/turbo-metrics/tree/bindeps) to replace the current hack with nvptx-builder. I think the feature if great but it is too damn early as it makes a lot of workflows break (like cargo publish and cargo install).
- No need for the brittle
nvptx-builderanymore - Requires nightly for the whole workspace (instead of just the kernels) and a
-Z bindeps - My IDE seems to support it (RustRover)
crates.iosupports the manifest extension, allowing crates to be published.- The verify step in
cargo publishbreaks the environment variables that are supposed to be set for finding artifacts (https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/artifact.rs). I think that's because the verify step changes the name of dependencies by appending the crate hash, causing theCARGO_CDYLIB_FILE_{}to not be set. - Using
cargo install <from crates.io>does not work because the dependencies of artifact dependencies (in this casenvptx-stdare not built with the right target.cargo installfrom the workspace dir does work though.
The bindeps feature seems promising but right now it does not fix more problems than simply using nvptx-builder. I should revisit this in a moment.