sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.61k stars 97 forks source link

Many warnings like "Please substitute 'SILE.length()' with 'SILE.types.length()'." after update #2053

Closed jodros closed 3 weeks ago

jodros commented 3 weeks ago

Maybe that's a dumb question... But after have compiled the newest version I got a lot of these warnings when I call SILE:

! SILE.measurement() was deprecated in SILE v0.15.0. Please use SILE.types.measurement() instead.
  In order to keep things tidy internally, more easily allow 3rd party
  packages to override core functions, and substitute some slow bits
  with Rust modules, internal types have been moved from the top level
  SILE global to a types namespace.

  Please substitute 'SILE.measurement()' with 'SILE.types.measurement()'.

  at    <nowhere>

Yes, I know about this change in the API, however I currently don't have any package installed, only SILE itself compiled from this repository!

alerque commented 3 weeks ago

Not your mistake. We had several usages of deprecated APIs still in use internally. The warning message system is hard to test because you have to artificially build a release with a fake future version to trigger them. The commits b6dbc2c, cd4f7af, 422b667, 74987a8, and eb3dd75 were all related to fixing these warinings in v0.15.0, and v0.15.1 included them. There shouldn't be any more now.

Also just a note for you or anybody, even if you don't use CaSILE, you might find the upgrade-lua.sed script it includes useful. About half of it is irrelevant (and harmless) but the other half is all automated updates for deprecated SILE stuff. The usual usage would be casile make -- upgrade_casile, but you can just download the script linked using the raw download and running with something like sed -i -f upgrade-lua.sed your_lua_file.lua. It should be safe to run on *.sil files too unless you happen to be writing prose about SILE APIs.

@Omikhleia Just pinging you since you might find that tested list of search/replaces useful at some point.