LuaLS / LuaLS/luarocks-build-addon

Remove `rockspec:type() == "rockspec"` assertion

Open
#14 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Lua
Stars
11
Forks
2
PR merge metrics
No merged PRs in 30d

Description

I get this warning whenever I install CC:Tweaked

> Warning: The function rockspec.type() is no longer necessary and is now deprecated. Please update your plugin to remove calls to this function.

```diff
diff --git a/src/luarocks/build/lls-addon.lua b/src/luarocks/build/lls-addon.lua
index f0491dd..093c1bd 100644
--- a/src/luarocks/build/lls-addon.lua
+++ b/src/luarocks/build/lls-addon.lua
@@ -375,8 +375,6 @@ M.installAddon = installAddon
---@param noInstall boolean
---@return boolean, string?
function M.run(rockspec, noInstall)
- assert(rockspec:type() == "rockspec", "argument is not a rockspec")
-
local env = {
ABSPATH = cfg.variables["LLSADDON_ABSPATH"],
LUARCPATH = cfg.variables["LLSADDON_LUARCPATH"],
```

The only reason I wouldn't patch it now is because there are likely still users of older LuaRocks installations, which don't have this warning and might still need the assertion.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/luarocks/build/lls-addon.lua, especially M.run and its rockspec argument. Check how rockspec:type() is used there and compare the expected behavior with older LuaRocks installations. Done means resolving whether the assertion can be removed without breaking supported older versions, while eliminating the deprecation warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.