Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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.*"
25 changes: 12 additions & 13 deletions Formula/cartesi-machine-emulator.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
18 changes: 18 additions & 0 deletions Formula/cartesi-machine-guest-tools.rb
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions Formula/cartesi-machine-linux-image.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "5dbfb76e39ea0749cb96be113bfdf546d94d53dc167acc433ae8dc8676aa7bbc"
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
Expand Down
10 changes: 5 additions & 5 deletions Formula/cartesi-machine-rootfs-image.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "8143010ab08b493b315c4cb9d2c048f410dfb58ec77c42e9a3f93b5ed5805585"
sha256 ventura: "9fa0384f4a16e1269f8103b63f74407572352f732b00b2d01398b99ab40dc82b"
Comment thread
edubart marked this conversation as resolved.
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
Expand Down
13 changes: 3 additions & 10 deletions Formula/cartesi-machine.rb
Original file line number Diff line number Diff line change
@@ -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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name it cartesi-machine-guest-tools-rootfs-image because it is not really guest tools.

Copy link
Copy Markdown
Member Author

@tuler tuler Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we decide that the formula should install more things from the machine-guest-tools, like put the riscv64 guest tools somewhere so developers can use it in builds.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name cartesi-machine-guest-tools is reserved for the package that installs guest-tools inside riscv64 guests (see cartesi/linux-packages#1), so the naming here is conflicting, because cartesi-machine-guest-tools is exactly the name used in Debian/Ubuntu/Alpine riscv64 to install libcmt, etc.

like put the riscv64 guest tools somewhere so developers can use it in builds.

Then that would be something like cartesi-machine-guest-tools-images, or cartesi-machine-guest-tools-packages or whatever depending on what it provides.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main initial issue was actually the package version, which cannon go backwards.
I don't mind much about the package name, as long as it makes sense.
We could even have a single package named cartesi-machine-images that includes the linux image and the rootfs image, but then what version number we use.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way back when, when we discussed what to name these packages, we had decided on

cartesi-machine-emulator: the emulator binaries etc
cartesi-machine-rootfs-image: roofs.ext2
cartesi-machine-linux-image: linux.bin
cartesi-machine: meta package that installs all three

cartesi-machine-guest-tools should really only be the source for the guest package that is installed inside rootfs.ext2. It only produces a rootfs.ext2 so it can test stuff in CI, right? The fact we are using the rootfs.ext2 for other purposes is a historical mistake. We should really be getting the rootfs.ext2 from a different repo, the cartesi-machine-rootfs-image repo. Indeed, there is a tag there that we could use, currently at v0.20.0-test1 that I wanted to promote to "real life".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand better the issue now. The 0.20.0-test1 is a rootfs package produced with manually signed packages produced by @edubart

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the same way Diego did on MacPorts at https://github.com/cartesi/macports-ports/blob/main/ports/emulators/cartesi-machine-rootfs-image/Portfile

That is, use cartesi-machine-rootfs-image with version 0.17.2 pointing to rootfs-tools.ext2 from machine-guest-tools.

This is also the same way currently on linux-packages PR cartesi/linux-packages#1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can’t do the same way he did, because brew does not allow to go to version 0.17.2.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can’t we all go back to how it was and release a proper machine-rootfs-image repo?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edubart I already upgraded it to simply create the rootfs.ext2 from a Dockerfile. But we need to fix the guest tools package signature situation.

depends_on "cartesi-machine-linux-image"
depends_on "cartesi-machine-rootfs-image"

def install
# This is a metapackage
Expand Down