danielpclark / rutie

“The Tie Between Ruby and Rust.”
MIT License
961 stars 61 forks source link

Rutie 0.8.4 does not compile with Ruby 3.0.6-1 and Rust 1.73.0 #181

Open Genie23 opened 1 year ago

Genie23 commented 1 year ago

Hello,

I'm trying to create a DLL - written in Rust - for communication via socket.io between a NodeJS server and a Ruby application. To do this, I've logically chosen Rutie.

My first tests, several months ago, proved conclusive, and my DLL was compiling (I was using simple websockets at the time). But, probably since a recent update, I've been unable to compile Rutie to produce my library, both with my old code using websockets and with my new code using socket.io.

Here's what my code produces when I run the following commands:

Commands :

@echo off
rustfmt.exe ".\src\lib.rs"
set RUST_BACKTRACE=full
set CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true
ridk enable && cargo build --release --target i686-pc-windows-gnu

Result :

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "RI_DEVKIT=C:\Ruby30\msys32"                                      

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "MSYSTEM=MINGW32"                                                 

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "PKG_CONFIG_PATH=/mingw32/lib/pkgconfig:/mingw32/share/pkgconfig" 

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "ACLOCAL_PATH=/mingw32/share/aclocal:/usr/share/aclocal"

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "MANPATH=/mingw32/share/man"

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "MINGW_PACKAGE_PREFIX=mingw-w64-i686"

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "MSYSTEM_PREFIX=/mingw32"

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "MSYSTEM_CARCH=i686"

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "MSYSTEM_CHOST=i686-w64-mingw32"

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "MINGW_CHOST=i686-w64-mingw32"

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "MINGW_PREFIX=/mingw32"

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "LANG=fr_FR.UTF-8"

D:\Utilisateurs\genie23\Projects\Rust\psdk-socket>set "PATH=C:\Ruby30\bin;C:\Ruby30\msys32\mingw32\bin;C:\Ruby30\msys32\usr\bin;C:\Ruby30\bin;C:\Ruby30\msys32\mingw64\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Pro
gram Files (x86)\VMware\VMware Player\bin\;C:\Program Files\Python39\Scripts\;C:\Program Files\Python39\;C:\Users\sphin\AppData\Local\Microsoft\WindowsApps;C:\Users\sphin\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\sph
in\AppData\Roaming\npm;C:\Users\sphin\AppData\Local\Yarn\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\wamp64\bin\php\php7.4.33;C:\Program Files\nodejs;C:\Program Files (x86)\Yarn\bin\;C:\WINDOWS\system32;C:\WIND
OWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\WINDOWS\system32;C:\WINDOWS
;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\dotnet\;C:\Program Files\LetsEncrypt;C:\ProgramData\ComposerSetup\bin;C:\Pro
gram Files\7-Zip;C:\Program Files\cwrsync\bin;C:\Program Files\Java\jdk-16.0.2\bin;C:\Program Files\Cmder;C:\Program Files\Cmder\bin;C:\Program Files\PuTTY\;C:\Program Files\gs\gs10.00.0\bin;C:\Program Files\NVIDIA Corporation\N
VIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Ruby30\msys32\usr\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\LLVM\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\nodejs\;
C:\Users\sphin\.cargo\bin;C:\Users\sphin\.dotnet\tools;C:\Users\sphin\AppData\Roaming\Composer\vendor\bin;C:\Program Files\JetBrains\PhpStorm 2021.2.2\bin;C:\Program Files\JetBrains\RubyMine 2021.2.2\bin;C:\Program Files\JetBrai
ns\JetBrains Rider 2021.2.1\bin;C:\Program Files\JetBrains\WebStorm 2021.2.2\bin;C:\Program Files (x86)\Nmap;C:\Program Files\JetBrains\IntelliJ IDEA 2021.2.2\bin;C:\Program Files\JetBrains\CLion 2021.2.3\bin;C:\Program Files\Je
tBrains\PyCharm 2021.3.1\bin;C:\Users\sphin\AppData\Local\JetBrains\Toolbox\scripts"
   Compiling proc-macro2 v1.0.69
   Compiling unicode-ident v1.0.12
   Compiling windows_i686_gnu v0.48.5
   Compiling autocfg v1.1.0
   Compiling futures-core v0.3.28
   Compiling typenum v1.17.0
   Compiling version_check v0.9.4
   Compiling futures-task v0.3.28
   Compiling native-tls v0.2.11
   Compiling winapi-i686-pc-windows-gnu v0.4.0
   Compiling futures-util v0.3.28
   Compiling slab v0.4.9
   Compiling generic-array v0.14.7
   Compiling windows-targets v0.48.5
   Compiling httparse v1.8.0
   Compiling windows-sys v0.48.0
   Compiling indexmap v1.9.3
   Compiling quote v1.0.33
   Compiling winapi v0.3.9
   Compiling syn v2.0.38
   Compiling serde v1.0.189
   Compiling futures-channel v0.3.28
   Compiling thiserror v1.0.49
   Compiling serde_json v1.0.107
   Compiling async-trait v0.1.74
   Compiling libc v0.2.149
   Compiling rutie v0.8.4
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling digest v0.10.7
   Compiling sha-1 v0.10.1
   Compiling socket2 v0.4.9
