CLI: don't enable default features in --no-default-features builds#5147
CLI: don't enable default features in --no-default-features builds#5147nicoburns merged 2 commits intoDioxusLabs:mainfrom
--no-default-features builds#5147Conversation
--no-default-features builds--no-default-features builds
|
@jkelleyrtp This is failing CI on the following test: TestHarnessBuilder::new("harness-default-to-non-default")
.deps(r#"dioxus = { workspace = true, features = [] }"#)
.fetr(r#"default=["web"]"#)
.fetr(r#"web=["dioxus/web"]"#)
.asrt(
r#"dx build --ios"#,
|targets| async move {
let t = targets.unwrap();
assert!(t.server.is_none());
assert_eq!(t.client.bundle, BundleFormat::Ios);
assert_eq!(t.client.triple, TestHarnessBuilder::host_ios_triple_sim());
assert!(t.client.no_default_features);
},
),In my mind, the test is wrong because |
The reason we specify no_default_features here is because Passing |
I believe in the current version of the code this happens even without the |
bebee70 to
d0c7335
Compare
|
@jkelleyrtp This is now passing CI, and the following commands in the Dioxus repo all work:
|
Signed-off-by: Nico Burns <nico@nicoburns.com>
d0c7335 to
d1676f7
Compare
ealmloff
left a comment
There was a problem hiding this comment.
This seems the right behavior. The current version has inverted logic for default features. I added a test to prevent regressions like this in the future
dioxuscrate. #5143. Seperate PRs because I'm less sure about this fix.The CLI currently enables "renderless" default features (default features which don't enable a renderer) even when
--no-default-featuresis specified as a command line argument. It also unconditionally set the variable tracking the--no-default-featuresflag to true unless the renderer isUnknown.This PR removes the code modifying the
--no-default-featuresflag, and PR inverts the condition so that default features are enabled in the--no-default-featuresflag is not set.