Skip to content

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented May 18, 2024

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • 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.

⌛ Dependencies

Copy link

github-actions bot commented May 19, 2024

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

@jhpalmieri
Copy link
Member

jhpalmieri commented May 22, 2024

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)

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 23, 2024

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

@kwankyu
Copy link
Collaborator

kwankyu commented May 29, 2024

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

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2024

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

@kwankyu
Copy link
Collaborator

kwankyu commented May 29, 2024

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...

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2024

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"

@kwankyu
Copy link
Collaborator

kwankyu commented May 29, 2024

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
Copy link
Collaborator

kwankyu commented May 29, 2024

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.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2024

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

Copy link
Collaborator

@kwankyu kwankyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working well. LGTM.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2024

Thank you!

vbraun pushed a commit to vbraun/sage that referenced this pull request May 29, 2024
sagemathgh-38026: Do not create `spkg-*.log`, `spkg-*.time` files
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

- Clean up after sagemath#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 sagemath#37887 @jhpalmieri

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [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.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

- Depends on sagemath#37840 (merged here)
    
URL: sagemath#38026
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
@vbraun vbraun merged commit efc613a into sagemath:develop Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing Sage's python3 spkg produces some untracked files
4 participants