Take care to only deploy release builds #171

Open
opened 2026-07-21 18:31:27 +00:00 by Vectornaut · 0 comments
Member

Summary

As of pull request #159, the deployment packaging script just packs up whatever the last build happens to be. This makes it easy to accidentally deploy a development build, since Cargo uses the development profile unless you ask for a different one. Development builds typically run slower, and this sluggishness is very noticeable during realizations—including the ones that happen when you're nudging. We therefore have an interest in ensuring that public-facing builds are done in release mode.

Implementation ideas

  • The quickest fix would be to have the deployment packaging script do a release build before packaging.
  • A cleaner fix would be to use Trunk to build and package in one breath by calling trunk build with build.dist set to the deployment folder. This can be done from the command line using the --dist option.

Both of these ideas would make the packaging script touch the target folder in addition to deploy (and the quick fix would make it touch dist as well). That doesn't feel like a big deal to me.

## Summary As of pull request #159, the [deployment packaging script](https://code.studioinfinity.org/StudioInfinity/dyna3/src/branch/main/tools/package-for-deployment.sh) just packs up whatever the last build happens to be. This makes it easy to accidentally deploy a development build, since Cargo uses the [development profile](https://doc.rust-lang.org/cargo/reference/profiles.html#dev) unless you ask for a different one. Development builds typically run slower, and this sluggishness is very noticeable during realizations—including the ones that happen when you're nudging. We therefore have an interest in ensuring that public-facing builds are done in release mode. ## Implementation ideas - The quickest fix would be to have the deployment packaging script do a release build before packaging. - A cleaner fix would be to use Trunk to build and package in one breath by calling `trunk build` with [`build.dist`](https://trunk-rs.github.io/trunk/guide/configuration/index.html#build-section) set to the deployment folder. This can be done from the command line using the `--dist` option. Both of these ideas would make the packaging script touch the `target` folder in addition to `deploy` (and the quick fix would make it touch `dist` as well). That doesn't feel like a big deal to me.
Sign in to join this conversation.
No description provided.