TheHexagonCodes / grimmod

Mod loader (and more) for Grim Fandango Remastered
https://hexagon.codes/grimhd
MIT License
11 stars 0 forks source link

{Linux} compatibility, cross-compiling for the linux version of GF remastered #1

Open arrowgent opened 4 months ago

arrowgent commented 4 months ago

rustc --version rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball) cargo --version cargo 1.75.0

instead of a .dll, we want to output a .so library

cargo build

error[E0463]: can't find crate for `core`
  |
  = note: the `i686-pc-windows-msvc` target may not be installed
error: could not compile `simd-adler32` (lib) due to 143 previous errors

alternatively: rustc build.rs ls 13277888 May 25 04:59 build* ./build

thread 'main' panicked at build.rs:4:54:
called `Result::unwrap()` on an `Err` value: NotPresent
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

cross compile: cargo build --target x86_64-unknown-linux-gnu lots of compiling log Compiling grimmod v1.0.0 (/media/catbox/CrucialXTB/SteamLibrary/steamapps/common/grimfandangoremastered/Grim Fandango Remastered/grimmod/grimmod)

cross compile log:

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/lib.rs:1:1
  |
1 | #![feature(fn_traits, if_let_guard, let_chains, tuple_trait, unboxed_closures)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/lib.rs:1:12
  |
1 | #![feature(fn_traits, if_let_guard, let_chains, tuple_trait, unboxed_closures)]
  |            ^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/lib.rs:1:49
  |
1 | #![feature(fn_traits, if_let_guard, let_chains, tuple_trait, unboxed_closures)]
  |                                                 ^^^^^^^^^^^

warning: use of calling convention not supported on this target
  --> src/init.rs:74:1
   |
74 | extern "stdcall" fn application_entry() {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
   = note: `#[warn(unsupported_calling_conventions)]` on by default

warning: use of calling convention not supported on this target
   --> src/renderer/graphics.rs:354:1
    |
354 | pub extern "stdcall" fn delete_textures(n: gl::Sizei, textures: *const gl::Uint) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>

warning: use of calling convention not supported on this target
   --> src/renderer/graphics.rs:416:1
    |
416 | / pub extern "stdcall" fn draw_elements_base_vertex(
417 | |     mode: gl::Enum,
418 | |     count: gl::Sizei,
419 | |     typ: gl::Enum,
420 | |     indicies: *mut c_void,
421 | |     basevertex: gl::Int,
422 | | ) {
    | |_^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>

warning: use of calling convention not supported on this target
   --> src/renderer/graphics.rs:464:1
    |
464 | / extern "stdcall" fn hq_tex_image_2d(
465 | |     _target: gl::Enum,
466 | |     _level: gl::Int,
467 | |     _internalformat: gl::Int,
...   |
473 | |     _data: *const c_void,
474 | | ) {
    | |_^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>

warning: use of calling convention not supported on this target
   --> src/renderer/graphics.rs:504:1
    |
504 | extern "stdcall" fn hq_pixel_storei(pname: gl::Enum, param: gl::Int) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>

warning: use of calling convention not supported on this target
   --> src/renderer/graphics.rs:540:1
    |
540 | / pub extern "stdcall" fn forced_linear_sampler_parameteri(
541 | |     target: gl::Enum,
542 | |     pname: gl::Enum,
543 | |     param: gl::Int,
544 | | ) {
    | |_^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>

warning: use of calling convention not supported on this target
   --> src/renderer/graphics.rs:552:1
    |
552 | / pub extern "stdcall" fn compressed_tex_image2d(
553 | |     target: gl::Enum,
554 | |     level: gl::Int,
555 | |     internalformat: gl::Enum,
...   |
560 | |     data: *const c_void,
561 | | ) {
    | |_^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>

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

getting the rustc/cargo nightly build rustc -V rustc 1.78.0 (9b00956e5 2024-04-29) cargo --version cargo 1.78.0 (54d8815d0 2024-03-26)

same thing:

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/lib.rs:1:1
  |
1 | #![feature(fn_traits, if_let_guard, let_chains, tuple_trait, unboxed_closures)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/lib.rs:1:12
  |
1 | #![feature(fn_traits, if_let_guard, let_chains, tuple_trait, unboxed_closures)]
  |            ^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/lib.rs:1:49
  |
1 | #![feature(fn_traits, if_let_guard, let_chains, tuple_trait, unboxed_closures)]
TheHexagonCodes commented 3 months ago

This is probably possible and Linux is my primary OS so it would be interesting to do. At the moment though it's very specifically built for Windows and it works under Proton so I'm not sure if I'll get around to reverse engineering it on Linux and figuring out how to abstract out some of the components. But I'm open to it!