Code Monkey home page Code Monkey logo

rust-libretro's People

Contributors

jessetg avatar max-m avatar paulyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rust-libretro's Issues

Wrong glibc required

When I try to run the test example (and any other), I get the following error:

[INFO] [Core]: Loading dynamic libretro core from: "../target/debug/examples/libtest.so"
[ERROR] Failed to open libretro core: "/home/memphis/ExternalCode/rust-libretro/target/debug/examples/libtest.so"
Error(s): /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/memphis/ExternalCode/rust-libretro/target/debug/examples/libtest.so)

It says glibc 2.33 is required, but I have glibc 2.36 installed so I'm not sure why it builds for 2.33
The commands I ran to get this were:
cargo build --example test --features="unstable-env-commands log"
retroarch -v -L ../target/debug/examples/libtest
from the rust-libretro/rust-libretro directory

I'm on Ubuntu 22.10
The first line of output of ldd --version is ldd (Ubuntu GLIBC 2.36-0ubuntu4) 2.36

Also is there a way for this to be at least moderately independent of glibc version?

"Cannot find type `size_t` in this scope" when building

I'm attempting to build a local copy of this repo, but I keep getting errors relating to the type size_t being missing. It looks like it's not consistently being generated by bindgen; is there any reason not to use the type provided by libc instead?

`RetroLogger` cannot filter output by scope

Because of how RetroLogger is initialized, any logging output made with log!() is forwarded to the RetroArch log. This is a good thing; however, some Rust crates are a bit excessive. They might use debug!() when trace!() would've been more appropriate. Or perhaps I'm just not interested in what they have to say. See this log file for an example. For the purpose of this ticket, the contents of the log file are unimportant; just note that there's a lot of repetitive input that I don't care about.

I'd like (and intend to contribute) the ability to configure overrides with RetroLogger, such that scopes can be disabled or mapped to different log levels. Here's what I'm thinking:

  1. Expose RetroLogger publicly so that it can be customized if the default behavior isn't desired (and so that existing usage is unchanged)
  2. Provide a RetroLogger method that's used something like this:
logger.set_overrides(HashMap::from([
    ("naga::*", Mute), // Ignore all output from the naga scope and it's sub-scopes
    ("wgpu_core::track::texture", Remap(log::Level::Debug, log::Level::Trace), // Force all debug output from wgpu_core::track::texture to be outputted as trace logs instead
    ("wgpu_core::device", Force(log::Level::Trace)), // Force all output from wgpu_core::device to be outputted as trace logs
    ("something_else", Remap(log::Level::Warn, log::Level::Error), // Force all warn output from something_else to be outputted as error logs
]))

This particular design is just a back-of-the-napkin idea. What do you think?

`rust_libretro_sys::retro_log_level` is not FFI-safe

If I provide a log interface like this:

unsafe extern "C" fn log(level: retro_log_level, _fmt: *const c_char, ...) {
    todo!()
}

I get the following warning:

warning  improper_ctypes_definitions
`extern` fn uses type `rust_libretro_sys::retro_log_level`, which is not FFI-safe
this enum is non-exhaustive
`#[warn(improper_ctypes_definitions)]` on by default (lsp)

I'm assuming this is something related to the way bindgen is set up but not sure how to address just yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.