Git Product home page Git Product logo

Comments (7)

altsem avatar altsem commented on August 10, 2024 1

I merged a fix for it for now, reckon i need to see over PR permissions or something so others can contribute more easily. Assuming this fixes it and closing the issue.
Thanks guys! :)

from gitu.

altsem avatar altsem commented on August 10, 2024

This looks like a cryptic message from libgit2.
What does it say when you
RUST_BACKTRACE=1 cargo run?

from gitu.

failable avatar failable commented on August 10, 2024

Seems to get the same output..
image

from gitu.

altsem avatar altsem commented on August 10, 2024

Been on rustc 1.76 (stable), switched to 1.78 (nightly) and I got these warnings as well. But I don't experience the same issue on Fedora.
Should add some logging options to Gitu. Best I can do here is guess.

Thank you for reporting it!

from gitu.

overhacked avatar overhacked commented on August 10, 2024

I've been banging away at this, and the problem is that Duration::MAX is too large for the select(2) syscall timeout value (at least on macOS). select() gets called in the main loop via event::poll:

gitu/src/lib.rs

Lines 218 to 226 in 9d60124

while !state.quit {
// TODO Gather all events, no need to draw for every
if !event::poll(std::time::Duration::MAX)? {
continue;
}
let event = event::read()?;
update(terminal, &mut state, &[event])?;
}

I think that this call to event::poll() is unnecessary, because giving it a maximum, effectively infinite timeout, makes it blocking, just like event::read(). Can the main loop just omit the if (poll) then continue condition and block on event::read() (delete lines 219-222)? I don't see any work that is currently being performed between calls to poll, anyway.

Note: I found that the syscall call was the source of the problem by stepping through with a debugger, and I figured out the maximum value for the timeout to select(2) on macOS with the following sloppy C code: https://gist.github.com/overhacked/0b041af7994c06f9b6837876083deb72

from gitu.

overhacked avatar overhacked commented on August 10, 2024

I meant to add, commenting out

     if !event::poll(std::time::Duration::MAX)? { 
         continue; 
     } 

gets rid of the error, and everything else in the TUI seems to work fine.

from gitu.

altsem avatar altsem commented on August 10, 2024

Agreed it looks entirely unnecessary. There's no need to draw unless there's an event. 👍

from gitu.

Related Issues (20)

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.