smlnj 2026.1 (new formula)#281089
Conversation
|
Thanks for contributing to Homebrew! 🎉 It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request. |
|
Thanks for the PR @zbyrn. I've added labels that will allow us to skip the token check for now so we can run CI. |
|
|
||
| depends_on "autoconf" => :build | ||
| depends_on "cmake" => :build | ||
| uses_from_macos "zlib" |
There was a problem hiding this comment.
| uses_from_macos "zlib" | |
| uses_from_macos "zlib" |
|
|
||
| resource "bootarchive" do | ||
| on_arm do | ||
| url "https://smlnj.org/dist/working/2026.1/boot.arm64-unix.tgz" |
There was a problem hiding this comment.
| url "https://smlnj.org/dist/working/2026.1/boot.arm64-unix.tgz" | |
| url "https://smlnj.org/dist/working/2026.1/boot.arm64-unix.tgz", using: :nounzip |
| sha256 "ab2807d27d7ade38b09b80ac96d3de082a47aa707108728fe4edb4199caad7fd" | ||
| end | ||
| on_intel do | ||
| url "https://smlnj.org/dist/working/2026.1/boot.amd64-unix.tgz" |
There was a problem hiding this comment.
| url "https://smlnj.org/dist/working/2026.1/boot.amd64-unix.tgz" | |
| url "https://smlnj.org/dist/working/2026.1/boot.amd64-unix.tgz", using: :nounzip |
| boot_archive = resource("bootarchive").cached_download | ||
| boot_name = if Hardware::CPU.arm? | ||
| "boot.arm64-unix.tgz" | ||
| else | ||
| "boot.amd64-unix.tgz" | ||
| end | ||
| cp boot_archive, buildpath/boot_name |
There was a problem hiding this comment.
| boot_archive = resource("bootarchive").cached_download | |
| boot_name = if Hardware::CPU.arm? | |
| "boot.arm64-unix.tgz" | |
| else | |
| "boot.amd64-unix.tgz" | |
| end | |
| cp boot_archive, buildpath/boot_name | |
| buildpath.install resource("bootarchive") |
| libexec.mkpath | ||
| cd buildpath do | ||
| ENV["INSTALLDIR"] = libexec.realpath.to_s | ||
| system "./build.sh" | ||
|
|
||
| %w[ | ||
| sml asdlgen heap2exec ml-antlr ml-build ml-burg ml-makedepend ml-ulex ml-yacc | ||
| ].each do |cmd| | ||
| bin.write_exec_script libexec/"bin/#{cmd}" | ||
| end | ||
| end |
There was a problem hiding this comment.
I noticed this builds its own LLVM. We should use Homebrew's LLVM.
cda519c to
9aa68f8
Compare
|
|
||
| livecheck do | ||
| url :homepage | ||
| regex(%r{href=["']?dist/working/(\d+(?:\.\d+)+)/index\.html["' >]}i) |
There was a problem hiding this comment.
| regex(%r{href=["']?dist/working/(\d+(?:\.\d+)+)/index\.html["' >]}i) | |
| regex(%r{href=["']?[^"' >]*dist/working/v?(\d+(?:\.\d+)+)/(?:index\.html)?["' >]}i) |
This general livecheck approach seems fine but this suggestion adds some small tweaks for the sake of flexibility:
- Adds
[^"' >]*before the URL path, so the regex will continue to match if the URLs become absolute or additional directories are added at the start of the path. - Adds
v?before the version regex to use our standard pattern. - Makes
index.htmloptional, as the server successfully serves the page with it omitted and upstream could potentially remove it from these URLs in the future. Since we're anchoring the end of thehrefattribute with["' >], this will continue to match only links to version pages (not other links likeREADME.html).
Add SML/NJ as a source-built formula. This is intended to replace the existing smlnj cask, which uses an un-notarized macOS package installer.
|
Thanks, @p-linnane and @samford, for your quick review! I've incorporated all your suggestions, and I learned a lot! The build script needs to build LLVM because we actually have a fork of LLVM (smlnj/smlnj-llvm-21.1) that supports our own calling conventions. While we are working to eventually upstream it, the current system only works with the customized LLVM. |
This PR adds SML/NJ as a source-built formula.
SML/NJ is currently available in Homebrew as a cask that installs the published macOS
.pkginstaller. That installer is not notarized, and the cask is already scheduled for removal later this year. This formula provides a replacement.In addition, while the cask installs the legacy compiler, the formula installs the development compiler, which offers native ARM support.
The formula builds from the source distribution, using a bootstrapping compiler from the official website. The main installer script
./build.shruns completely offline when the bootstrapping compiler is present.I am one of the maintainers of SML/NJ, and I believe the formula-based installation is better-suited for Homebrew users. I am also happy to maintain this formula going forward.
Companion PR: Homebrew/homebrew-cask#262856.
Note: The current CI failure is due to the token conflict with the existing
smlnjcask, which is being removed in the companion PR.HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>?brew test <formula>?brew audit --strict <formula>(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it passbrew audit --new <formula>?