Skip to content

Releases

Masa v1.8.1 — brew polish: bounded curl, per-formula info lookup, linear JSON walk

Choose a tag to compare

@ClausValcaTD ClausValcaTD released this 18 Nov 18:20

Masa v1.8.1 is a focused performance and reliability polish of the
Homebrew layer added in v1.8.0 — no behaviour changes to the compiler, the
runtime or the terminal, just a masa brew that never hangs and never
drowns in a 30 MB index.

Highlights

masa brew can no longer hang on a stalled mirror

Every curl call now goes through one helper carrying a 10 s connect
timeout and a 60 s overall limit
:

masa brew update   # download formula.json
masa brew fetch wget   # download one formula's archive

A slow, half-open or wedged mirror now fails with a clear message instead of
blocking forever.

masa brew info <name> no longer needs the whole index

masa brew info <name> used to require a prior masa brew update that
downloaded the full ~30 MB formula.json. Now, when that cache is
missing — or simply does not hold the name — it queries the tiny
per-formula endpoint instead:

# No `masa brew update` needed; hits <base>/formula/wget.json (~2 KB)
masa brew info wget

$MASA_BREW_API_BASE still overrides the https://formulae.brew.sh/api
base, and a file:// base (or a bare path) is read straight from disk, so
the whole path stays testable offline.

Strictly linear JSON walk

The dependency-free JSON reader sized each decoded string's buffer to the
rest of the document, which made a full walk of formula.json quadratic
in both time and allocation. It now measures each string first, so the scan
is strictly O(N). On a 12.6 MB index:

before after
masa brew info (worst case) ~301 s ~0.25 s

— roughly a 1200× speed-up, with no change to the parsed results.

Everything from before

v1.8.1 builds on v1.8.0 (a full multi-tab masa-term with scrollback and
clipboard, pbcopy/pbpaste shims and the online Homebrew index), v1.7.0
(online Homebrew taps, casks and partial Flutter/Dart framework stubs),
v1.6.0 (Danroot Layer 5 — clean-room AppKit and CoreGraphics over SDL2),
v1.5.0 (the cross-architecture bridge), v1.4.0 (CoreFoundation + Objective-C
runtimes), v1.3.0 (virtual root) and v1.2.0 (dynamic library loading) — see
the README.

Packages

Platform Archive
Linux x86_64 masa-1.8.1-linux-x86_64.tar.gz / .zip
Windows x86_64 masa-1.8.1-windows-x86_64.tar.gz / .zip
Android aarch64 masa-1.8.1-android-aarch64.tar.gz / .zip

Each archive contains the masa binary, the README.md and the LICENSE.
Verify with sha256sum -c SHA256SUMS.

Verification

  • 131 core tests, 0 failed, 3 skipped (qemu-aarch64, Android NDK and
    empty-SDK cases not available on the build host).
  • 78 GUI tests, 0 failed, under SDL_VIDEODRIVER=dummy.
  • Clean under gcc and clang with ASan + UBSan, zero leaks.
  • MinGW-w64 Windows cross-build and NDK aarch64 Android build both link
    clean.

This release was prepared by an AI agent (OpenHands) on behalf of the Masa
maintainers.

Masa v1.8.0 — multi-tab terminal, clipboard shims, online brew index

Choose a tag to compare

@ClausValcaTD ClausValcaTD released this 17 Nov 20:43

Masa v1.8.0 turns the GUI terminal into a real daily driver, brings the
macOS clipboard to the shim layer, and makes the Homebrew formula index
queryable offline.

Highlights

masa-term: tabs, scrollback and copy/paste

masa-term grows from a single window into an iTerm2-style terminal:

  • Up to 16 tabs, each with its own pseudo-terminal and its own libvterm
    screen — Ctrl-Shift-T to open, Ctrl-Shift-W to close, Ctrl-Tab (or a
    click on the new tab bar) to switch.
  • Per-tab scrollback — the last 1000 scrolled-off lines, browsed with the
    mouse wheel or Shift-PageUp/Shift-PageDown; any other keystroke snaps
    back to the live screen.
  • Mouse selection and copy/paste — drag to select, Ctrl-Shift-C to copy
    through SDL's clipboard, Ctrl-Shift-V to paste (newlines become Return).

masa-term

pbcopy / pbpaste shims

macOS scripts pipe to pbcopy and read back with pbpaste; both are now Masa
shims, created by masa init-shims and active inside masa exec and
masa shell. They prefer a reachable host clipboard tool (wl-copy/wl-paste,
xclip, xsel) and otherwise keep a clean local clipboard file, so the round
trip works with no display — CI, a headless container. The file defaults to
$TMPDIR/masa-clipboard and is pinned with $MASA_CLIPBOARD_FILE.

