Skip to content
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

Cannot compile xilem lib #189

Closed
lokxii opened this issue Mar 15, 2024 · 9 comments · Fixed by #190
Closed

Cannot compile xilem lib #189

lokxii opened this issue Mar 15, 2024 · 9 comments · Fixed by #190

Comments

@lokxii
Copy link

lokxii commented Mar 15, 2024

I just created a new cargo project, and included xilem as dependency by specifying git repo to this repo. I then run cargo build and get the following result

└─▶ cargo build
    Blocking waiting for file lock on package cache
    Updating git repository `https://github.com/linebender/xilem.git`
    Updating crates.io index
    Updating git repository `https://github.com/dfrg/parley`
    Updating git repository `https://github.com/linebender/vello`
    Updating git repository `https://github.com/gfx-rs/wgpu.git`
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.153
   Compiling cfg_aliases v0.1.1
   Compiling autocfg v1.1.0
   Compiling smallvec v1.13.1
   Compiling num-traits v0.2.18
   Compiling arrayvec v0.7.4
   Compiling bitflags v2.4.2
   Compiling cfg-if v1.0.0
   Compiling lock_api v0.4.11
   Compiling quote v1.0.35
   Compiling cc v1.0.90
   Compiling syn v2.0.52
   Compiling core-foundation-sys v0.8.6
   Compiling parking_lot_core v0.9.9
   Compiling core-foundation v0.9.4
   Compiling foreign-types-shared v0.3.1
   Compiling log v0.4.21
   Compiling scopeguard v1.2.0
   Compiling bitflags v1.3.2
   Compiling thiserror v1.0.58
   Compiling core-graphics-types v0.1.3
   Compiling paste v1.0.14
   Compiling objc_exception v0.1.2
   Compiling once_cell v1.19.0
   Compiling unicode-width v0.1.11
   Compiling bit-vec v0.6.3
   Compiling hashbrown v0.14.3
   Compiling equivalent v1.0.1
   Compiling termcolor v1.4.1
   Compiling codespan-reporting v0.11.1
   Compiling indexmap v2.2.5
   Compiling bit-set v0.5.3
   Compiling parking_lot v0.12.1
   Compiling malloc_buf v0.0.6
   Compiling unicode-xid v0.2.4
   Compiling rustc-hash v1.1.0
   Compiling hexf-parse v0.2.1
   Compiling block v0.1.6
   Compiling raw-window-handle v0.6.0
   Compiling libloading v0.8.3
   Compiling profiling v1.0.15
   Compiling font-types v0.4.3
   Compiling objc-sys v0.3.2
   Compiling wgpu-hal v0.19.3
   Compiling block-sys v0.2.1
   Compiling wgpu-types v0.19.2
   Compiling kurbo v0.11.0
   Compiling wgpu-hal v0.19.0 (https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d0454)
   Compiling wgpu-core v0.19.3
   Compiling objc2-encode v3.0.0
   Compiling objc v0.2.7
   Compiling version_check v0.9.4
   Compiling objc2 v0.4.1
   Compiling peniko v0.1.0
   Compiling slotmap v1.0.7
   Compiling read-fonts v0.15.6
   Compiling euclid v0.22.9
   Compiling foreign-types-macros v0.2.3
   Compiling foreign-types v0.5.0
   Compiling thiserror-impl v1.0.58
   Compiling metal v0.27.0
   Compiling bytemuck_derive v1.6.0
   Compiling naga v0.19.2
   Compiling naga v0.19.0 (https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d0454)
   Compiling wgpu-types v0.19.0 (https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d0454)
   Compiling wgpu v0.19.3
   Compiling wgpu-core v0.19.0 (https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d0454)
   Compiling litrs v0.4.1
   Compiling static_assertions v1.1.0
   Compiling svg_fmt v0.4.2
   Compiling guillotiere v0.6.2
   Compiling document-features v0.2.8
   Compiling skrifa v0.15.5
   Compiling bytemuck v1.15.0
   Compiling block2 v0.3.0
   Compiling read-fonts v0.16.0
   Compiling wgpu v0.19.0 (https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d0454)
   Compiling winit v0.29.15
   Compiling pin-project-lite v0.2.13
   Compiling yazi v0.1.6
   Compiling zeno v0.2.3
   Compiling futures-core v0.3.30
   Compiling dispatch v0.2.0
   Compiling icrate v0.0.4
   Compiling swash v0.1.13
   Compiling futures-intrusive v0.5.0
   Compiling vello_encoding v0.1.0 (https://github.com/linebender/vello?rev=6fa114c020f8656947e283bdf4bed96fe7a54c70#6fa114c0)
   Compiling core-graphics v0.23.1
   Compiling tracing-attributes v0.1.27
   Compiling tokio-macros v2.2.0
   Compiling tracing-core v0.1.32
   Compiling socket2 v0.5.6
   Compiling num_cpus v1.16.0
   Compiling mio v0.8.11
   Compiling signal-hook-registry v1.4.1
   Compiling raw-window-handle v0.5.2
   Compiling smol_str v0.2.1
   Compiling cursor-icon v1.1.0
   Compiling grid v0.13.0
   Compiling bytes v1.5.0
   Compiling taffy v0.4.0
   Compiling tokio v1.36.0
   Compiling tracing v0.1.40
   Compiling parley v0.0.1 (https://github.com/dfrg/parley?rev=1940d1ae9f2a9b44b7c18967147ffa7d345fdafd#1940d1ae)
   Compiling vello v0.0.1 (https://github.com/linebender/vello?rev=6fa114c020f8656947e283bdf4bed96fe7a54c70#6fa114c0)
   Compiling instant v0.1.12
   Compiling futures-task v0.3.30


   Compiling xilem_core v0.1.0 (https://github.com/linebender/xilem.git#50d51fad)
   Compiling fnv v1.0.7
   Compiling xilem v0.1.0 (https://github.com/linebender/xilem.git#50d51fad)
error[E0308]: mismatched types
    --> /Users/austinsiu/.cargo/git/checkouts/xilem-031d790027f85a11/50d51fa/src/app_main.rs:237:21
     |
237  |         device.poll(wgpu::Maintain::Wait);
     |                ---- ^^^^^^^^^^^^^^^^^^^^ expected `Maintain<SubmissionIndex>`, found `MaintainBase<SubmissionIndex>`
     |                |
     |                arguments to this method are incorrect
     |
     = note: `MaintainBase<SubmissionIndex>` and `wgpu_types::Maintain<wgpu::SubmissionIndex>` have similar names, but are actually distinct types
note: `MaintainBase<SubmissionIndex>` is defined in crate `wgpu_types`
    --> /Users/austinsiu/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/2d8d045/wgpu-types/src/lib.rs:4406:1
     |
4406 | pub enum Maintain<T> {
     | ^^^^^^^^^^^^^^^^^^^^
note: `wgpu_types::Maintain<wgpu::SubmissionIndex>` is defined in crate `wgpu_types`
    --> /Users/austinsiu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-types-0.19.2/src/lib.rs:4287:1
     |
4287 | pub enum Maintain<T> {
     | ^^^^^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `wgpu_types` are being used?
note: method defined here
    --> /Users/austinsiu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.3/src/lib.rs:2305:12
     |
2305 |     pub fn poll(&self, maintain: Maintain) -> MaintainResult {
     |            ^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `xilem` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...

I can see there are two versions of wgpu (0.19.0 and 0.19.3) being compiled. how can i only choose to compile the correct one (which one?)?

@lokxii
Copy link
Author

lokxii commented Mar 15, 2024

I bet this is related to #179?

@DJMcNab
Copy link
Member

DJMcNab commented Mar 15, 2024

Can you please include:

[patch.crates-io]
wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "2d8d045453855f6594c42a6988692253da195323"}

in your Cargo.toml? This was added in #177, because of a critical issue in wgpu for @Philipp-M.
This will be removed at the latest by the end of April 2024, after the next wgpu release.

Development zone:
Philipp: Is there an upstream wgpu issue corresponding with this? I've not seen it linked, at least not in the GitHub discussion. If it is wider than just impacting you, then it's reasonable to have. But in that case wgpu should be releasing a new version, consequences be .
@xorgy: We discussed backing out from requiring this patch - I still think we should do so. I think this explains the issue you were seeing on Wednesday, as well. Are you willing to only apply it locally, Philipp?

@waywardmonkeys
Copy link
Contributor

Yes, it is. Xilem has a git dep on wgpu:

# vello currently depends on wgpu 0.19.3, but a fix for a hang on NVIDIA Vk drivers will be postponed

@Philipp-M
Copy link
Contributor

Philipp: Is there an upstream wgpu issue corresponding with this? I've not seen it linked, at least not in the GitHub discussion.

There is: gfx-rs/wgpu#4775

And there were some discussion about that issue:
https://xi.zulipchat.com/#narrow/stream/197075-gpu/topic/NVIDIA.20driver.20issues.20with.20WebGPU.2Fvello

Are you willing to only apply it locally, Philipp?

I can do that but I think currently it affects all nvidia users with a newer driver If I'm right?

@lokxii
Copy link
Author

lokxii commented Mar 15, 2024

Can you please include:

[patch.crates-io]
wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "2d8d045453855f6594c42a6988692253da195323"}

in your Cargo.toml? This was added in #177, because of a critical issue in wgpu for @Philipp-M. This will be removed at the latest by the end of April 2024, after the next wgpu release.

Development zone: Philipp: Is there an upstream wgpu issue corresponding with this? I've not seen it linked, at least not in the GitHub discussion. If it is wider than just impacting you, then it's reasonable to have. But in that case wgpu should be releasing a new version, consequences be . @xorgy: We discussed backing out from requiring this patch - I still think we should do so. I think this explains the issue you were seeing on Wednesday, as well. Are you willing to only apply it locally, Philipp?

I've added the line but still the same error. Here is my Cargo.toml in case I added the line wrongly

[package]
name = "rsky"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
xilem = { git = "https://github.com/linebender/xilem.git" }

[patch.crates-io]
wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "2d8d045453855f6594c42a6988692253da195323"}

@lokxii
Copy link
Author

lokxii commented Mar 15, 2024

For your reference

[dependencies]
xilem = { git = "https://github.com/linebender/xilem.git", rev = "a13a814e35ad0abc81f8146f26ed73cc662e9814" }

This compiled fine

@xorgy
Copy link
Member

xorgy commented Mar 15, 2024

@Philipp-M

I can do that but I think currently it affects all nvidia users with a newer driver If I'm right?

According to NVIDIA they had a fix in for the second stable release of 550/551 more than a month ago, but it missed the first stable release of that version. It should only have affected a couple of versions that are already obsolete from the information in the forum.

@xorgy
Copy link
Member

xorgy commented Mar 15, 2024

As for this compilation error, it seems to have popped up due to an interaction with a dependency, since it's been building and running fine this whole time (including on CI). I can set xilem up with 0.19.3 and that also works. Philipp can patch it locally I think.

@Philipp-M
Copy link
Contributor

Philipp-M commented Mar 15, 2024

It should only have affected a couple of versions that are already obsolete from the information in the forum.

Internally certainly. Unfortunately still not released, as current stable and beta/production versions still have that issue. As said I can live with that, as I can patch that locally.

it seems to have popped up due to an interaction with a dependency

Well that dependency seems to be vello AFAICT.

Edit: just to confirm: when I'm setting the same wgpu dependency as xilem (git) in vello and depend on that vello version in xilem. A package depending on xilem compiles successfully for me.

DJMcNab added a commit to DJMcNab/xilem that referenced this issue Mar 15, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 19, 2024
* Use released versions of Vello and wgpu

Partially reverts #177

Fixes #189

* Revert auto format of comment
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 a pull request may close this issue.

5 participants