Rosalie241 / RMG

Rosalie's Mupen GUI
GNU General Public License v3.0
573 stars 50 forks source link

Linux - mupen64plus-input-gca fails to build #125

Closed aquova closed 1 year ago

aquova commented 1 year ago

I've been running into an issue when trying to install either the AUR rmg or rmg-git repositories. The project fails to build mupen64plus-input-gca and thus fails altogether. I'm not sure if it's best to report here or upstream. The error is:

error[E0015]: cannot call non-const fn `Mutex::<std::option::Option<DebugInfo>>::new` in statics
  --> src/debug.rs:16:51
   |
16 | pub static DEBUG_INFO: Mutex<Option<DebugInfo>> = Mutex::new(None);
   |                                                   ^^^^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants

error[E0015]: cannot call non-const fn `Mutex::<[u8; 37]>::new` in constant functions
   --> src/adapter.rs:130:18
    |
130 |             buf: Mutex::new([0; READ_LEN]),
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants

For more information about this error, try `rustc --explain E0015`.
error: could not compile `mupen64plus-input-gca` due to 2 previous errors
Rosalie241 commented 1 year ago

Does installing rustup help?

aquova commented 1 year ago

I have rustup installed, but the build still fails.

Rosalie241 commented 1 year ago

I'm sadly unable to reproduce the issue but I've pushed a commit to master which adds a NO_RUST cmake option, so you can try adding -DNO_RUST=ON to the configure function of the PKGBUILD script of rmg-git, which should disable building using rust.

GhostlyDark commented 1 year ago

The installed rust version may not be the latest. Does running the following fix building with rust?

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
aquova commented 1 year ago

Ahh, that seems to have been the problem. Running rustup update to get me to the latest version (1.60 -> 1.68) seems to have fixed the error and I was able to build successfully.