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

[Bug]: attempt to call a nil value (global 'cairo_xlib_surface_create') #1944

Closed
ExecutorElassus opened this issue May 30, 2024 · 4 comments
Closed
Labels
bug Bug report or bug fix PR triage Issue that hasn't been verified

Comments

@ExecutorElassus
Copy link

What happened?

On conky-1.21.1, the following function:

function conky_main()
    if conky_window == nil then
        return
    end

    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)

    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)

    if update_num > 5 then
        go_clock_rings(display)
        go_gauge_rings(display)
    end

    cairo_surface_destroy(cs)
    cairo_destroy(display)
end

fails to draw the various graphs on my conky setup. I get the following error:

conky: llua_do_call: function conky_main execution failed: /home/elassus/.conky/conky_grey.lua:532: attempt to call a nil value (global 'cairo_xlib_surface_create')

Downgrading to conky stable (1.19.8) works around the problem.

I'm using conky on gentoo Linux. My settings are:

 # emerge -pv conky::gentoo

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 3.19 s (backtrack: 0/20).

[ebuild   R    ] app-admin/conky-1.19.8::gentoo  USE="X bundled-toluapp curl hddtemp iconv imlib lua-cairo lua-imlib lua-rsvg ncurses portmon rss truetype wayland -apcupsd -cmus -doc -extras -ical -intel-backlight -iostats -irc -math -moc -mpd -mysql -nvidia -pulseaudio -systemd -test -thinkpad -webserver -wifi -xinerama -xmms2" LUA_SINGLE_TARGET="lua5-4" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Do I need to update the syntax here? Or is there something else wrong?

Version

1.21.1

Which OS/distro are you seeing the problem on?

Gentoo

Conky config

No response

Stack trace

No response

Relevant log output

No response

@ExecutorElassus ExecutorElassus added bug Bug report or bug fix PR triage Issue that hasn't been verified labels May 30, 2024
@brndnmtthws
Copy link
Owner

Add require 'cairo_xlib'. See #1867.

@ExecutorElassus
Copy link
Author

ExecutorElassus commented May 30, 2024

Sorry, my mistake (I posted the gentoo USE flags for 1.19.1, not 1.21.1). If I un-block 1.21.1, these are the USE flags:

 # emerge -pv conky

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 11.29 s (backtrack: 1/20).

[ebuild     U  ] app-admin/conky-1.21.1::gentoo [1.19.8::gentoo] USE="X bundled-toluapp colour-name-map%* curl hddtemp iconv imlib lua-cairo lua-cairo-xlib%* lua-imlib lua-rsvg ncurses portmon rss truetype wayland -apcupsd -cmus -doc -extras -ical -intel-backlight -iostats -irc -math -moc -mpd -mysql -nvidia -pulseaudio -systemd -test -thinkpad -webserver -wifi -xinerama -xmms2" LUA_SINGLE_TARGET="lua5-4" 0 KiB

Total: 1 package (1 upgrade), Size of downloads: 0 KiB

As you can see, lua-cairo-xlib is included. This does not resolve the issue (ie, I still get this error).

@ExecutorElassus
Copy link
Author

whoops, sorry I misunderstood what you meant. I've added require 'cairo_xlib' at the top of the .lua file right below require 'cairo' and BOOM now it works.
Thanks for sorting me out.

@pallebone
Copy link

You helped me also. Thank you, you are the legend until the day you die. Love you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report or bug fix PR triage Issue that hasn't been verified
Projects
None yet
Development

No branches or pull requests

3 participants