SnowflakePowered / librashader

RetroArch Shaders for All
Mozilla Public License 2.0
77 stars 7 forks source link

Fails to build on Archlinux with rust 1.76 #48

Closed Mastergatto closed 4 months ago

Mastergatto commented 4 months ago

I'm trying to build the 0.2.0-rc1 version by launching the command for creating a .so library but it encounters those errors:

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> librashader-reflect/src/lib.rs:49:1
   |
49 | #![feature(type_alias_impl_trait)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> librashader-reflect/src/lib.rs:50:1
   |
50 | #![feature(impl_trait_in_assoc_type)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> librashader-reflect/src/lib.rs:51:1
   |
51 | #![feature(let_chains)]
   | ^^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `Deserialize`, `Serialize`
 --> librashader-reflect/src/front/glslang.rs:7:13
  |
7 | use serde::{Deserialize, Serialize};
  |             ^^^^^^^^^^^  ^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0554`.
warning: `librashader-reflect` (lib) generated 1 warning
error: could not compile `librashader-reflect` (lib) due to 3 previous errors; 1 warning emitted

Switching to rustup it fixes the aforementioned errors, but I believe it's not an ideal situation, especially for a future packaging on AUR.

Bonus: While we're here, I want to bring attention to the folder in the .tar.gz, in its name "librashader-" is repeated, like this: "/librashader-librashader-v0.2.0-rc.1/" instead of "/librashader-v0.2.0-rc.1/". It's not the first release to do so.

chyyran commented 4 months ago

librashader needs nightly which is a problem for package managers that only have stable versions of rustc available on their repositories, so it uses the RUSTC_BOOTSTRAP hack to enable nightly features on stable.

See the PKGBUILD used on OBS. This really should only be used for packaging purposes where rustup isn't available.

chyyran commented 4 months ago

The tar.gz tags are also created automatically via cargo release, it's an artifact of how theyre tagging the repository at that point in time.

Mastergatto commented 4 months ago

Yeah, with RUSTC_BOOTSTRAP=1 it has worked, thanks. Anyway, on Archlinux rustup is also available, though it needs to be first configured, which makes it still not ideal for the packaging of librashader, thus RUSTC_BOOTSTRAP will be needed though.