Skip to content
Topazdocs
6.05.21

Search documentation

Specification 6.0

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Download

    Tools

    Move from Topaz 5.21 to the 6.0 alpha

    Preview the edits, resolve manual changes and apply the migration with the Topaz 6.0 development CLI.

    Language mode
    6.0
    Product
    Not released

    Confirm the language mode

    Use a working copy of your 5.21 source and the 6.0 development CLI. Run topaz version --verbose and look for Language mode: topaz-6.0.

    For commands with a language option, the flag is spelled --language-version 6.0. The migration uses --from 5.21 --to 6.0 to select the source and destination editions.

    Preview the edits

    For a source file and its imports, run topaz migrate main.tpz --from 5.21 --to 6.0. For a package, run topaz migrate --from 5.21 --to 6.0 from the directory containing topaz.toml. Use --root to select another package directory.

    The preview lists changed files and the original byte ranges for proposed edits. It leaves your files untouched. In the complete preview example, the tool adds parentheses around the condition of an if.

    Review what needs manual work

    The automatic source edits add parentheses to control expressions where needed. In package mode, the tool can also update [package].language and the std dependency to 6.0. If it changes the manifest and topaz.lock exists, it regenerates the lock.

    The tool reports dependencies other than std and the [extern] and [lispex] sections as manual work. A destination diagnostic can also block the migration. Review the reported locations and complete the required changes by hand.

    See language changes from 5.21 to 6.0 for manual fixes and changes in execution results to review even after a successful check.

    Apply and recover

    After reviewing a successful preview, run the same command with --apply. Apply requires a complete 6.0 check and unchanged inputs. An incomplete check exits with code 3 before any edits are applied.

    Apply updates files at their original paths. Before writing changes, the tool records before and after hashes in .topaz-migration/active/manifest.json. It tracks progress in the adjacent journal directory. If apply is interrupted, keep these records and repeat the original command with --apply. The tool checks the recorded hashes before applying the remaining edits.

    After applying or making manual edits, check the result with topaz check main.tpz --language-version 6.0 for a standalone entry or topaz check from the package directory.