error: failed to run custom build command for `rutie v0.8.4`

Caused by:
  process didn't exit successfully: `D:\Utilisateurs\genie23\Projects\Rust\psdk-socket\target\release\build\rutie-00673e76659fd98a\build-script-build` (exit code: 101)
  --- stdout
  cargo:rustc-link-search=C:/Ruby30/bin
  cargo:rustc-link-search=C:/Ruby30/bin/ruby_builtin_dlls

  --- stderr
  thread 'main' panicked at C:\Users\sphin\.cargo\registry\src\index.crates.io-1cd66030c949c28d\rutie-0.8.4\build.rs:163:36:
  couldn't remove exports.txt: Os { code: 2, kind: NotFound, message: "Le fichier spécifié est introuvable." }
  stack backtrace:
     0:   0x6628fa - core::fmt::rt::Argument::fmt
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\fmt\rt.rs:138
     1:   0x6628fa - core::fmt::write
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\fmt\mod.rs:1094
     2:   0x6463a1 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\io\mod.rs:1714
     3:   0x6499a5 - std::sys_common::backtrace::_print
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\sys_common\backtrace.rs:47
     4:   0x6499a5 - std::sys_common::backtrace::print
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\sys_common\backtrace.rs:34
     5:   0x64b9dd - std::panicking::default_hook::closure$1
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:270
     6:   0x64b5e1 - std::panicking::default_hook
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:290
     7:   0x64c0af - std::panicking::rust_panic_with_hook
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:707
     8:   0x64bf14 - std::panicking::begin_panic_handler::closure$0
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:599
     9:   0x64a6d5 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\sys_common\backtrace.rs:170
    10:   0x64bbd4 - std::panicking::begin_panic_handler
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:595
    11:   0x6677ff - core::panicking::panic_fmt
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\panicking.rs:67
    12:   0x667b69 - core::result::unwrap_failed
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\result.rs:1652
    13:   0x62d6b3 - enum2$<core::result::Result<tuple$<>,std::io::error::Error> >::expect<tuple$<>,std::io::error::Error>
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\core\src\result.rs:1034
    14:   0x637b48 - build_script_build::windows_support
                         at C:\Users\sphin\.cargo\registry\src\index.crates.io-1cd66030c949c28d\rutie-0.8.4\build.rs:163
    15:   0x63a2aa - build_script_build::main
                         at C:\Users\sphin\.cargo\registry\src\index.crates.io-1cd66030c949c28d\rutie-0.8.4\build.rs:358
    16:   0x62f297 - core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\core\src\ops\function.rs:250
    17:   0x62643f - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\std\src\sys_common\backtrace.rs:154
    18:   0x62643f - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\std\src\sys_common\backtrace.rs:154
    19:   0x642c67 - std::rt::lang_start_internal::closure$2
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\rt.rs:148
    20:   0x642c67 - std::panicking::try::do_call
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:502
    21:   0x642c67 - std::panicking::try
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:466
    22:   0x642c67 - std::panic::catch_unwind
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panic.rs:142
    23:   0x642c67 - std::rt::lang_start_internal
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\rt.rs:148
    24:   0x62ed1e - std::rt::lang_start<tuple$<> >
                         at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\std\src\rt.rs:165
    25:   0x665f4f - invoke_main
                         at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
    26:   0x665f4f - __scrt_common_main_seh
                         at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    27: 0x762bfcc9 - BaseThreadInitThunk
    28: 0x77507c6e - RtlGetAppContainerNamedObjectPath
    29: 0x77507c3e - RtlGetAppContainerNamedObjectPath
warning: build failed, waiting for other jobs to finish...

My Cargo.toml is quite simple:

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

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

[lib]
crate-type = ["cdylib"]

[dependencies]
rust_socketio = { version = "0.4.3", features = ["async"] }
serde_json = "1.0.107"
futures-util = "0.3.28"
uuid = { version = "1.4.1", features = ["v4"] }
rutie = "0.8.4"

Is this a problem in my configuration or do others have the same problem?

danielpclark commented 9 months ago

It is not a problem with you configuration. Ruby 3 support is still in the works.