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

RFE: useful lua errors #545

Closed
nim-nim opened this issue Sep 21, 2018 · 5 comments
Closed

RFE: useful lua errors #545

nim-nim opened this issue Sep 21, 2018 · 5 comments

Comments

@nim-nim
Copy link

nim-nim commented Sep 21, 2018

Right now rpm prints out lua syntax errors with line numbers, but forgets to print the macro in which those lines can be found

When several lua macros call each other finding the one which is erroring becomes quite tricky. rpm only points out the top macro name

For example

%luamacro() %{lua:
-- lots of processing
print( rpm.expand("%anotherluamacro") .. "\\n")

rpm will notify there is an error in %luamacro if %anotherluamacro has a syntax error, instead of notifying the error is in line x of %anotherluamacro

@pavlinamv
Copy link
Contributor

Agree. The error message does not help a lot. Some additional info containing whole %anotherluamacro can improve the situation.

@pmatilai
Copy link
Member

pmatilai commented Oct 2, 2018

The top macro name you're seeing is simply the line in the spec. Try --trace (or in older versions that don't support it, --eval '%trace') for more advanced macro debugging.

@nim-nim
Copy link
Author

nim-nim commented Oct 15, 2018

Thanks for the pointer!

However that does not help a lot when you are mass building in mock (the general case nowadays), and the only debugging help are mock logs, and mock has already cleaned up all rpm temporary files

@pmatilai
Copy link
Member

Nod. Makes me think that perhaps we should default to macro tracing on when building packages, at least in non-quiet mode.

@ffesti ffesti added this to Needs triage in Ticket Review (Outdated) Mar 3, 2020
@pmatilai pmatilai moved this from Needs triage to Yes in Ticket Review (Outdated) Mar 5, 2020
@pmatilai
Copy link
Member

pmatilai commented Mar 5, 2020

This is broader than just Lua, rpm should really print out a "traceback" on macro errors. There's even some code to do that but I guess its not working as it should (shock horror)

@pmatilai pmatilai added this to To do in Lua integration Jan 22, 2021
pmatilai added a commit to pmatilai/rpm that referenced this issue Jan 25, 2021
Should make macro debugging a little saner, including but not limited
to Lua.

Fixes: rpm-software-management#545
@ffesti ffesti closed this as completed in f67d239 Jan 29, 2021
Ticket Review (Outdated) automation moved this from Yes to Closed Jan 29, 2021
@pmatilai pmatilai moved this from To do to Done in Lua integration Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants