Comments (12)
I don't think there's solution to this right now. Cargokit takes care of installing whichever toolchain the package requires. Your config basically breaks stable toolchain, which is not expected. Not sure what the best way of handling this would be.
from cargokit.
Fixed with an edit to one of the answers in the other issue. Kindly pardon the noise.
TLDR; I added rust/cargokit.yaml
to the project generated by flutter_rust_bridge_codegen create
:
cargo:
debug:
toolchain: nightly
release:
toolchain: nightly
from cargokit.
Right. That will work if you're in charge of the package. But if you're using somebody else's package that might still be trying to get build with stable.
from cargokit.
That is a severe limitation.
from cargokit.
Well, the config file basically breaks stable toolchain. It's a bit unexpected :)
from cargokit.
Well, the config file basically breaks stable toolchain. It's a bit unexpected :)
I would say it's more unexpected that you can't configure your project's local toolchain any more with rustup
.
The usefullness of this can't be overstated. Want to use unstable feature (e.g. let
chains)? Use nightly
. Hit a compiler bug with latest nightly
? Lock the toolchain to a previous last-known-good version by date. Etc.
This often includes stuff triggere/required by dependencies.
Not having control over this is just a bummer. And I mean that in a very caring way.
from cargokit.
If you want to use certain feature that means you are in charge of the code. For that you can use cargokit.yaml
to force the plugin to compile with nightly. The idea here is that plugin author knows best which toolchain the plugin needs to build.
What your setting does is that it injects nightly flag to every cargo invocation.
from cargokit.
I was mainly referring to this:
Right. That will work if you're in charge of the package. But if you're using somebody else's package that might still be trying to get build with stable.
Rust developers are used to control exactly what tool chain gets used to compile anything Rust, including dependencies they aren't the author of.
Maybe I misunderstand but I read this as: if you use cargokit
, this assumption does not hold any more.
Furthermore, rustup override
is called override
for a reason. It overrides the default.
The 'certain feature' was an example. There are other reasons to force a specific toolchain version.
Consider this case instead: package I don't maintain but depend on uses nightly
and breaks (compiler bug). In a normal Rust project I can force the toolchain to something that allows me to keep working. Uninterrupted, apart from the time it takes to d/l the resp. toolchain.
In this case however, I need to fork the resp. dependency and edit the cargokit.yaml
of that dependency. And remember that ofc.
That reminds me of dependency management in my C++ days.
I guess I'm saying: there are quite a few well-founded reasons why rustup
works the way it does. Not just the two I brought up OTOMH here.
from cargokit.
Cargokit is primary meant to be used for plugin creators to write plugins in Rust that seamlessly build as part of Flutter build process. The assumption is that vast majority of target users might not even know what a toolchain is. In which case Cargokit will configure the toolchains, targets and choose the default toolchain depending on what each plugin requires.
It doesn't take into account that user have global rustc flags set that break stable rust. You have a situation on your machine where rustup run stable <anything>
fails, which is not expected. If you have a proposed solution that will make this work while letting plugin authors specify which toolchain to use I'll be interested to hear about it.
from cargokit.
If you have a proposed solution that will make this work while letting plugin authors specify which toolchain to use I'll be interested to hear about it.
It's tricky because the idea that the toolchain is specified for a dependency and the user of the dependency has no way to override that (w/o jumping through aforementioned hoops) is kinda weird for Rust folk.
But since there is one explicitly specified, in cargokit.yaml
, I would go for an in-between solutiuon. One that doesn't break/change what you have at the moment but allows people like me to override. Specifically:
-
Read
~/.rustup/settings.toml
. -
If the toolchain specified in
default_toolchain
differs from the one used for the current project or any dependency, print a warning like:Using Rust toolchain `stable` from `cargokit.yaml` but active default toolchain from `rustup` is `stable-2023-12-31`
This will already make what happend to me with my
cargo
config'snightly
-only flags less of a surprise. And contains a hint where to change this.Or for a dependency:
Using Rust toolchain `beta` from `cargokit.yaml` for depdendency `foo` but active default toolchain from `rustup` is `stable-2023-12-31`
-
If the current project is specified in the
[overrides]
section of~/.rustup/settings.toml
, read this as: "the user really wants an overrride" and use it, i.e. ignore whatever toolchains anycargokit.yaml
s (incl. dependencies) this project depends on contains.Also print a warning like:
Using Rust toolchain override `nightly-2024-04-01` from `rustup` and ignoring any toolchains set via `cargokit.yaml` for this project and all dependencies.
Does that make sense?
from cargokit.
rust stable
on one machine may not be the same stable
on another.
from cargokit.
That's another good point why the idea of enforcing/assuming stable
, as cargokit
currently does, is fundamentally flawed.
from cargokit.
Related Issues (20)
- Can Rust breakpoints work when linked to the Flutter app? HOT 2
- Build fails if esp rustup toolchains (rust for ESP32) is installed HOT 1
- Rust compiler errors hidden in `flutter run` HOT 1
- Missing debug symbols for Android HOT 2
- Add config option to disable certain target architectures HOT 3
- Cargokit error in MacOS HOT 2
- External command fails, but works fine after running it manually HOT 1
- Allow overriding URL prefix and public key in cargokit_options.yaml
- shasum: command not found HOT 2
- Cmake cannot find NDK on MacOS HOT 1
- Can we link `libc++` to Android apps?
- iOS podspec affects Android build HOT 3
- Sentry plugin fails with cargokit issue HOT 1
- Xcode Library setting clear (reset) by cargokit
- Precompiled builds HOT 3
- failing to build a flutter_rust_bridge_codegen app for android under fedora (can not find crate core) HOT 1
- No such file or directory in run_build_tool.sh
- Flutter, Android, rinf, Cargokit, Rust, C: Problem loading ndk standard C++ library HOT 7
- The iOS bundle is too big
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargokit.