tingerrr / typst-test

A test runner for typst projects.
https://tingerrr.github.io/typst-test/
MIT License
27 stars 2 forks source link

Allow more than one typst version #31

Open tingerrr opened 4 months ago

tingerrr commented 4 months ago

There are three approaches to this problem:

  1. Provide a fixed set of typst versions which are supported per typst-test version.
    • lots of duplicated code to make rustc happy
    • will likely make typst-test watch almost impossible to implement
  2. Provide a set of dynamic libraries that can be loaded, which expose a stable ABI of some kind.
    • This locks typst test into a position where this ABI needs to be stable for multiple versions of typst itself, possibly requiring lots of work to keep up with typst unstable nature
    • dynamic linking is very hard to do correctly in rust at this moment
    • a well-thought-out API could load many versions of typst from various versions of typst test, making bug fixes independent of typst versions
  3. provide on canonical version and a fallback that simply calls a system installation as before
    • some features can simply not be provided (like watch)
    • requires either parsing the command's output or throwing it at the user without any extra formatting
    • any version of typst can possibly be supported

I am unsure which would be the best option to support more than one version at a time, perhaps a user just has to install more than one version of typst-test the same way they'd install more than one version of typst itself to test older versions.

tingerrr commented 3 months ago

The Typst API is too unstable at the moment to consider the first and second option. I'll either implement the third option as a fallback for users, or not offer this until Typst is more stable.

DeveloperPaul123 commented 1 month ago

With the breaking changes with typst 0.12 that was recently released, it would be nice if typst-test could fall back to using the system typst fore compiling tests.

Right now, my test code is failing because it cannot be compiled due to updates with typst 0.12 specific changes.

tingerrr commented 1 month ago

That is something I considered, but I haven't had time to properly think it over and implement it yet. Mainly because calling the system version is so different from how I handle compiled documents internally.

That being said, you can try running d68a449b, which uses 0.12, but I can't promise the commit won't disappear because of me rewriting the commit history on that branch, it's purely local changes that I sync with a stash branch between machines. Alternatively, the current ci-semi-stable tag/branch should still be able to use the system version.

DeveloperPaul123 commented 1 month ago

That's understandable. I will use the ci-semi-stable for now. Thanks!