Skip to content

properly respect rustflags, fix x86-sim issue #4295

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

Merged
merged 4 commits into from
Jun 19, 2025
Merged

Conversation

jkelleyrtp
Copy link
Member

@jkelleyrtp jkelleyrtp commented Jun 19, 2025

Fixes: #4238
Fixes: #4296

Tested:

  • merging of rustflags
  • using .cargo/config
  • using RUSTFLAGS env var
  • hotpatching enabled and hotpatching disabled
// main.rs
use dioxus::prelude::*;

fn main() {
    dioxus::launch(app);
}

fn app() -> Element {
    let mut buf = [0u8; 120];
    getrandom::fill(&mut buf).unwrap();

    rsx! {
        div {
            h1 { "Hello, Dioxus!" }
            p { "This is a simple Dioxus application." }
            pre { "Random bytes: {buf:?}" }
        }
    }
}
# .cargo/config.toml
[target.wasm32-unknown-unknown]
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']

@jkelleyrtp jkelleyrtp requested a review from a team as a code owner June 19, 2025 01:41
@jkelleyrtp jkelleyrtp changed the title properly respect rustflags properly respect rustflags, fix x86-sim issue Jun 19, 2025
@jkelleyrtp jkelleyrtp merged commit 8d5a3a0 into main Jun 19, 2025
18 of 19 checks passed
@jkelleyrtp jkelleyrtp deleted the jk/pass-to-rustflags branch June 19, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid default x86_64 iOS target Subsecond does not respect rustflags cfg settings from .cargo/config.toml (getrandom fails to build)
1 participant