Migration Guide for Pure
Version 1 (Pure) vs Version 2 (Pure 2)
Pure 2 breaks backward compatibility. You may need to do the following:
- Standalone scripts should explicitly add
using static System.Console; - When importing DLLs, Pure no longer automatically imports
Mainclass, so you will want to import needed things manually. E.g.using static <MyLibrary>.Main;
Pure 2 is NOT backward compatible with Pure (1), however, it's likely Pure (1) will be forward compatible with Pure 2 to some extent.
.Net 7 to .Net 8
In general, this upgrade brings no breaking changes in terms of API or Pure language core construct behaviors. (The only known change is Notebook's executable path)
Below lists the steps we've taken for migrating from .Net 7 to .Net 8, which might serve as reference for future upgrades:
- Replace all mentioning of .Net 7 in source code to .Net 8 and fix related comments/codes; Search for:
.net 7andnet7 - Change all
.csprojto target net 8 - Make sure all project package references are upgraded accordingly, especially concerning code compilation services; We can search globally
7.0to identify such locations; Update module dependancies related toMicrosoft.CodeAnalysis.CSharp - Run all available unit tests
- Update
PublishAll.ps1script if there is anydotnetCLI arguments syntax change - Increment and update CoreVersion variable and corresponding changelog string.
- Test and make sure
Importstill work (as implemented inTryDownloadNugetPackage), and targets .Net 8 - Delete everything from Publish and .vs folder and build fresh; Delete
AppData\Local\Temp\Pure\NugetDownloads - Follow and double check with https://learn.microsoft.com/en-us/aspnet/core/migration/70-80 for additional steps
- Good thing we are not using Blazor or ASP.Net Core or any other larger framework otherwise migration can be a hassle - and we should keep avoid doing that in the future
- Core libraries: Make sure ODBC and Razor works
- Update organization page stating we are using .Net 8 instead of .Net 7
We can identify the following as "fragile" components that's .Net version sensitive:
- Core module's dependancy on Roslyn compilation services
- Razor module's dependancy on RazorEngine.NetCore
- Behavior of
Importmacro - Any windows-specific modules (e.g. plotting)
User Upgrade Guide
- Decide whether upgrade is necessary based on whether referenced NuGet packages in user scripts are incompatible with .Net 8
- Run .Net 8 runtime AND ASP.Net Core hosting bundle: (For windows) ASP.Net Core Hosting Bundle, .Net 8 Runtime, .Net Desktop Runtime
- Install latest Pure distribution
- Make sure all modules in
PATHthat user script depends on are updated and built for. Net 8 - (THIS STEP IS NECESSARY) Delete contents in
AppData\Local\Temp\Pure\NugetDownloadsfolder for a fresh start - BREAKING CHANGE: If
Notebookis used, its path has been moved, so one might need to modify Windows shortcut target path or update new executable path to environmentPATH- it's now in<Pure Distribution Folder>\Windows\Notebook.exe