echo "hello" | pbcopy
pbpaste        # hello

masa brew update / info / search

masa brew gains an online formula index:

masa brew update        # fetch formula.json into the cache
masa brew info wget     # version, description, homepage, dependencies
masa brew search ssl    # case-insensitive name search

masa brew update downloads formula.json with curl -fSL (a file:// URL
or a bare path is copied locally, so it is testable offline) into
$MASA_BREW_CACHE. info and search read it through a small
dependency-free JSON reader (src/brew.c) — no jq, no Ruby.
$MASA_BREW_API_BASE overrides the https://formulae.brew.sh/api base.

Everything from before

v1.8.0 builds on v1.7.0 (online Homebrew taps, casks and partial
Flutter/Dart framework stubs), v1.6.0 (Danroot Layer 5 — clean-room AppKit and
CoreGraphics over SDL2), v1.5.0 (the cross-architecture bridge), v1.4.0
(CoreFoundation + Objective-C runtimes), v1.3.0 (virtual root) and v1.2.0
(dynamic library loading) — see the README.

Packaging and verification

  • 130 core tests / 0 failed and 78 GUI tests / 0 failed, gcc and
    clang, with AddressSanitizer + UndefinedBehaviorSanitizer and zero leaks.
  • Zero compiler warnings (-std=c11 -Wall -Wextra -Werror).
  • Cross-builds clean with MinGW-w64 (Windows) and the Android NDK
    (aarch64).
  • make dist produces archives for Linux, Windows and Android
    with a SHA256SUMS file.

Downloads

Archive Target
masa-1.8.0-linux-x86_64.tar.gz / .zip Linux x86_64
masa-1.8.0-windows-x86_64.tar.gz / .zip Windows x86_64 (MinGW-w64)
masa-1.8.0-android-aarch64.tar.gz / .zip Android aarch64 (Termux)

Verify with sha256sum -c SHA256SUMS.

Masa v1.7.0 — online brew, casks & partial Flutter/Dart framework stubs

Choose a tag to compare

@ClausValcaTD ClausValcaTD released this 17 Nov 19:58

Masa v1.7.0 — online masa brew, Homebrew Casks and partial Flutter/Dart framework stubs

Milestone 17. Masa's Homebrew support goes online and the clean-room stub SDK
learns the macOS frameworks a Flutter/Dart desktop binary imports at load
time.

masa brew — casks, taps and verified downloads

masa brew now understands Homebrew Casks (cask "name" do ... end)
alongside formulas. masa brew lint auto-detects which one a .rb is and
checks a cask's required fields (version, sha256, url and an
app/pkg/binary artifact), warning (not failing) on a missing desc or
homepage.

Two new subcommands make the Homebrew support online:

  • masa brew tap <user/repo> clones (or fast-forwards)
    homebrew-<repo> into a local tap tree and lists the formulas and casks it
    ships. $MASA_BREW_TAPS sets the tree; $MASA_BREW_TAP_BASE overrides the
    https://github.com base (a mirror or an offline test).
  • masa brew fetch <formula_or_cask.rb> downloads the declared url and
    verifies it against the declared sha256, failing on a mismatch. A
    file:// URL is copied from the local filesystem, so fetch works and is
    fully testable offline; http(s) URLs are fetched with curl -fSL.

The digest check is backed by a new clean-room SHA-256 (src/sha256.c,
FIPS 180-4, no OpenSSL dependency), validated against the NIST ""/"abc"
vectors and a 120-byte message that exercises the padding edge case.

Partial macOS framework stubs — Metal, QuartzCore, Security, IOKit

The stub SDK now ships partial clean-room stubs for the frameworks a
Flutter/Dart-style desktop binary imports at load time — Metal,
QuartzCore, Security and IOKit — plus libz and libc++
(headers, .tbd files and a libc++.tbd symlink). Each advertises only the
symbols Danroot can satisfy, so a binary that links against them resolves
every import and runs.

Danroot shims the ones that matter:

  • CACurrentMediaTime maps to the host monotonic clock.
  • SecRandomCopyBytes fills its buffer from /dev/urandom.
  • MTLCreateSystemDefaultDevice / MTLCopyAllDevices return NULL cleanly —
    Metal is not emulated; a missing GPU is something every caller already
    handles, and Masa says so on stderr instead of crashing.

Everything else

  • All Milestone 1–16 capabilities are unchanged: masa cc / masa swiftc,
    masa run / masa danroot (Layers 1–5), masa xcode build, masa pack
    (.dmg/.ipa), masa sdk, masa shell, masa-term, masa doctor and
    make dist.

