Skip to content

Conversation

debanjanbasu
Copy link
Contributor

With the latest rustc nightly, I'm getting this error due to a dependency on swc_ecma_utils - v7.0.0. Did the basic upgrade, but then had to upgrade other dependencies as well. No functional, or tests have been changed.

The following error is being produced:

error[E0391]: cycle detected when optimizing MIR for `ExprExt::cast_to_bool`
   --> /Users/M061230/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/swc_ecma_utils-7.0.0/src/lib.rs:742:5
    |
742 |     fn cast_to_bool(&self, ctx: &ExprCtx) -> (Purity, BoolValue) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: ...which requires optimizing MIR for `ExprExt::cast_to_number`...
   --> /Users/M061230/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/swc_ecma_utils-7.0.0/src/lib.rs:970:5
    |
970 |     fn cast_to_number(&self, ctx: &ExprCtx) -> (Purity, Value<f64>) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: ...which again requires optimizing MIR for `ExprExt::cast_to_bool`, completing the cycle
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information

For more information about this error, try `rustc --explain E0391`.
error: could not compile `swc_ecma_utils` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `dioxus-cli v0.7.0-alpha.2 (https://github.com/debanjanbasu/dioxus#a66bffb4)`, intermediate artifacts can be found at `/var/folders/7t/5wm_b7ys4670lt80c63q_wbc0000gp/T/cargo-install0CfVzO`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

@debanjanbasu debanjanbasu requested a review from a team as a code owner July 4, 2025 03:51
Copy link
Contributor

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wgpu version needs to go back down. Otherwise looks reasonable to me.

@andrewliu1345
Copy link

@debanjanbasu 您好,#4363的依赖问题目前进展如何?大概多久能解决呢?谢谢!

@debanjanbasu
Copy link
Contributor Author

@debanjanbasu 您好,#4363的依赖问题目前进展如何?大概多久能解决呢?谢谢!

Done all the changes requested. Need approval and merge mate ☝️.

@debanjanbasu debanjanbasu requested a review from nicoburns July 7, 2025 06:09
@debanjanbasu
Copy link
Contributor Author

debanjanbasu commented Jul 7, 2025

@ealmloff - while running some tests...

cargo test --lib --bins --tests --examples --workspace

I'm getting this:

error[E0277]: the trait bound `StandardUniform: Distribution<usize>` is not satisfied
   --> packages/core/tests/fuzzing.rs:242:37
    |
242 |     let node = match rand::random::<usize>() % range {
    |                                     ^^^^^ the trait `Distribution<usize>` is not implemented for `StandardUniform`
    |
    = help: the following other types implement trait `Distribution<T>`:
              `StandardUniform` implements `Distribution<()>`
              `StandardUniform` implements `Distribution<(A, B)>`
              `StandardUniform` implements `Distribution<(A, B, C)>`
              `StandardUniform` implements `Distribution<(A, B, C, D)>`
              `StandardUniform` implements `Distribution<(A, B, C, D, E)>`
              `StandardUniform` implements `Distribution<(A, B, C, D, E, F)>`
              `StandardUniform` implements `Distribution<(A, B, C, D, E, F, G)>`
              `StandardUniform` implements `Distribution<(A, B, C, D, E, F, G, H)>`
            and 31 others

Any advice?

I've made it u8 from usize, which should technically work, but maybe in certain cases you want to generate a really large number? Can do u128?

@ealmloff
Copy link
Member

ealmloff commented Jul 7, 2025

@ealmloff - while running some tests...

cargo test --lib --bins --tests --examples --workspace

I'm getting this:

error[E0277]: the trait bound `StandardUniform: Distribution<usize>` is not satisfied
   --> packages/core/tests/fuzzing.rs:242:37
    |
242 |     let node = match rand::random::<usize>() % range {
    |                                     ^^^^^ the trait `Distribution<usize>` is not implemented for `StandardUniform`
    |
    = help: the following other types implement trait `Distribution<T>`:
              `StandardUniform` implements `Distribution<()>`
              `StandardUniform` implements `Distribution<(A, B)>`
              `StandardUniform` implements `Distribution<(A, B, C)>`
              `StandardUniform` implements `Distribution<(A, B, C, D)>`
              `StandardUniform` implements `Distribution<(A, B, C, D, E)>`
              `StandardUniform` implements `Distribution<(A, B, C, D, E, F)>`
              `StandardUniform` implements `Distribution<(A, B, C, D, E, F, G)>`
              `StandardUniform` implements `Distribution<(A, B, C, D, E, F, G, H)>`
            and 31 others

Any advice?

I've made it u8 from usize, which should technically work, but maybe in certain cases you want to generate a really large number? Can do u128?

It just needs to be a random number more than the mod range. u8 works, it might result in a more interesting distribution because there is a higher chance text nodes don't change between diffs

@debanjanbasu
Copy link
Contributor Author

@ealmloff / @nicoburns - found the issues with the wgpu example, and the jsframework. Fixes have been pushed 🙏. Up for review again... apologies for the trouble.

@debanjanbasu
Copy link
Contributor Author

Fixed the issues with CI, clippy tests should pass now.

@debanjanbasu
Copy link
Contributor Author

Any updates to this one ?🙏

Copy link
Member

@ealmloff ealmloff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were a few unused swc dependencies after the update and a dependency updated in CI. The rest of these changes look good. Thanks!

@ealmloff ealmloff enabled auto-merge (squash) July 10, 2025 14:19
@jkelleyrtp jkelleyrtp disabled auto-merge July 14, 2025 20:03
@jkelleyrtp jkelleyrtp merged commit c5b3392 into DioxusLabs:main Jul 14, 2025
20 checks passed
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.

5 participants