diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6e594c8..8fa6111 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,10 +15,10 @@ jobs: pull-requests: write steps: - name: Set up Homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main - name: Set up git - uses: Homebrew/actions/git-user-config@master + uses: Homebrew/actions/git-user-config@main - name: Pull bottles env: @@ -29,7 +29,7 @@ jobs: run: brew pr-pull --debug --tap="$GITHUB_REPOSITORY" "$PULL_REQUEST" - name: Push commits - uses: Homebrew/actions/git-try-push@master + uses: Homebrew/actions/git-try-push@main with: token: ${{ github.token }} branch: main diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dc1fe55..6967548 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,15 +10,15 @@ jobs: test-bot: strategy: matrix: - os: [ubuntu-22.04, macos-13, macos-14] + os: [macos-26] runs-on: ${{ matrix.os }} steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main - name: Cache Homebrew Bundler RubyGems - uses: actions/cache@v4 + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: ${{ steps.set-up-homebrew.outputs.gems-path }} key: ${{ matrix.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} @@ -35,7 +35,7 @@ jobs: - name: Upload bottles as artifact if: always() && github.event_name == 'pull_request' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: bottles_${{ matrix.os }} path: "*.bottle.*" diff --git a/Formula/cartesi-machine-emulator.rb b/Formula/cartesi-machine-emulator.rb index 952ec8e..fe8af17 100644 --- a/Formula/cartesi-machine-emulator.rb +++ b/Formula/cartesi-machine-emulator.rb @@ -1,25 +1,19 @@ class CartesiMachineEmulator < Formula desc "Off-chain implementation of the Cartesi Machine" homepage "https://github.com/cartesi/machine-emulator" - url "https://github.com/cartesi/machine-emulator/archive/refs/tags/v0.19.0.tar.gz" - sha256 "1a33fb7e0dd7030656ddbb214dcd2f5a569f64e906edb20f149b66b34e1e0dd3" + url "https://github.com/cartesi/machine-emulator/archive/refs/tags/v0.20.0.tar.gz" + sha256 "3746abb72d45dd2388f79fc24b048fe306db8e1f9f7e072176e51b95c4453949" license "LGPL-3.0-only" - bottle do - root_url "https://ghcr.io/v2/cartesi/tap" - sha256 arm64_sonoma: "28c8e21cdfd975b693161bc7db6d20a4e3f1258806fb22be6913d2ecf4ab9e28" - sha256 cellar: :any, ventura: "0c03b6c31cbf09766fd61792e42a07c2d141cb622b0be2ffae477028aeef4c3d" - sha256 cellar: :any_skip_relocation, x86_64_linux: "f5fa9046162e7d49c91483b8aeec84ced3e8f79ab17d41bb0bc865527fdc371d" - end - - depends_on "boost@1.85" => :build + depends_on "boost" => :build depends_on "pkg-config" => :build + depends_on "libomp" depends_on "libslirp" - depends_on "lua" + depends_on "lua@5.4" patch :p1 do - url "https://github.com/cartesi/machine-emulator/releases/download/v0.19.0/add-generated-files.diff" - sha256 "a892e2d9f5c331f5e80bcb5db4133e7db625aa4d14ffdf9467b75c4c34d1744f" + url "https://github.com/cartesi/machine-emulator/releases/download/v0.20.0/add-generated-files.diff" + sha256 "d9c2afcefc2759e7cd37bbedc83d54c81515f0fddb671103b489b8789aee33bb" end def install @@ -28,6 +22,11 @@ def install (share/"cartesi-machine").mkpath system "make", "BREW_PREFIX=#{prefix}" system "make", "install", "PREFIX=#{prefix}", "IMAGES_RUNTIME_PATH=#{cartesi_prefix.realpath}" + + # lua@5.4 is keg-only, so `lua5.4` is not on PATH at runtime. Rewrite the + # generated wrapper scripts to invoke it by absolute path. + inreplace [bin/"cartesi-machine", bin/"cartesi-machine-stored-hash"], + /^lua5\.4 /, "#{Formula["lua@5.4"].opt_bin}/lua5.4 " end test do diff --git a/Formula/cartesi-machine-guest-tools.rb b/Formula/cartesi-machine-guest-tools.rb new file mode 100644 index 0000000..e25358b --- /dev/null +++ b/Formula/cartesi-machine-guest-tools.rb @@ -0,0 +1,18 @@ +class CartesiMachineGuestTools < Formula + desc "Set of tools to help the development of Cartesi Machine applications" + homepage "https://github.com/cartesi/machine-guest-tools" + VERSION = "v0.17.2".freeze + ROOTFS_IMAGE = "rootfs-tools.ext2".freeze + url "https://github.com/cartesi/machine-guest-tools/releases/download/#{VERSION}/#{ROOTFS_IMAGE}" + sha256 "675a49e3c9bada29f25d5b559707b34553b94280c03f44ccb8203c2cf453b541" + license "GPL-2.0-only" + + def install + share.install self.class::ROOTFS_IMAGE + (etc/"cartesi/images").install_symlink share/self.class::ROOTFS_IMAGE => "rootfs.ext2" + end + + test do + assert_path_exists etc/"cartesi/images/rootfs.ext2" + end +end diff --git a/Formula/cartesi-machine-linux-image.rb b/Formula/cartesi-machine-linux-image.rb index 72003fa..2d2cd45 100644 --- a/Formula/cartesi-machine-linux-image.rb +++ b/Formula/cartesi-machine-linux-image.rb @@ -1,6 +1,11 @@ class CartesiMachineLinuxImage < Formula desc "Kernel image for the Cartesi Machine" homepage "https://github.com/cartesi/machine-linux-image" + VERSION = "0.20.0".freeze + LINUX_IMAGE = "linux-6.5.13-ctsi-1-v#{VERSION}.bin".freeze + url "https://github.com/cartesi/image-kernel/releases/download/v#{VERSION}/#{LINUX_IMAGE}" + sha256 "65dd100ff6204346ac2f50f772721358b5c1451450ceb39a154542ee27b4c947" + license "GPL-2.0-only" bottle do root_url "https://ghcr.io/v2/cartesi/tap" @@ -8,11 +13,6 @@ class CartesiMachineLinuxImage < Formula sha256 cellar: :any_skip_relocation, ventura: "096a8524db3dc659c957a0186cf6b34d95eff25e48325652e96cbad843406727" sha256 cellar: :any_skip_relocation, x86_64_linux: "9a025f231e8f5a76bcdaca2ed1e284e1ac8f7996f219b7c6fbcc2d92206fcdee" end - VERSION = "0.20.0".freeze - LINUX_IMAGE = "linux-6.5.13-ctsi-1-v#{VERSION}.bin".freeze - url "https://github.com/cartesi/image-kernel/releases/download/v#{VERSION}/#{LINUX_IMAGE}" - sha256 "65dd100ff6204346ac2f50f772721358b5c1451450ceb39a154542ee27b4c947" - license "GPL-2.0-only" def install share.install self.class::LINUX_IMAGE diff --git a/Formula/cartesi-machine-rootfs-image.rb b/Formula/cartesi-machine-rootfs-image.rb index 3fcf7ea..22f514c 100644 --- a/Formula/cartesi-machine-rootfs-image.rb +++ b/Formula/cartesi-machine-rootfs-image.rb @@ -1,6 +1,11 @@ class CartesiMachineRootfsImage < Formula desc "Rootfs image for the Cartesi Machine" homepage "https://github.com/cartesi/machine-guest-tools" + VERSION = "v0.20.0-test1".freeze + ROOTFS_IMAGE = "rootfs-ubuntu.ext2".freeze + url "https://github.com/cartesi/machine-rootfs-image/releases/download/#{VERSION}/#{ROOTFS_IMAGE}" + sha256 "a38dbf39bdadc644bb31f1fc427be037b3082c9007afe1d9f2220b20d2789271" + license "GPL-2.0-only" bottle do root_url "https://ghcr.io/v2/cartesi/tap" @@ -8,11 +13,6 @@ class CartesiMachineRootfsImage < Formula sha256 ventura: "9fa0384f4a16e1269f8103b63f74407572352f732b00b2d01398b99ab40dc82b" sha256 cellar: :any_skip_relocation, x86_64_linux: "6372d211183ce4852a94c8a537651e2ad8fcb2e51f9aa75f7bf081ee54b2e706" end - VERSION = "v0.20.0-test1".freeze - ROOTFS_IMAGE = "rootfs-ubuntu.ext2".freeze - url "https://github.com/cartesi/machine-rootfs-image/releases/download/#{VERSION}/#{ROOTFS_IMAGE}" - sha256 "a38dbf39bdadc644bb31f1fc427be037b3082c9007afe1d9f2220b20d2789271" - license "GPL-2.0-only" def install share.install self.class::ROOTFS_IMAGE diff --git a/Formula/cartesi-machine.rb b/Formula/cartesi-machine.rb index 405425b..bae97d2 100644 --- a/Formula/cartesi-machine.rb +++ b/Formula/cartesi-machine.rb @@ -1,20 +1,13 @@ class CartesiMachine < Formula desc "Meta package for the Cartesi Machine" homepage "https://cartesi.io" - url "https://github.com/cartesi/machine-emulator/archive/refs/tags/v0.19.0.tar.gz" - sha256 "1a33fb7e0dd7030656ddbb214dcd2f5a569f64e906edb20f149b66b34e1e0dd3" + url "https://github.com/cartesi/machine-emulator/archive/refs/tags/v0.20.0.tar.gz" + sha256 "3746abb72d45dd2388f79fc24b048fe306db8e1f9f7e072176e51b95c4453949" license "LGPL-3.0-only" - bottle do - root_url "https://ghcr.io/v2/cartesi/tap" - sha256 cellar: :any_skip_relocation, arm64_sonoma: "8edb6724dffd2ad487d61da3eaab1781f2eb96a65a71af696c812e6286b39bfa" - sha256 cellar: :any_skip_relocation, ventura: "d2c7400e88c12432cf55971ea9ae6edbaf72fa30c14ceeafd0b3f17148b6ffcb" - sha256 cellar: :any_skip_relocation, x86_64_linux: "b3da1acd61897dfd758e257c433140d5e8f53260beec15cb1b21933f90d41e48" - end - depends_on "cartesi-machine-emulator" + depends_on "cartesi-machine-guest-tools" depends_on "cartesi-machine-linux-image" - depends_on "cartesi-machine-rootfs-image" def install # This is a metapackage