Verification

  • Core suite: 126 tests / 0 failed / 1 skipped (the Android NDK test skips
    when ANDROID_CC is absent), built with both gcc and clang under
    -Wall -Wextra -Werror -fsanitize=address — zero warnings, zero leaks.
  • GUI suite (SDL_VIDEODRIVER=dummy make test-gui): 41 tests / 0 failed /
    0 skipped
    , zero leaks.
  • MinGW-w64 (Windows) and, where an NDK is present, Android cross-builds are
    clean.
  • make dist produces the Linux and Windows archives below and
    sha256sum -c SHA256SUMS verifies every one.

Downloads

Artifact Platform
masa-1.7.0-linux-x86_64.tar.gz / .zip Linux x86_64
masa-1.7.0-windows-x86_64.tar.gz / .zip Windows x86_64
SHA256SUMS checksums for all of the above

An Android archive is produced automatically by CI (and by any make dist
run that has ANDROID_CC set) and is attached there.


This release description was written by an AI agent (OpenHands) on behalf of
the Masa maintainers.

Masa v1.6.1

Choose a tag to compare

@ClausValcaTD ClausValcaTD released this 17 Nov 19:18

Masa v1.6.1 — build, package and run macOS Mach-O binaries on Linux,
Windows and Android, with no Mac, no Xcode and no Apple SDK.

This release rolls up everything since the last published release (v1.2.0):
the Danroot loader matured from "runs a self-contained Mach-O executable" into
a layered Darwin environment that loads dynamic libraries, virtualises the
filesystem, provides CoreFoundation and Objective-C runtimes, bridges Apple
Silicon images on x86_64 hosts, and now opens a real window for a Darwin GUI
program. It also carries the documentation, screenshot and build fixes that
make the distribution archives build cleanly.

Highlights

Danroot Layer 5 — AppKit & CoreGraphics over SDL2 (v1.6.0)

A clean-room AppKit and CoreGraphics built on SDL2. A program that
calls NSApplication/NSWindow through the Objective-C runtime and draws with
CGContextFillRect gets an SDL2 window with those rectangles painted on
screen. The run loop redraws each frame and replays every fill the program made
before entering it, so an app that draws once and then calls [NSApp run]
still shows its content. Built only into build/masa-gui (make gui,
-DMASA_DANROOT_SDL2); the core tool and its tests stay 100% SDL2-free and
report a clear rebuild with make gui hint for the first GUI symbol they
cannot satisfy.

Danroot Layer 4 — cross-architecture bridge (v1.5.0)

Run an arm64-apple-darwin Mach-O image on an x86_64 host: masa run hands
the image to qemu-aarch64 driving a Linux ARM64 build of Masa, with
stack-varargs trampolines that keep a bridged program's formatted output
correct. Both pieces are discovered automatically.

Danroot Layer 3 — CoreFoundation & Objective-C runtimes (v1.4.0)

Clean-room CoreFoundation (CFString, CFArray, allocators) and
Objective-C/Foundation (objc_getClass, sel_registerName, variadic
objc_msgSend, NSLog, autorelease pools). Also fixes arm64 linking by
exporting and shimming __stack_chk_fail / __stack_chk_guard.

Danroot Layer 2 — virtual root and POSIX shims (v1.3.0)

A proot-style virtual root (--root / MASA_DANROOT_ROOT) that maps
/Users, /Applications, /Library, /System and friends under a host
directory, plus Darwin struct stat/struct dirent ABI translation and
mach_absolute_time / mach_timebase_info shims.

Layer 1 — dynamic libraries and the loader core

masa run / masa danroot execute a Mach-O MH_EXECUTE and recursively load
its MH_DYLIB dependencies (load commands, the exports trie as lld encodes it,
@rpath/@executable_path/@loader_path, rebases then binds), all in-process.

Building, packaging and tooling

  • masa cc, masa swiftc, masa sdk init-stub — real Mach-O executables and
    dylibs from clang + LLVM's ld64.lld against a clean-room stub SDK.
  • masa xcode build — build a checked-in .xcodeproj and bundle the .app.
  • masa brew lint / masa brew build — lint a Homebrew formula and build it
    into a Cellar.
  • masa pack --dmg / --ipa — write a UDIF disk image or a
    Payload/<App>.app ZIP from scratch in C11.
  • masa doctor — report whether this host can cross-build Mach-O.
  • masa-term — a standalone SDL2 + libvterm terminal running masa shell on a
    real PTY (screenshot in the README).

