slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.43k stars 543 forks source link

Inability to build slint-cpp #4617

Open themistocles-0 opened 5 months ago

themistocles-0 commented 5 months ago

I am trying to use slint with cpp on debian 12. I have created a simple cmake project to see if I can build slint-cpp within my project. I extracted the latest release of slint in my source directly and included the cpp project in my cmake build file. Screenshot from 2024-02-14 20-13-56 Everything builds but when it gets to slint-cpp everything simply freezes, looking at the task monitor, everything that should be building my project is stuck sleeping seemingly indefinitely, it has been like that for an hour. Screenshot from 2024-02-14 20-21-24 Screenshot from 2024-02-14 20-16-53 Screenshot from 2024-02-14 20-17-55 The only process that is running as slint-cpp is building cannot even tell what is going on. Screenshot from 2024-02-14 20-26-01 How long should it take to build slint-cpp cause for me it seems to take forever. I can't tell if it's stuck building one file as it does not show which file it is compiling.

ogoffart commented 5 months ago

It compiles Slint from rust. That can take some time. But shouldn't take forever. I'd say it should just take a few minutes. The build-script-build process is a process that creates the internal .h based by parsing the .rs datastructures, but that process doesn't seem to be running. The cargo process that is running is doing cargo metadata I don't know exactly why it does that. Could you check what is the process tree and see what is the parent process? It is not using much CPU either so it seems blocked. It is possible that it needs to access the network to download the crate index. Do you know what is your version of Rust?

As a workaround, you can try using the binary packages

ogoffart commented 5 months ago

I found out that cbindgen used by the buildscript is running cargo metadata: https://github.com/mozilla/cbindgen/blob/master/src/bindgen/cargo/cargo_metadata.rs#L234 That explains why it is running, but not why it hangs. I suspect it is checking the network for the index, could that be? But it shouldn't take long since the previous cargo invocation should have already cached the relevant data. (although it will include more features)

themistocles-0 commented 5 months ago

Do you know what is your version of Rust?

rustc 1.76.0 (07dca489a 2024-02-04)

As a workaround, you can try using the binary packages

I strictly want an in-tree build, where I manually manage most of the dependencies I use.

themistocles-0 commented 5 months ago

That explains why it is running, but not why it hangs. I suspect it is checking the network for the index, could that be? But it shouldn't take long since the previous cargo invocation should have already cached the relevant data. (although it will include more features)

I am not sure, I had quite the slow internet connection yesterday, will try again today.

themistocles-0 commented 5 months ago

I suppose this was a networking issue. There was a download at the time slint-cpp was being built. the network monitor showed this. I suppose that's what was preventing the download from completing. I was able to complete the build.