This directory contains utilities for managing MoonBit toolchains and checksums.
Script to obtain the Windows MoonBit checksum for the checksum registry.
Usage:
./get_windows_checksum.shWhat it does:
- Attempts to download the Windows version of MoonBit
- Computes the SHA256 checksum
- Shows how to update the checksum registry
- Cleans up temporary files
Note: The Windows download may timeout or fail if the Windows version is not yet available from the MoonBit CLI.
To add support for additional platforms:
Download the MoonBit binary for your platform from the official source.
# For macOS/Linux
shasum -a 256 moonbit-*.tar.gz
# For Windows
sha256sum moonbit-*.zipEdit moonbit/checksums/moonbit.json and add the platform information:
{
"versions": {
"0.6.33": {
"platforms": {
"your_platform": {
"sha256": "computed_checksum_here",
"url_suffix": "moonbit-your_platform.tar.gz",
"binaries": ["moon"]
}
}
}
}
}Build the examples to ensure the new platform works:
bazel build //examples/simple:simple_libThe checksum registry (moonbit/checksums/moonbit.json) contains:
- versions: MoonBit versions with their platform-specific information
- platforms: Platform-specific download and checksum information
- sha256: SHA256 checksum for verification
- url_suffix: Filename for the download
- binaries: Executable names in the archive
Platform names follow this convention:
- macOS Apple Silicon:
darwin_arm64ordarwin_aarch64 - macOS Intel:
darwin_amd64ordarwin_x86_64 - Linux x86_64:
linux_amd64 - Linux ARM64:
linux_arm64 - Windows x86_64:
windows_amd64
All downloads are verified using SHA256 checksums. This ensures:
- Integrity: Files are not corrupted
- Authenticity: Files come from official sources
- Reproducibility: Same checksums produce same results
If downloads fail:
- Check your internet connection
- Verify the URL is correct
- Check if the platform/version is available
- Try again later (may be temporary issue)
If checksums don't match:
- Verify you downloaded the correct file
- Recompute the checksum
- Check for file corruption
- Update the registry if needed
To add new tools or improve existing ones:
- Create a new script in this directory
- Add documentation to this README
- Test thoroughly
- Submit a pull request
All tools should follow the existing patterns and include proper error handling.