Fixes in v1.6.1

  • scripts/dist.sh omitted src/danroot_appkit.c, so the native and Windows
    archives failed to link (dr_gui_* undefined). The distribution archives now
    build.
  • The Android NDK compile test and the Windows cross-compile CI job had the
    same omission; both source lists now include the Danroot runtime units.
  • The GUI test suite no longer reports the 1032-byte session allocation inside
    libdbus-1 (reached through SDL2's D-Bus backend, reproducible with a bare
    SDL2 program) as a leak — scripts/lsan.supp matches only libdbus-1 frames,
    so Masa's own allocations are still checked.

Verified

  • make test — 113 tests, 0 failed, 1 skipped (gcc, ASan).
  • SDL_VIDEODRIVER=dummy make test-gui — 41 tests, 0 failed.
  • make dist — Linux and Windows archives with sha256sum -c SHA256SUMS
    passing; zero compiler warnings.

Assets

  • masa-1.6.1-linux-x86_64.tar.gz / .zip — the masa CLI for Linux x86_64.
  • masa-1.6.1-windows-x86_64.tar.gz / .zip — the masa CLI for Windows x86_64.
  • SHA256SUMS — SHA-256 checksums for every archive above.

Android archives are produced by make dist when ANDROID_CC points at an NDK
clang (the NDK was not present in the release build environment).

These release notes were generated by an AI agent (OpenHands) on behalf of the Masa maintainers.

Masa v1.2.0 — Masa Danroot Layer 1

Choose a tag to compare

@ClausValcaTD ClausValcaTD released this 17 Nov 05:49

Masa v1.2.0 — Masa Danroot Layer 1

The Masa Danroot loader (masa run / masa danroot) now loads dynamic
libraries, and the built-in libSystem shim grows the POSIX and Darwin
system calls a linked program needs.

Dynamic library loading

  • Follows LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB and LC_REEXPORT_DYLIB in
    both MH_EXECUTE and MH_DYLIB images, recursively, so a library's own
    dependencies are loaded too. A module is registered before recursing, so
    a cyclic reference resolves instead of looping.
  • Resolves dependency paths the dyld way: @executable_path/,
    @loader_path/ and @rpath/ (against LC_RPATH, plus
    MASA_LIBRARY_PATH / DYLD_LIBRARY_PATH), absolute paths, and bare
    names on those search paths and the loading image's directory.
  • A missing required dependency is a clear error; a missing weak one is
    skipped and a weak import binds to NULL.
  • /usr/lib/libSystem.B.dylib and /usr/lib/libSystem.dylib are never
    read from disk — the built-in shim satisfies them.
  • Indexes each image's exports from LC_DYLD_EXPORTS_TRIE (with an
    LC_SYMTAB fallback) and resolves cross-image binds, applying chained
    fixups (DYLD_CHAINED_PTR_64 / _64_OFFSET) or the classic
    LC_DYLD_INFO_ONLY rebase/bind opcodes per module.

Expanded libSystem shim

  • Standard I/O: fopen, fclose, fread, fwrite, fgets, fputs,
    fseek, ftell, feof, ferror, fflush, sprintf, snprintf,
    vsnprintf, sscanf.
  • File descriptors: lseek, access, unlink, mkdir, rmdir,
    getcwd, chdir.
  • Strings/memory: strcat, strncat, strchr, strrchr, strstr,
    strdup, strndup, strerror.
  • Process/environment: setenv, unsetenv, getpid, getuid, isatty,
    usleep, sleep.
  • Darwin system information: uname (reporting Darwin) and
    sysctlbyname (kern.ostype, kern.osrelease, hw.machine,
    hw.ncpu, hw.memsize, ...).
  • Dynamic linker: dlopen, dlsym, dlclose, dlerror, wired into the
    same resolver. Standard streams exposed as data symbols (__stdoutp
    and friends).

Stub SDK

  • Adds a dylib1.o link stub so masa cc -dynamiclib links, expands the
    libSystem.tbd symbol list, and adds unistd.h, fcntl.h, dlfcn.h,
    sys/stat.h, sys/utsname.h, sys/sysctl.h.

Example

masa sdk init-stub /opt/masa/sdk
MASA_SDK_PATH=/opt/masa/sdk masa cc -dynamiclib helper.c -o libhelper.dylib \
    -install_name @rpath/libhelper.dylib
MASA_SDK_PATH=/opt/masa/sdk masa cc main.c -L. -lhelper \
    -Wl,-rpath,@executable_path -o app
masa run ./app

Verification

102 tests run, 0 failed, 1 skipped (the optional SDL2 GUI target), clean
under AddressSanitizer + UndefinedBehaviorSanitizer with -Werror, on
both gcc and clang; the Windows (MinGW-w64) cross-build is clean.

