I'm looking into building the firmware on an M2 Mac.
https://github.com/Duet3D/RepRapFirmware/wiki/Building-RepRapFirmware says:
Building RepRapFirmware lately requires a tool called crc32appender to be in the user's PATH as it will be called at the end of the compilating process. It can be found as Golang source code in Tools/crc32appender together with pre-compiled binaries for Windows, Linux and MacOS x86-64.
Apparently this has been replaced with a dotnet version that is located here: https://github.com/Duet3D/CrcAppender so the documentation could be updated to indicate that newer firmwares use a different version and the location of the source code.
I tried to run the Mac x86 version on my M2 Mac, and it executes using Rosetta, but I get the error:
A fatal error occurred. The required library libhostfxr.dylib could not be found.
If this is a self-contained application, that library should exist in [...RepRapFirmware/Tools/CrcAppender/macos-x86_64/].
If this is a framework-dependent application, install the runtime in the global location [/usr/local/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet].
The .NET runtime can be found at:
- https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=osx.14-x64&apphost_version=6.0.5
Before I install dotnet, I just want to make sure, do I need to install it, or is the library libhostfxr.dylib available, or do I have some other problem?
(A prebuilt native ARM binary would be nice, although Rosetta is fine, or then one can of course compile it oneself.)
Edit: Reading https://github.com/Duet3D/CrcAppender, I see that it should be possible to make a standalone CrcAppender:
dotnet publish -r osx-x64 -p:PublishSingleFile=true --self-contained false
This will generate a standalone application without additional runtime files. See here for a full list of runtime identifiers.
So is the binary in the 3.5-dev branch supposed to be standalone, but is not?
Edit again:
I know nothing about dotnet, but just reading about it I found this:
Standalone Deployment:
When you create a standalone deployment, your application relies on the presence of the .NET runtime on the target machine. It means the target machine must have the necessary version of the .NET runtime installed in order to run the application. This is similar to how traditional .NET Framework applications have functioned.
Self-contained Deployment:
In contrast, when you create a self-contained deployment, you package the .NET runtime and the libraries that your application needs along with your application. This allows your application to be deployed and run on machines that do not have the .NET runtime installed. Self-contained deployments are larger in size compared to standalone deployments, as they include the necessary components for the application to run independently.
So apparently I need to install the .NET runtime. A self-contained binary would be really nice, but I'll go ahead install the x86 runtime for now. The requirement could be reflected in the building instructions.