Remove all default architecture support in cranelift-codegen to allow dependencies fine-grained control#853
Conversation
|
You can check that at least one of the archs is enabled in build.rs |
|
Interesting: having looked at If |
be3698a to
ca03608
Compare
|
Having taken another look at I think the conversation comes back to whether we want |
|
I think either way is basically ok. I kind of like a panic, but compiling for the native host is going to be a common use case, so it's not a bad thing if it's convenient to do that. |
ca03608 to
503e0cc
Compare
|
@sunfishcode, amended that comment. If you see no issues with figuring out architecture support in It may be worth mentioning that code has probably never been run, since the existing default configuration prevented an empty architecture set (and the consequent architecture derivation) in all cases. Not sure if that's a concern or not, but maybe worth noting. |
|
@sunfishcode, bump -- any other thoughts on this? |
|
Hi, Spidermonkey hacker here (I think Dan is away for a few days). We've been using Have you tried this? If that's the thing that didn't work, have you tried making sure that features were not getting re-enabled by other cranelift crates? Or are you saying that the sane default would be to have no arch at all, and that arch support should be opt-in? I think I like this better, if that's the case, and agree with this PR. |
|
I had a heck of a time trying to get Your last paragraph is more or less the gist of what Dan and my team were discussing; given the small number of projects (and the scope of those projects) likely to depend on Cranelift, it's not too much of an ask for them to specify exactly which architectures they want to support. That's what I was implementing here. |
|
Great, then 👍. |
|
@sunfishcode -- is there anything else outstanding blocking this? |
|
@mbestavros Note this breaks CI testing, can you have a look, please? |
|
@bnjbvr Looks like like the Travis tests don't account for the new feature -- the failures all throw an error around "no ARM support". This makes sense, given there is now no architecture support at all by default with this PR. The quick fix would be to invoke the |
|
Could the top-level Cargo.toml (the one that controls the binary programs) enable all features by default? That'd be useful for using the clif-util too, and would fix CI. |
|
@bnjbvr That's the current behavior; this PR is specifically designed to change it. See the original PR comment for details. |
|
@mbestavros I am not entirely sure we're talking about the same thing: this commit updates |
|
@bnjbvr Ah, I see what you mean now -- apologies. That makes sense. I'll try making that change now. |
503e0cc to
c855e29
Compare
c855e29 to
ddf7589
Compare
|
Nice, thanks. Testing actually passed on MacOS, but failed because of caching issues (initially on Linux, eventually on MacOS), so I've restarted the build. |
This is a small patch for an issue originally brought up over on the Wasmtime repository: bytecodealliance/wasmtime#189
In a nutshell,
cranelift-codegenhad enabled all architecture support in itsdefaultfeature, and, for one reason or another, it's very difficult to disable thedefaultfeature from within Wasmtime. This makes it hard for projects that want to pick and choose which architectures they want Wasmtime to build for.As a result, the solution pitched was to remove all architecture support from the
defaultfeature and allow dependencies to enable the exact architecture support they wanted. That's what this patch hopes to achieve.For ease of use, there is a new
all-archfeature included that enables all architecture support -- just ascranelift-codegenbehaved before.One possible area for improvement: this code does not currently enforce that at least one of the architectures must be enabled. I briefly looked into using
required-features, but it seems like that wouldn't apply here. I couldn't find other solutions that might work, but I'm open to suggestions if I missed something obvious.Tagging @npmccallum, @alexcrichton, @sunfishcode, @steveej for review.