Migrating from Golem 1.6
This page lists the changes and the kept behaviors that matter when you move an application from Golem 1.6 to Golem 2.0.
Component presets
Rust and MoonBit presets can behave differently
Golem 2.0 keeps the toolchain behavior of the Rust and MoonBit presets, as in 1.6. The debug and release presets build the same source, but the program can behave differently between them:
- Rust:
debugchecks integer overflow and runsdebug_assert!, andreleasedoes neither. These are Cargo’s defaults for thedevandreleaseprofiles, and the generatedCargo.tomldoes not change them. For example,u8::MAX + 1on a runtime value panics indebugand gives0inrelease. - MoonBit: a file that a package’s
targetsoption gives adebugorreleasecondition is compiled only into the matching build, so the two presets can compile different files. Golem does not check or warn about these conditions.
You do not have to change your application. The built-in Rust and MoonBit templates select debug for the local environment and release for the cloud environment, so test with golem build --yes -P release before you deploy. See How the presets differ for each SDK.