This release was prepared by an AI agent (OpenHands) on behalf of the
repository owner.

Masa v1.1.0 — Masa Danroot

Choose a tag to compare

@ClausValcaTD ClausValcaTD released this 16 Nov 21:15

Masa v1.1.0 — Masa Danroot

Build a Mach-O binary on Linux, then run it on Linux — in-process.

Masa is a cross-compilation wrapper and Darwin environment shim: it builds
macOS Mach-O binaries on a non-macOS host without Xcode, and now it can
execute a self-contained one directly, with no VM and no kernel module.

Highlights

  • masa run / masa danroot — a clean-room, in-process reimplementation
    of the dyld steps a self-contained executable needs: segment mapping,
    relocation, a libSystem shim, and the LC_MAIN entry call.
  • Both relocation formats. The loader applies LC_DYLD_CHAINED_FIXUPS
    (clang-19 and newer) and the classic LC_DYLD_INFO_ONLY rebase/bind
    opcodes (older ld64.lld, such as the clang-18 on Ubuntu 24.04). A binary
    built by either toolchain runs unchanged.
  • POSIX hosts. Linux and Android/Termux. The loader is architecture
    matched: build for the host's architecture.

Everything from earlier milestones is included: the cc/swiftc wrappers,
masa xcode build, masa brew, masa pack (.dmg/.ipa), masa doctor,
masa exec/masa shell, the masa-term GUI terminal, and the toolchain
shims (ld, ar, ranlib, strip, nm, otool, codesign).

Quick start

make
masa sdk init-stub /opt/masa/sdk
MASA_SDK_PATH=/opt/masa/sdk masa cc hello.c -o hello
masa danroot ./hello

License

GNU General Public License v3.0 or later.

Masa v1.0.0

Choose a tag to compare

@ClausValcaTD ClausValcaTD released this 16 Nov 16:47

Masa v1.0.0

Cross-platform Mach-O build & Darwin environment.

Masa is a cross-compilation wrapper and Darwin environment shim: it builds
macOS Mach-O binaries on a non-macOS host, without Xcode, by driving clang
and answering the platform queries that macOS build systems make. Licensed
under the GNU General Public License v3.0 or later.

Highlights

  • masa cc — clang wrapper that injects the target triple, the SDK sysroot
    and ld64.lld, producing real Mach-O MH_EXECUTE output.
  • masa sys — shims uname, sw_vers, xcode-select and xcrun so build
    systems detect Darwin.
  • masa exec / masa shell — run commands (and an interactive shell) inside
    a shimmed environment with the toolchain shims first on PATH.
  • masa sdk — reports SDK readiness and writes a clean-room stub SDK (TAPI
    v4 .tbd files + crt1.o + standard headers) that is enough to link.
  • masa xcode — a clean-room project.pbxproj parser and builder: turns a
    checked-in .xcodeproj into a real Mach-O executable, with --bundle laying
    it out as a <Product>.app.
  • masa brew — a Ruby-free Homebrew formula linter and builder that lays out
    a Cellar, with correct system semantics (single-string commands run through
    /bin/sh -c, multi-argument commands run directly).
  • masa swift — Swift toolchain support: the swiftc wrapper plus
    masa swift info / masa swift build for Package.swift projects.
  • masa pack --dmg / --ipa — a pure-C11 packager that turns a .app bundle
    into a UDIF .dmg (with a koly trailer and blkx block table) or an .ipa
    (a ZIP with the app under Payload/<App>.app/), with no external tools.
  • masa doctor — a local macOS cross-build readiness report.
  • masa-term — an optional standalone GUI terminal (SDL2 + SDL2_ttf +
    libvterm) over a real PTY.
  • codesign shim — answers ad-hoc codesign -s - and codesign --verify
    so signing steps in build scripts succeed.

Platforms

  • Linux (native build), Windows (x86_64-w64-mingw32), and Android
    (NDK clang) are supported; make dist packages the build reproducibly.

Verification

  • make test: 92 tests, 0 failed, under -std=c11 -Wall -Wextra -Werror -fsanitize=address (zero warnings, zero leaks).
  • SDL_VIDEODRIVER=dummy make test-gui: 20 tests, 0 failed.
  • make dist + sha256sum -c SHA256SUMS: all artifacts verify.

Assets

  • masa-1.0.0-linux-x86_64.tar.gz / .zip
  • masa-1.0.0-windows-x86_64.tar.gz / .zip
  • SHA256SUMS

This release description was generated by an AI agent (OpenHands) on behalf of
the maintainer.