We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
rustflags
./cargo/config.toml
Problem
When having a ./cargo/config.toml file that contains e.g. (commonly used in combination with web-sys)
web-sys
[build] rustflags = ["--cfg=web_sys_unstable_apis"]
and running dx serve, the build fails since it does not consider the specified rustflags. Running cargo build succeeds.
dx serve
cargo build
Steps To Reproduce
Steps to reproduce the behavior:
default_platform = "fullstack"
config.toml
Expected behavior
dx serve should succeed when cargo build does.
Environment:
0.5.4
latest
1.76.0
stable
fullstack
Questionnaire
The text was updated successfully, but these errors were encountered:
@ealmloff pointed me to the following locations of interest where dioxus sets the rustflags:
dioxus/packages/cli/src/builder.rs
Line 116 in 1ec6819
dioxus/packages/cli/src/server/fullstack/mod.rs
Lines 10 to 34 in 1ec6819
The Cargo Book states on build.rustflags:
build.rustflags
There are four mutually exclusive sources of extra flags. They are checked in order, with the first one being used: CARGO_ENCODED_RUSTFLAGS environment variable. RUSTFLAGS environment variable. All matching target.<triple>.rustflags and target.<cfg>.rustflags config entries joined together. build.rustflags config value.
There are four mutually exclusive sources of extra flags. They are checked in order, with the first one being used:
CARGO_ENCODED_RUSTFLAGS
RUSTFLAGS
target.<triple>.rustflags
target.<cfg>.rustflags
So this behavior is not entirely unsurprising.
I don't know of any obvious solution, but one (rather elaborate) approach would be to search the hierarchy for config.toml and read the files in Dioxus itself: https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure.
Sorry, something went wrong.
#2259 seems to be somewhat related.
No branches or pull requests
Problem
When having a
./cargo/config.toml
file that contains e.g. (commonly used in combination withweb-sys
)and running
dx serve
, the build fails since it does not consider the specifiedrustflags
. Runningcargo build
succeeds.Steps To Reproduce
Steps to reproduce the behavior:
default_platform = "fullstack"
.rustflags
inconfig.toml
.dx serve
on a build that depends on specificrustflags
being set.Expected behavior
dx serve
should succeed whencargo build
does.Environment:
0.5.4
,latest
1.76.0
,stable
fullstack
Questionnaire
The text was updated successfully, but these errors were encountered: