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

lacy-ubc-math-project:0.1.0 #1488

Merged
merged 7 commits into from
Jan 15, 2025
Merged

lacy-ubc-math-project:0.1.0 #1488

merged 7 commits into from
Jan 15, 2025

Conversation

lace-wing
Copy link
Contributor

I am submitting

  • a new package
  • an update for a package

A template for University of British Columbia (UBC) MATH 100 group project.

I have read and followed the submission guidelines and, in particular, I

  • selected a name that isn't the most obvious or canonical name for what the package does
  • added a typst.toml file with all required keys
  • added a README.md with documentation for my package
  • have chosen a license and added a LICENSE file or linked one in my README.md
  • tested my package locally on my system and it worked
  • excluded PDFs or README images, if any, but not the LICENSE
  • ensured that my package is licensed such that users can use and distribute the contents of its template directory without restriction, after modifying them through normal use.

@typst-package-check typst-package-check bot changed the title lacy-ubc-math-project: initial release lacy-ubc-math-project:0.1.0 Dec 29, 2024
@typst-package-check typst-package-check bot added the new A new package submission. label Dec 29, 2024
Copy link
Member

@elegaanz elegaanz left a comment

Choose a reason for hiding this comment

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

Thank you for this package. Some small remarks:

@lace-wing
Copy link
Contributor Author

@elegaanz Resolved multiple label (function wrap) and image credit issue (drew my own).

@lace-wing
Copy link
Contributor Author

Seems like after the last commit which I updated the thumbnail, the package check never finished and my local compile exits with either 6 or 10, even if I change the image or remove reference to it, no idea why.

@elegaanz
Copy link
Member

elegaanz commented Jan 8, 2025

Love the new image 😄 You seem to have triggered a compiler bug, I will investigate a bit more what is going on and make an issue.

@elegaanz
Copy link
Member

elegaanz commented Jan 8, 2025

Okay, so I've found what the issue is, and I'm not sure if this is a compiler bug or expected behavior. Basically, with the new showcode function, you (via showman) are importing your own package. But by doing so, you trigger a new evaluation of your package, including the showcode function, that will in turn import itself, and so on until you have a stack overflow error that crashes the compiler. This would previously not happen because eval would be run only when encountering a raw block with the correct label, so as long as none of your manual page used the help module in one of the example, you were safe from this recursion.
I assume the caching of modules that Typst usually does to avoid evaluating the same file twice does not happen here because eval happen in an isolated context.

Now, I'm not sure what is the correct solution here is. I think wrapping each help section or the showcode function in a context block could be a workaround, as this would delay the evaluation until the module is actually displayed somewhere in the document. But maybe the compiler could behave better here, even if this is a bit of an edge case.

@lace-wing
Copy link
Contributor Author

I don't think it's because of the new showcode impl.
I tried git reset --hard HEAD~2 which walks back to dac03a2, but still got the 6 or 10 termination.

@elegaanz
Copy link
Member

elegaanz commented Jan 9, 2025

I can't reproduce the bug on this commit. What is your process to get the crash exactly?

@lace-wing
Copy link
Contributor Author

Simply typist c/w template/project1.typ.

@elegaanz
Copy link
Member

I made a symlink between the packages/preview/lacy-ubc-math-project directory and ~/.cache/typst/packages/preview/lacy-ubc-math-project and running typst c template/project1.typ works fine on HEAD~2. On the latest commit I get a segfault.
Which operating system are you using, and which version of Typst?

@lace-wing
Copy link
Contributor Author

macOS and 0.12.0

@lace-wing
Copy link
Contributor Author

At this point I will just remove the inline doc and get it going...

@elegaanz
Copy link
Member

If it fixes the issue, this is probably the best solution yes.

@lace-wing
Copy link
Contributor Author

@elegaanz removed inline help, now everything should compile.
P.S. my errors after git reset was because I did not also reset what was in the preview registry.

@lace-wing lace-wing requested a review from elegaanz January 13, 2025 22:42
@lace-wing lace-wing requested a review from elegaanz January 14, 2025 21:24
@elegaanz
Copy link
Member

Thanks!

@elegaanz elegaanz merged commit c88cf1a into typst:main Jan 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new A new package submission.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants