Closed ryanhossain9797 closed 9 months ago
Right. This is a bug. Cargokit should install stable if missing, just as it installs nightly if required and missing. Cargokit will by default use stable toolchain, unless specified differently inside the cargokit.yaml
file (which can be put alongside Cargo.toml
). You can see example cargokit.yaml
here:
It allows you set different toolchain for debug and release builds. In this case super_native_extensions needs nightly for release build because it builds the whole std (to get smaller binaries with panic=abort).
Now the question is, whether we should ensure that stable
toolchain is installed when building with stable, or detect that it is missing and just build with nightly in that case.
Actually, this should be already done. Stable toolchain should be installed automatically.
If you can provide reproducible steps (including rustup installation) I will take a look. Cargokit should install all required toolchains and targets (and components), and if it fails to it needs to be fixed.
Actually, this should be already done. Stable toolchain should be installed automatically.
It is installed automatically. But is that the desired behavior? What if my rust code depends on nightly?
If your crate depends on nightly, then you can put cargokit.yaml
file next to Cargo.toml
and tell cargokit to use nightly when building the plugin. The user should not be concerned with which toolchain the flutter plugin needs.
If your crate depends on nightly, then you can put
cargokit.yaml
file next toCargo.toml
and tell cargokit to use nightly when building the plugin. The use should not be concerned with which toolchain the flutter plugin needs.
I see. Thanks that should be sufficient.
But I think the problem is that all rustup commands right now don't specify the channel. Though for some reason when installing target for stable rust this target can then be used for nightly build, which is bit weird, but it doesn't seem to work the other way around? Still needs to be fixed though.
Cargokit is used by Rust In Flutter: https://github.com/cunarist/rust-in-flutter There is an ongoing issue there regarding this https://github.com/cunarist/rust-in-flutter/issues/147
Basically it seems like even is the default toolchain is set to nightly, stable is being automatically set up and used.