-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to disable default features in Wasmtime dependencies #189
Comments
One important thing to note as well here is that Cargo unions dependencies for crates, and by default all dependency edges enable the FWIW this practically means that heavily depended on crates (those with a good number of incoming dependency edges) are very difficult to disable default features. If that's the case it may best to not actually enable any architectures by default in cranelift-codegen and instead allow top-level projects to specify. (and perhaps having a feature for I think overall there's two possible solutions here:
|
@alexcrichton There might be a third option. My intuition tells me that it is not a good one, but I can't put my finger on why. Maybe you could clarify this. We could write a |
Ah unfortunately I don't think that would be possible because |
Option 2 seems like the ideal way forward (from our point of view, at least); it would definitely simplify things for us. I think it also fits better with Rust's idea that "features should be additive". Plus, I can imagine at least some other projects would be interested in running only on specific architectures. |
@mbestavros |
While Cranelift has basic risc-v support, it is nowhere near complete enough to be usable with Wasmtime. |
This has been fixed by bytecodealliance/cranelift#853, right? |
I believe so; and the crate and feature structure has changed so much in the past five years anyway that any current problems can have new issues filed. |
I am interested in building Wasmtime against a Cranelift with all architectures disabled except for the target architecture.
From my research, it seems that the way to accomplish this would be to re-export the desired architecture feature in Wasmtime's
cargo.toml
:riscv = ["cranelift-codegen/riscv"]
(For reference, the feature belongs to
cranelift-codegen
, whose features can be found in itscargo.toml
file.)However,
cranelift-codegen
's default configuration enables all architectures to begin with, so in order to re-apply only the desired one, I would need to disable the default features in Cranelift and then enable only the desired one by re-exporting the feature, as outlined above.The Rust-official method to accomplish this is to use the
--no-default-features
flag, as outlined here. However, as I discovered today, the Wasmtime repository is set up as a workspace (rather than a package), and the flag is non-functional on workspaces -- it only works on packages.cranelift-codegen
is not a workspace by itself, so I also tried using the inlinedefault-features = false
option (example of that here); however, that didn't seem to work either.Given this seems to be an upstream issue, I was wondering if there would be any guidance around this at all.
The text was updated successfully, but these errors were encountered: