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

Add Lua 5.1.5 and 5.2.4 source code #234

Merged
merged 3 commits into from
Apr 13, 2023
Merged

Add Lua 5.1.5 and 5.2.4 source code #234

merged 3 commits into from
Apr 13, 2023

Conversation

xxyzz
Copy link
Contributor

@xxyzz xxyzz commented Apr 6, 2023

This pull request adds the Lua 5.1.5 and 5.2.4 source files. The Lua GitHub repo doesn't have tags for those two releases, so I downloaded the code from https://www.lua.org/ftp and added them to the third-party directory.

The test_decrease_memory test failed on Lua 5.1 with error not enough memory, but I'm not sure how to fix it yet.

@scoder
Copy link
Owner

scoder commented Apr 6, 2023

Thanks. When you write "doesn't have tags", do you mean that it doesn't include the commit IDs either? Meaning, the code is really not there? Or are only the tags missing?

I'd rather not have these sources in the repo. If there's a way to get them via an external subrepo, I'd prefer that. Doesn't have to be github, just some sort-of official repo.

@scoder
Copy link
Owner

scoder commented Apr 6, 2023

At least for the 5.2 branch, there seem to be commits after 5.2.3:
https://github.com/lua/lua/commits/v5-2

The 5.1 branch has apparently been deleted already.

@xxyzz
Copy link
Contributor Author

xxyzz commented Apr 6, 2023

It's kind of complicated because that GitHub repo is "synced from another RCS repository" and the only official site to download their code is https://www.lua.org/ftp. Please see the Lua maintainer's comment at here: lua/lua#16 (comment)

@xxyzz xxyzz force-pushed the lua51 branch 3 times, most recently from 83b789f to bf4c5f2 Compare April 6, 2023 14:46
@xxyzz
Copy link
Contributor Author

xxyzz commented Apr 6, 2023

The build finally passed this time... Only the test_decrease_memory test failed for Lua 5.1.

@xxyzz
Copy link
Contributor Author

xxyzz commented Apr 11, 2023

I guess Lua 5.1 doesn't collect garbage when lua_Alloc failed. Should I just disable test_decrease_memory for Lua 5.1?

@scoder
Copy link
Owner

scoder commented Apr 12, 2023

At least for the 5.2 branch, there seem to be commits after 5.2.3:
https://github.com/lua/lua/commits/v5-2

I've updated the Lua 5.2 subrepo in the master branch to the latest commit in that branch. Let's use that. The last commit there seems to indicate that Lua 5.2.4 had been released at that point.

Personally, I think that Lua 5.1 is long out of maintenance for good reason, and shouldn't be used any more, but if we can still support it without much effort, then let's just add the sources to Lupa. It just makes the distro and repo a little larger. Someone out there can probably still make use of it.

@xxyzz
Copy link
Contributor Author

xxyzz commented Apr 12, 2023

The last commit there seems to indicate that Lua 5.2.4 had been released at that point.

That branch lacks some files in the .tar.gz file but that probably doesn't matter, most C code are the same.

Someone out there can probably still make use of it.

My main reason to create this pull request is for the https://github.com/tatuylonen/wiktextract project, they have to run some Lua 5.1 code because MediaWiki is still using 5.1.5.

xxyzz added 2 commits April 13, 2023 07:42
The Lua GitHub repository doesn't have the 5.1.5 tag, and the code
downloaded from https://www.lua.org/ftp has different directory layout.
Don't run Lua code after decreasing memory limit. Lua 5.1 seems can't
free the memory of the `a` variable after deleting it, thus it will raise
`LuaMemoryError` again. And the memory limiting feature doesn't
support Lua 5.1.
@scoder scoder merged commit 5cde158 into scoder:master Apr 13, 2023
@scoder
Copy link
Owner

scoder commented Apr 13, 2023

Thanks!

@scoder scoder added this to the 2.1 milestone Apr 13, 2023
@xxyzz xxyzz deleted the lua51 branch April 13, 2023 07:22
@rsiemens
Copy link

rsiemens commented Jul 6, 2023

Personally, I think that Lua 5.1 is long out of maintenance for good reason, and shouldn't be used any more, but if we can still support it without much effort, then let's just add the sources to Lupa. It just makes the distro and repo a little larger. Someone out there can probably still make use of it.

Just another supporting data point for Lua 5.1 inclusion - Redis still bundles Lua 5.1 so being able to easily unit test any lua scripts that will be sent to redis via python is nice.

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