Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
50 changes: 50 additions & 0 deletions .github/install-zig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""Install the exact, checksum-verified release used by this repository's CI."""

import hashlib
import json
import os
import platform
import subprocess
import tarfile
import urllib.request
import zipfile
from pathlib import Path


def main():
root = Path(__file__).resolve().parent.parent
version = (root / '.zig-version').read_text().strip()
metadata = json.loads((root / '.github/zig-release.json').read_text())
if version != '0.17.0' or metadata['version'] != version:
raise RuntimeError('Expected exact Zig 0.17.0')
architecture = {'x86_64': 'x86_64', 'AMD64': 'x86_64',
'arm64': 'aarch64', 'aarch64': 'aarch64'}[platform.machine()]
system = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'}[platform.system()]
artifact = metadata['artifacts'][f'{architecture}-{system}']
if not artifact['tarball'].startswith('https://ziglang.org/download/0.17.0/'):
raise RuntimeError('Expected an official release archive')
directory = Path(os.environ['RUNNER_TEMP']) / 'rayslides-zig'
directory.mkdir()
archive = directory / ('zig.zip' if system == 'windows' else 'zig.tar.xz')
with urllib.request.urlopen(artifact['tarball'], timeout=180) as response:
archive.write_bytes(response.read())
if hashlib.sha256(archive.read_bytes()).hexdigest() != artifact['shasum']:
raise RuntimeError('Zig archive checksum mismatch')
if system == 'windows':
with zipfile.ZipFile(archive) as package:
package.extractall(directory)
compiler, = directory.glob('*/zig.exe')
else:
with tarfile.open(archive) as package:
package.extractall(directory, filter='data')
compiler, = directory.glob('*/zig')
actual = subprocess.check_output([str(compiler), 'version'], text=True).strip()
if actual != version:
raise RuntimeError(f'Expected {version}, downloaded {actual}')
with open(os.environ['GITHUB_PATH'], 'a', encoding='utf-8') as output:
output.write(str(compiler.parent) + '\n')
print(f'Installed Zig {actual} for {architecture}-{system}')


