Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdl: use versioned library, cleanup ffi/util helpers #1929

Conversation

benoit-pierre
Copy link
Contributor

@benoit-pierre benoit-pierre commented Sep 8, 2024

This change is Reviewable

benoit-pierre added a commit to benoit-pierre/koreader that referenced this pull request Sep 8, 2024
@benoit-pierre benoit-pierre force-pushed the pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers branch from 159e565 to 62e0cec Compare September 21, 2024 20:32
@NiLuJe
Copy link
Member

NiLuJe commented Sep 21, 2024

(nit: typo in the commit msg if this is to be a rebase, ffi/input is gone, not ffi/util ;)).

Copy link
Member

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions, but good to go on principle ;).

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @benoit-pierre)


ffi/util.lua line 685 at r1 (raw file):

        libSDL2, err = util.ffiLoadCandidates(candidates)
        if not libSDL2 then
            print("SDL2 not loaded:", libSDL2)

Shouldn't this still be printing err? libSDL2 is always false in this branch.


ffi/util.lua line 688 at r1 (raw file):

        end
    end
    return libSDL2 or nil

Would returning a false libSDL2 (as opposed to nil) here be an issue for ffi/SDL2_0.lua?

Or, perhaps a better question would be: should ffi/SDL2_0.lua handle failure to load SDL2 in a specific way?

@benoit-pierre benoit-pierre force-pushed the pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers branch from 62e0cec to 34dbf6f Compare September 21, 2024 22:07
@benoit-pierre benoit-pierre force-pushed the pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers branch from 34dbf6f to 6efa4c3 Compare September 21, 2024 22:09
Copy link
Member

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @benoit-pierre)

@benoit-pierre
Copy link
Contributor Author

ffi/util.lua line 685 at r1 (raw file):

        libSDL2, err = util.ffiLoadCandidates(candidates)
        if not libSDL2 then
            print("SDL2 not loaded:", libSDL2)

Shouldn't this still be printing err? libSDL2 is always false in this branch.

Yep.

ffi/util.lua line 688 at r1 (raw file):

        end
    end
    return libSDL2 or nil

Would returning a false libSDL2 (as opposed to nil) here be an issue for ffi/SDL2_0.lua?

Or, perhaps a better question would be: should ffi/SDL2_0.lua handle failure to load SDL2 in a specific way?

No (it will fail in frontend/device.lua before that), but it's cleaner / more logical, no?

Copy link
Member

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @benoit-pierre)

@Frenzie Frenzie merged commit be74047 into koreader:master Sep 22, 2024
4 checks passed
@benoit-pierre benoit-pierre deleted the pr/use_versioned_sdl2_+_cleanup_ffi.util_helpers branch September 22, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants