sage icon indicating copy to clipboard operation
sage copied to clipboard

Do not create `spkg-*.log`, `spkg-*.time` files

Open mkoeppe opened this issue 1 year ago • 3 comments

  • Clean up after #37391, which used sage-logger for prefixing output; generating the log/time files was a side effect, which has not proven to be useful
  • Fixes #37887 @jhpalmieri

:memo: Checklist

  • [x] The title is concise and informative.
  • [x] The description explains in detail what this PR is about.
  • [x] I have linked a relevant issue or discussion.
  • [ ] I have created tests covering the changes.
  • [ ] I have updated the documentation and checked the documentation preview.

:hourglass: Dependencies

  • Depends on #37840 (merged here)

mkoeppe avatar May 18 '24 23:05 mkoeppe

Documentation preview for this PR (built with commit bfb292ae69a4b6955f4302221285dc3c5136a866; changes) is ready! :tada: This preview will update shortly after each push to this PR.

github-actions[bot] avatar May 19 '24 00:05 github-actions[bot]

There is some code duplication. Would it make any sense to have a function that would replace each instance like

if [ -f spkg-pipinst ]; then
    sage-logger -P spkg-pipinst "$SAGE_SUDO ./spkg-pipinst"
    if [ $? -ne 0 ]; then
        error_msg "Error running the pipinst script for $PKG_NAME."
        exit 1
    fi
fi

by a call to a function defined by something like

run_script() {
if [ -f $1 ]; then
    sage-logger -P $1 "$SAGE_SUDO ./$1"
    if [ $? -ne 0 ]; then
        error_msg "Error running the $1 script for $PKG_NAME."
        exit 1
    fi
fi}

?

(not tested)

jhpalmieri avatar May 22 '24 21:05 jhpalmieri

I've made it less verbose in a different way, please take a look

mkoeppe avatar May 23 '24 00:05 mkoeppe

It seems that some of spkg-*.log files are generated and some not. Which is which and why?

kwankyu avatar May 29 '24 04:05 kwankyu

If any are still generated with this PR, that's a bug. Is this what you observed?

mkoeppe avatar May 29 '24 04:05 mkoeppe

~~Can we test it here, with "CI Fix" tag?~~ We can already see it.

I think there should be some explanation why you introduced the log files and why you think now they are not useful...

kwankyu avatar May 29 '24 04:05 kwankyu

I don't have a better explanation than what I wrote in the ticket description: "I used sage-logger for prefixing output; generating the log/time files was a side effect, which has not proven to be useful"

mkoeppe avatar May 29 '24 05:05 mkoeppe

~~You certainly added the logging feature expecting that the logs would be useful.~~ Then now you simply say "which has not proven to be useful". I am curious what happened in the meanwhile...

kwankyu avatar May 29 '24 05:05 kwankyu

I looked #37391 again. Right, you didn't add the logging feature. As you said, it is a side-effect of using sage-logger for prefixing. The generated log files are not useful, and hence here you add a feature to turn them off.

OK. I misunderstood the situation. Sorry.

kwankyu avatar May 29 '24 05:05 kwankyu

No worries, these are all the right questions to ask!

mkoeppe avatar May 29 '24 05:05 mkoeppe

Thank you!

mkoeppe avatar May 29 '24 05:05 mkoeppe