if __name__ == '__main__':
main()
13 changes: 13 additions & 0 deletions .github/setup-python-env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Keep the baseline harness dependencies in a runner-local virtualenv."""
import os
import subprocess
import venv
from pathlib import Path

root = Path(os.environ['RUNNER_TEMP']) / 'rayslides-python'
venv.EnvBuilder(with_pip=True).create(root)
binary_dir = root / ('Scripts' if os.name == 'nt' else 'bin')
python = binary_dir / ('python.exe' if os.name == 'nt' else 'python')
subprocess.run([str(python), '-m', 'pip', 'install', 'Pillow==12.3.0'], check=True)
with open(os.environ['GITHUB_PATH'], 'a', encoding='utf-8') as output:
output.write(str(binary_dir) + '\n')
87 changes: 87 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Native correctness

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: rayslides-verify-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
name: Native ${{ matrix.os }} / ${{ matrix.optimize }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
optimize: [debug, safe]
runs-on: ${{ matrix.os }}
timeout-minutes: 40
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install exact checksum-verified Zig
run: python .github/install-zig.py
- name: Install isolated Python harness dependencies
run: python .github/setup-python-env.py
- name: Install Linux graphics and editor dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libasound2-dev xvfb neovim
- name: Install macOS editor
if: runner.os == 'macOS'
run: brew install neovim
- name: Record native environment
shell: bash
run: |
mkdir -p "$RUNNER_TEMP/rayslides-ci"
{ git rev-parse HEAD; zig version; python --version; } > "$RUNNER_TEMP/rayslides-ci/environment.log"
python -c 'import platform; print(platform.platform()); print(platform.machine())' >> "$RUNNER_TEMP/rayslides-ci/environment.log"
if [ "${{ runner.os }}" != "Windows" ]; then nvim --version >> "$RUNNER_TEMP/rayslides-ci/environment.log"; fi
- name: Build and verify built-in editor
shell: bash
run: |
set -euo pipefail
zig build verify -Doptimize=${{ matrix.optimize }} -Dneovim=false -j2 --summary all 2>&1 | tee "$RUNNER_TEMP/rayslides-ci/default.log"
- name: CLI smoke
shell: bash
run: python tools/zig_port_smoke.py --binary zig-out/bin/rayslides${{ runner.os == 'Windows' && '.exe' || '' }} --output "$RUNNER_TEMP/rayslides-ci/cli" --cli-only
- name: Build and verify embedded editor
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
zig build verify neovim-probe neovim-runtime-test -Doptimize=${{ matrix.optimize }} -Dneovim=true -j2 --summary all 2>&1 | tee "$RUNNER_TEMP/rayslides-ci/neovim.log"
- name: Linux no-display startup behavior
if: runner.os == 'Linux' && matrix.optimize == 'safe'
shell: bash
run: python tools/zig_port_smoke.py --binary zig-out/bin/rayslides --output "$RUNNER_TEMP/rayslides-ci/no-display" --no-display
- name: Linux software-rendered framebuffer smoke
if: runner.os == 'Linux' && matrix.optimize == 'safe'
shell: bash
env:
LIBGL_ALWAYS_SOFTWARE: '1'
run: xvfb-run -a python tools/zig_port_smoke.py --binary zig-out/bin/rayslides --output "$RUNNER_TEMP/rayslides-ci/render" --neovim
- name: Build macOS application bundle
if: runner.os == 'macOS' && matrix.optimize == 'safe'
shell: bash
run: |
set -euo pipefail
zig build macos-app -Doptimize=safe -Dneovim=true -j2 --summary all 2>&1 | tee "$RUNNER_TEMP/rayslides-ci/package.log"
test -f zig-out/Rayslides.app/Contents/MacOS/rayslides
- name: Upload native verification evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: rayslides-${{ matrix.os }}-${{ matrix.optimize }}-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/rayslides-ci
if-no-files-found: warn
retention-days: 14
32 changes: 32 additions & 0 deletions .github/zig-release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"artifacts": {
"aarch64-linux": {
"shasum": "9e8d11661d4ae3bd57702a3832781e23ad151dde5798e16a5ccd503f65234ff8",
"size": "52877280",
"tarball": "https://ziglang.org/download/0.17.0/zig-aarch64-linux-0.17.0.tar.xz"
},
"aarch64-macos": {
"shasum": "b607e9b9234790a008116ae5bdb71c6243b84b9fb42a53a9e70fde41c06c536a",
"size": "53985220",
"tarball": "https://ziglang.org/download/0.17.0/zig-aarch64-macos-0.17.0.tar.xz"
},
"x86_64-linux": {
"shasum": "1cbe9df9f27e6b78d14ccbca43b6703a404ef79ef1c463de901d7f088d4e2026",
"size": "57332648",
"tarball": "https://ziglang.org/download/0.17.0/zig-x86_64-linux-0.17.0.tar.xz"
},
"x86_64-macos": {
"shasum": "4f9a1c5269aa17ebda5e6d3c2b89d6cbf36f7d2b22a0306e9ab98f25f95529c6",
"size": "59317572",
"tarball": "https://ziglang.org/download/0.17.0/zig-x86_64-macos-0.17.0.tar.xz"
},
"x86_64-windows": {
"shasum": "b5663f69581dcf391293fbf16c06cb80d81d806545ce618b4d0bab7f0eb8c428",
"size": "100268137",
"tarball": "https://ziglang.org/download/0.17.0/zig-x86_64-windows-0.17.0.zip"
}
},
"signature_verification": "Ed25519 prehashed minisign archive and trusted-comment signatures verified against the official download-page public key",
"signing_key": "RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U",
"version": "0.17.0"
}
1 change: 1 addition & 0 deletions .zig-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.17.0
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ With Rayslides, you can:

## Get started

Rayslides requires Zig 0.16.x. The minimum version is Zig 0.16.0.
Rayslides requires exact Zig 0.17.0 (see `.zig-version`).

```sh
zig build -Doptimize=ReleaseSafe
Expand Down Expand Up @@ -73,6 +73,16 @@ Blockers make either command exit nonzero. The portable command refuses an
existing destination, rewrites copied asset references under `assets/`, then
re-opens and preflights the copy before it succeeds.

The correctness harness needs Python 3 and Pillow (`python3 -m pip install Pillow`).
Run correctness checks in both modes. Repeat with `-Dneovim=true` to qualify
its optional C bindings, protocol, and editor modules:

```sh
zig build verify -Doptimize=debug
zig build verify -Doptimize=safe
zig build -Dneovim=true neovim-probe neovim-runtime-test
```

During development, use `zig build run -- talk.sld`. On macOS,
`zig build -Doptimize=ReleaseSafe macos-app` also creates
`zig-out/Rayslides.app`.
Expand Down Expand Up @@ -175,6 +185,7 @@ every mode above `640x480`.

## Project status

- [Read the Zig 0.17 migration evidence and platform limits](docs/ZIG_0_17_MIGRATION.md)
- [Read the unreleased four-topic release notes](RELEASE_NOTES.md)
- [Follow the active product roadmap](ROADMAP.md)

Expand Down
Loading
Loading