Unable to have the latest Lua 5.4.x in the latest Love 11.4.x

Problem description

I’m unable to use the latest version of Lua together with the latest version Love 2D engine.

I was able to update both packages individually
=> I can use standalone Lua 5.4.6 (or Lua 5.4.3 depending on nix package)
=> I can use standalone Löve2D 11.4.0

BUT

:warning: When I try to use love engine 11.4.0, it defaults to Lua 5.1

Default replit with default Lua and Love2D

This is what you get in the default Love2D replit. After calling next code:

print(_VERSION)
print(love.getVersion())

you see next output in Console

Lua 5.1
0   10  2   Super Toast

which is Lua 5.1 + Love 0.10.2

:cactus: Example replit: https://replit.com/@PepeAmpere/LatestLoveandLua-default

Attempt with updated nix packages

I update the packages e.g. for Lua 5.4.3
(using suggestions from this support requests)

{ pkgs }: {
	deps = [
        pkgs.lua5_4_compat
        pkgs.love
	];
}

or to 5.4.6 using hints from this talk or checking this replit sample

{ pkgs }: {
	deps = [
        pkgs.lua5_4
        pkgs.love
	];
}

after shell updates

nix-channel --update
unpacking channels...

and rebuilding nix twice (by removing pkgs.love and putting it back while running replit)

this the is the new output of console

[ALSOFT] (EE) Failed to connect PipeWire event context (errno: 112)
Lua 5.1
11  4   0   Mysterious Mysteries

When I check the version of Lua via Shell, I’m already seeing the new version

lua -v
Lua 5.4.6  Copyright (C) 1994-2023 Lua.org, PUC-Rio

and why I run lua via change in “run” run = "lua main.lua" in .replit I will get newer version of Lua

Lua 5.4
lua: main.lua:2: attempt to index a nil value (global 'love')
stack traceback:
    main.lua:2: in main chunk
    [C]: in ?

:cactus: Example attempt: https://replit.com/@PepeAmpere/LatestLoveandLua-updated#main.lua

Related links I already studied

:information_source: Replit Packaging software with Nix
:information_source: Replit Configuration
:cactus: Prybar readme
:snowflake: NIX packages search

Similar issues:
:spiral_calendar: Different Lua version in shell, in type hints and at runtime - #2 by MattDESTROYER
:spiral_calendar: https://replit.com/talk/ask/Is-there-a-Good-Reason-Why-Lua-is-So-Outdated/144003
:spiral_calendar: https://replit.com/talk/ask/Update-Lua-version/12089
:cactus: https://replit.com/@samfierycreeper/Lua-543#replit.nix

1 Like