[Bug 269074] editors/lite fails to launch after installing lua (5.3/5.4?)

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 20 Jan 2023 19:21:39 UTC

            Bug ID: 269074
           Summary: editors/lite fails to launch after installing lua
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: danfe@FreeBSD.org
          Reporter: khwerz@gmail.com
          Assignee: danfe@FreeBSD.org
             Flags: maintainer-feedback?(danfe@FreeBSD.org)

tldr; lite editor seems to expect luajit, when lua5.4 is installed, it goes to
that version, which is not supported.

Initial error:

$ lite
Error: /usr/local/share/lite/core/init.lua:131: bad argument #2 to 'format'
(number has no integer representation)
stack traceback:
        [C]: in function 'string.format'
        /usr/local/share/lite/core/init.lua:131: in main chunk
        [C]: in function 'require'
        [string "local core..."]:10: in function <[string "local core..."]:2>
        [C]: in function 'xpcall'
        [string "local core..."]:2: in main chunk

Checking the code, the line at fault is

local temp_uid = (system.get_time() * 1000) % 0xffffffff
local temp_file_prefix = string.format(".lite_temp_%08x", temp_uid)

string.format will format temp_uid which is a float, in lua 5.1/5.2/jit, lua
automatically floored floats. but even when flooring and the application
launching, no file selection appears.

Solution: Probably using strictly luajit/lua5.1/lua5.2

Note: I am unsure if it automatically will start failing after installing
lua5.4/5.3, but I am unwilling to test/uninstall them atm.

You are receiving this mail because:
You are the assignee for the bug.