beamable / BeamableProduct

The beamable product suite including com.beamable, com.beamable.server, microservice base image, portal, the installer, and build scripts
Other
5 stars 0 forks source link

HMR doesn't work on 1.19.21 for C#MS that are pulled in from UPM #3531

Open cdhanna opened 3 months ago

cdhanna commented 3 months ago

Hot Module Reload doesn't work when the C#MS is referenced through Unity Package Manager.

When you reference a package via UPM, the files end up in /Library/PackageCache unless the UPM reference using the file:// schema, in which case, the files just don't get copied anywhere; because UPM knows where the file:// files are.

When HMR is enabled, the source files are only loaded into the container via bind-mounts. However, the bind-mounts are broken for UPM referenced C#MS, and therefor the dotnet process fails to compile the source code (because it doesn't exist).

As a workaround, you can simply disable HMR.

As a hint for how the Dockerfile is generated, look at the DockerGenerator.GetString function.

Very likely, the issue is that the FileUtils.GetFullSourcePath function isn't working when the C#MS exists outside of Assets or Packages

cdhanna commented 3 months ago

This is worth a quick research mission, spend a few hours looking at this, and if we can't easily fix it, we'll re-assess priority for 1.x release vs 2.x release.