diff --git a/.github/nightly-signing-policy.json b/.github/nightly-signing-policy.json
index 6b6099e7b6..55d2a1983c 100644
--- a/.github/nightly-signing-policy.json
+++ b/.github/nightly-signing-policy.json
@@ -38,27 +38,32 @@
"applicability": "required"
},
{
- "name": "gate / test 1/5 (ubuntu-24.04)",
+ "name": "gate / test 1/6 (ubuntu-24.04)",
"app_id": 15368,
"applicability": "required"
},
{
- "name": "gate / test 2/5 (ubuntu-24.04)",
+ "name": "gate / test 2/6 (ubuntu-24.04)",
"app_id": 15368,
"applicability": "required"
},
{
- "name": "gate / test 3/5 (ubuntu-24.04)",
+ "name": "gate / test 3/6 (ubuntu-24.04)",
"app_id": 15368,
"applicability": "required"
},
{
- "name": "gate / test 4/5 (ubuntu-24.04)",
+ "name": "gate / test 4/6 (ubuntu-24.04)",
"app_id": 15368,
"applicability": "required"
},
{
- "name": "gate / test 5/5 (ubuntu-24.04)",
+ "name": "gate / test 5/6 (ubuntu-24.04)",
+ "app_id": 15368,
+ "applicability": "required"
+ },
+ {
+ "name": "gate / test 6/6 (ubuntu-24.04)",
"app_id": 15368,
"applicability": "required"
},
@@ -118,7 +123,9 @@
}
},
"max_artifact_bytes": 2147483648,
- "automatic_signer_actors": [],
+ "automatic_signer_actors": [
+ "github-actions[bot]"
+ ],
"platforms": {
"windows-x86_64": {
"unsigned_artifact_name": "nightly-unsigned-windows-x86_64",
diff --git a/.github/scripts/release-rpm-smoke.py b/.github/scripts/release-rpm-smoke.py
new file mode 100644
index 0000000000..3d70cca7c1
--- /dev/null
+++ b/.github/scripts/release-rpm-smoke.py
@@ -0,0 +1,74 @@
+"""Check a real installed release RPM and exercise the GUI control channel."""
+
+import json
+import os
+from pathlib import Path
+import secrets
+import socket
+import subprocess
+import time
+import tempfile
+
+
+def run_smoke(results):
+ requirements = (results / "rpm-requires.txt").read_text()
+ for capability in (
+ "libc.so.6()(64bit)",
+ "libm.so.6(GLIBC_2.35)(64bit)",
+ "libgcc_s.so.1()(64bit)",
+ "libxkbcommon.so.0()(64bit)",
+ "(libvulkan.so.1()(64bit) or libEGL.so.1()(64bit))",
+ ):
+ if capability not in requirements.splitlines():
+ raise RuntimeError(f"Missing RPM requirement: {capability}")
+
+ version = subprocess.check_output(["vectorcraft-cli", "--version"], text=True)
+ (results / "cli-version.txt").write_text(version)
+ # Original fixture authored for this package smoke test; no external artwork.
+ fixture = results / "original-smoke.svg"
+ fixture.write_text('')
+ token = secrets.token_hex(32)
+ with tempfile.TemporaryDirectory(prefix="vectorcraft-runtime-") as runtime, (results / "gui.log").open("w") as log:
+ env = dict(os.environ, VECTORCRAFT_NO_PREFS="1", XDG_RUNTIME_DIR=runtime,
+ VECTORCRAFT_CONTROL_TOKEN=token)
+ app = subprocess.Popen([
+ "vectorcraft", "--control", "32180", "--automation-read-root", str(results),
+ "--automation-write-root", str(results), str(fixture),
+ ], stdout=log, stderr=subprocess.STDOUT, env=env)
+ try:
+ deadline = time.monotonic() + 90
+ while True:
+ if app.poll() is not None:
+ raise RuntimeError(f"GUI exited during startup: {app.returncode}")
+ try:
+ channel = socket.create_connection(("127.0.0.1", 32180), timeout=5)
+ break
+ except OSError:
+ if time.monotonic() >= deadline:
+ raise RuntimeError("GUI control channel did not become ready") from None
+ time.sleep(1)
+ channel.settimeout(30)
+ with channel, channel.makefile("rwb") as stream:
+ for request_id, method, params in (
+ (0, "auth", {"token": token}),
+ (1, "ui.inspect", {}),
+ ):
+ stream.write((json.dumps(dict(id=request_id, method=method, params=params)) + "\n").encode())
+ stream.flush()
+ response = json.loads(stream.readline())
+ (results / f"{method}.json").write_text(json.dumps(response, indent=2))
+ if response.get("id") != request_id or response.get("ok") is not True:
+ raise RuntimeError(f"GUI request failed: {method}")
+ finally:
+ app.terminate()
+ try:
+ app.wait(timeout=10)
+ except subprocess.TimeoutExpired:
+ app.kill()
+ app.wait()
+
+
+if __name__ == "__main__":
+ run_smoke(Path("/results"))
diff --git a/.github/scripts/tests/test_release_rpm_smoke.py b/.github/scripts/tests/test_release_rpm_smoke.py
new file mode 100644
index 0000000000..9d92237534
--- /dev/null
+++ b/.github/scripts/tests/test_release_rpm_smoke.py
@@ -0,0 +1,116 @@
+"""Exercise failures that an installed-package happy-path check cannot reproduce."""
+import importlib.util
+import json
+from pathlib import Path
+import subprocess
+import tempfile
+import unittest
+from unittest.mock import MagicMock, patch
+
+spec = importlib.util.spec_from_file_location("rpm_smoke", Path(__file__).parents[1] / "release-rpm-smoke.py")
+smoke = importlib.util.module_from_spec(spec)
+spec.loader.exec_module(smoke)
+
+
+class SmokeLifecycleTests(unittest.TestCase):
+ def setUp(self):
+ self.folder = tempfile.TemporaryDirectory()
+ self.addCleanup(self.folder.cleanup)
+ self.results = Path(self.folder.name)
+ (self.results / "rpm-requires.txt").write_text("\n".join([
+ "libc.so.6()(64bit)", "libm.so.6(GLIBC_2.35)(64bit)",
+ "libgcc_s.so.1()(64bit)", "libxkbcommon.so.0()(64bit)",
+ "(libvulkan.so.1()(64bit) or libEGL.so.1()(64bit))",
+ ]))
+ self.app = MagicMock()
+ self.app.poll.return_value = None
+ self.channel = MagicMock()
+ self.stream = self.channel.makefile.return_value.__enter__.return_value
+ self.stream.readline.side_effect = [
+ b'{"id":0,"ok":true}\n', b'{"id":1,"ok":true,"result":{"window":"fixture"}}\n',
+ ]
+ self.runtime = None
+
+ def launch(*args, **kwargs):
+ self.runtime = Path(kwargs["env"]["XDG_RUNTIME_DIR"])
+ self.assertTrue(self.runtime.is_dir())
+ return self.app
+
+ self.launch = self.start_patch(smoke.subprocess, "Popen", side_effect=launch)
+ self.start_patch(smoke.subprocess, "check_output", return_value="vectorcraft-cli 0.25.0\n")
+ self.connect = self.start_patch(smoke.socket, "create_connection", return_value=self.channel)
+ self.start_patch(smoke.time, "sleep")
+
+ def start_patch(self, owner, name, **kwargs):
+ patcher = patch.object(owner, name, **kwargs)
+ result = patcher.start()
+ self.addCleanup(patcher.stop)
+ return result
+
+ def assert_cleaned_up(self):
+ self.app.terminate.assert_called_once()
+ self.assertFalse(self.runtime.exists())
+
+ def test_success_records_inspection_and_removes_private_runtime(self):
+ smoke.run_smoke(self.results)
+ report = json.loads((self.results / "ui.inspect.json").read_text())
+ self.assertEqual(report["result"], {"window": "fixture"})
+ requests = [json.loads(call.args[0]) for call in self.stream.write.call_args_list]
+ self.assertEqual(requests[0]["method"], "auth")
+ self.assertEqual(requests[0]["params"]["token"], self.launch.call_args.kwargs["env"]["VECTORCRAFT_CONTROL_TOKEN"])
+ self.assert_cleaned_up()
+
+ def test_missing_runtime_dependency_prevents_launch(self):
+ (self.results / "rpm-requires.txt").write_text("")
+ with self.assertRaisesRegex(RuntimeError, "Missing RPM requirement"):
+ smoke.run_smoke(self.results)
+ self.launch.assert_not_called()
+
+ def test_child_exit_during_startup_is_a_failure(self):
+ self.app.poll.return_value = 1
+ self.app.returncode = 1
+ with self.assertRaisesRegex(RuntimeError, "exited during startup"):
+ smoke.run_smoke(self.results)
+ self.assert_cleaned_up()
+
+ def test_connection_is_retried_until_ready(self):
+ self.connect.side_effect = [OSError("not ready"), self.channel]
+ smoke.run_smoke(self.results)
+ self.assertEqual(self.connect.call_count, 2)
+ self.assert_cleaned_up()
+
+ def test_startup_timeout_stops_child(self):
+ self.connect.side_effect = OSError("not ready")
+ self.start_patch(smoke.time, "monotonic", side_effect=[0, 91])
+ with self.assertRaisesRegex(RuntimeError, "did not become ready"):
+ smoke.run_smoke(self.results)
+ self.assert_cleaned_up()
+
+ def test_auth_refusal_prevents_inspection(self):
+ self.stream.readline.side_effect = [b'{"id":0,"ok":false}\n']
+ with self.assertRaisesRegex(RuntimeError, "request failed: auth"):
+ smoke.run_smoke(self.results)
+ self.assertFalse((self.results / "ui.inspect.json").exists())
+ self.assert_cleaned_up()
+
+ def test_response_for_another_request_is_rejected(self):
+ self.stream.readline.side_effect = [b'{"id":0,"ok":true}\n', b'{"id":99,"ok":true}\n']
+ with self.assertRaisesRegex(RuntimeError, "request failed: ui.inspect"):
+ smoke.run_smoke(self.results)
+ self.assert_cleaned_up()
+
+ def test_malformed_response_still_stops_child(self):
+ self.stream.readline.side_effect = [b'not json\n']
+ with self.assertRaises(json.JSONDecodeError):
+ smoke.run_smoke(self.results)
+ self.assert_cleaned_up()
+
+ def test_unresponsive_child_is_killed_after_termination_timeout(self):
+ self.app.wait.side_effect = [subprocess.TimeoutExpired("vectorcraft", 10), 0]
+ smoke.run_smoke(self.results)
+ self.app.kill.assert_called_once()
+ self.assert_cleaned_up()
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/.github/workflows/cache-prune.yml b/.github/workflows/cache-prune.yml
index a79f1ed907..c1b1e73ae3 100644
--- a/.github/workflows/cache-prune.yml
+++ b/.github/workflows/cache-prune.yml
@@ -1,11 +1,10 @@
name: Cache prune
-# A pass of the cache prune after every CI attempt on main. ci.yml's `cache prune` job prunes while
-# a run's jobs save their entries, but "Re-run failed jobs" re-runs only the failed jobs: a re-run
-# `cache warm` leg saves a new entry, and the prune job, which succeeded in the first attempt, does
-# not run again. The entry it replaced would stay until the next main run, and with it the cache
-# would be over its 10 GB budget, where GitHub evicts entries a run still needs. This runs once
-# after every attempt, re-runs and canceled runs included (craft-common-actions actions/cache-prune).
+# Keeps one rolling gate entry on main, so the repository stays within its 10 GB Actions cache
+# budget, where GitHub evicts entries a run still needs. Each main CI attempt's `cache warm` leg
+# saves a new rolling entry; this deletes the entry it replaced once the attempt ends. It runs once
+# after every attempt, re-runs of failed jobs and canceled runs included (craft-common-actions
+# actions/cache-prune).
on:
workflow_run:
workflows: [CI]
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e7ae30d3ca..9937d6165c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -39,18 +39,19 @@ jobs:
dev-strip: true
# The workspace crates also build without line tables. A panic still names its file and line.
dev-debug: "0"
- # Five legs instead of one: shards 1 to 4 each build and run the tests of their own crates,
- # and shard 5 runs the other `cargo xtask ci` steps (xtask/src/shards.rs). `gate ()`
- # passes only when all five did. On pushes to main, a `cache warm` leg builds what every
- # shard builds and saves the dependency cache.
- test-shards: 5
+ # Six legs instead of one: shards 1 and 2 each build vectorcraft-ui-egui's tests and run
+ # half of them, shards 3 to 5 each build and run the tests of their own crates, and shard 6
+ # runs the other `cargo xtask ci` steps (xtask/src/shards.rs). `gate ()` passes only
+ # when all six did. On pushes to main, a `cache warm` leg builds what every shard builds and
+ # saves the dependency cache.
+ test-shards: 6
shard-command: cargo xtask ci shard
warm-command: cargo xtask ci warm
# The dependency cache also keeps the compiled workspace crates and test executables, so a
# pull request's shards rebuild only the crates its changes reach. Each main run's `cache
# warm` leg saves a rolling entry of its own, every leg restores the newest one, and
- # `cache-prune` below deletes the one it replaced. The nightly run restores nothing and
- # builds everything from source.
+ # cache-prune.yml deletes the one it replaced after each attempt. The nightly run restores
+ # nothing and builds everything from source.
cache-workspace-crates: true
cold-build: ${{ github.event_name == 'schedule' }}
packages: >-
@@ -58,32 +59,6 @@ jobs:
libxrandr-dev libxi-dev libfontconfig1-dev libfreetype-dev mesa-vulkan-drivers
libgl1-mesa-dev
- # Keeps one rolling gate entry on main, so the repository stays within its 10 GB Actions cache
- # budget. It runs beside the gate and prunes each time the `cache warm` leg finishes saving. A
- # failed prune warns instead of failing the run, and cache-prune.yml prunes again after every
- # attempt, re-runs of failed jobs included. `watch-minutes` is longer than the gate's
- # `timeout-minutes`, so the watch outlasts a cold `cache warm` leg.
- cache-prune:
- name: cache prune
- if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
- runs-on: ubuntu-24.04
- timeout-minutes: 170
- permissions:
- actions: write
- steps:
- - name: Harden runner
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
- with:
- egress-policy: audit
- - name: Prune replaced cache entries
- uses: storytold/craft-common-actions/actions/cache-prune@main
- continue-on-error: true
- with:
- watch: true
- watch-minutes: 160
- saving-jobs: |
- ^gate( / cache warm \(.*\))?$
-
# The nightly cold run never restores the rolling crates entry, so the old entry is only overlap
# while the cold run saves its own: two entries of about 4.6 GB, which with the others go over the
# 10 GB cache limit and get the corpus, SonarCloud and Windows ARM64 entries evicted. This deletes
diff --git a/.github/workflows/nightly-dispatch.yml b/.github/workflows/nightly-dispatch.yml
index dd4a4a02da..4ef372c40b 100644
--- a/.github/workflows/nightly-dispatch.yml
+++ b/.github/workflows/nightly-dispatch.yml
@@ -11,9 +11,9 @@ permissions: {}
jobs:
dispatch:
- # SOURCE PREPARATION: literal off until immutable shared tooling and policy qualification.
+ # Enabled for automated scheduled producer completions on main.
if: >-
- false && github.repository == 'storytold/vectorcraft' &&
+ github.repository == 'storytold/vectorcraft' &&
github.event_name == 'workflow_run'
runs-on: ubuntu-latest
timeout-minutes: 5
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 0e963e43e1..c2224a81ba 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -1,8 +1,9 @@
name: VectorCraft unsigned nightly
-# Enabled for supervised manual runs by the reviewed manual actor only; no schedule yet.
-# A later explicit opt-in may add a cadence (and turn on nightly-dispatch.yml with it).
+# Automated daily nightly builds at 06:30 UTC, plus supervised manual runs by reviewed manual actors.
on:
+ schedule:
+ - cron: '30 6 * * *'
workflow_dispatch:
permissions:
diff --git a/.github/workflows/print.yml b/.github/workflows/print.yml
index 8cdaf0cb28..ac941b5098 100644
--- a/.github/workflows/print.yml
+++ b/.github/workflows/print.yml
@@ -7,9 +7,26 @@ on:
- "apps/vectorcraft/Cargo.toml"
- "apps/vectorcraft/src/printing.rs"
- "apps/vectorcraft/src/printing/**"
+ - "crates/ui-egui/Cargo.toml"
- "crates/ui-egui/src/print.rs"
- "crates/ui-egui/src/tests/printps.rs"
- ".github/workflows/print.yml"
+ # A push to main saves the Windows cache entry that pull requests restore.
+ push:
+ branches: [main]
+ paths:
+ - "Cargo.toml"
+ - "Cargo.lock"
+ - "apps/vectorcraft/Cargo.toml"
+ - "apps/vectorcraft/src/printing.rs"
+ - "apps/vectorcraft/src/printing/**"
+ - "crates/ui-egui/Cargo.toml"
+ - "crates/ui-egui/src/print.rs"
+ - "crates/ui-egui/src/tests/printps.rs"
+ - ".github/workflows/print.yml"
+ # A weekly run on main saves a fresh entry after a new stable Rust changes the cache key.
+ schedule:
+ - cron: "23 6 * * 1"
workflow_dispatch:
permissions:
contents: read
@@ -18,15 +35,14 @@ concurrency:
group: print-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
- # Desktop printing on Windows, through the suite's shared gate. Pull requests restore the cache
- # but never save one; a manual run on main saves the cache they restore.
+ # Desktop printing on Windows, through the suite's shared gate. Pushes to main, the weekly run and
+ # manual runs on main save the cache; pull requests restore it and never save one.
windows:
# Tracks @main so suite-wide CI fixes reach every app without a PR in each repository.
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
with:
os: '["windows-2022"]'
- # A change to Cargo.lock finds no cache (only main saves one) and builds everything cold:
- # about 55 minutes for `-p vectorcraft` alone, then the UI crate's tests.
+ # A run that finds no cache builds everything cold, which took 76 to 126 minutes.
timeout-minutes: 150
# As in ci.yml: test binaries without debug info or symbols, and workspace crates without
# line tables. A panic still names its file and line.
@@ -36,10 +52,14 @@ jobs:
craft-fonts-ref: ""
tools: ""
targets: ""
- # A filter that matches nothing still passes, so the printps run fails unless some test ran.
+ # Both test runs select the same two packages, so Cargo resolves features once and the
+ # second run reuses the first run's dependencies. The first runs every test of the app
+ # (`--bin vectorcraft --test it`), the second the UI crate's `tests::printps` tests. A filter
+ # that matches nothing still passes, so the printps run fails unless some test ran.
command: |
+ set -o pipefail
cargo clippy --locked -p vectorcraft --all-targets -- -D warnings
- cargo test --locked -p vectorcraft
+ cargo test --locked -p vectorcraft -p vectorcraft-ui-egui --bin vectorcraft --test it
log="$RUNNER_TEMP/printps.log"
- cargo test --locked -p vectorcraft-ui-egui --lib -- tests::printps | tee "$log"
+ cargo test --locked -p vectorcraft -p vectorcraft-ui-egui --lib -- tests::printps | tee "$log"
grep -Eq 'test result: ok\. [1-9][0-9]* passed' "$log" || { echo "::error::tests::printps matched no tests"; exit 1; }
diff --git a/.github/workflows/release-rpm-smoke.yml b/.github/workflows/release-rpm-smoke.yml
new file mode 100644
index 0000000000..61948e0f35
--- /dev/null
+++ b/.github/workflows/release-rpm-smoke.yml
@@ -0,0 +1,114 @@
+name: Release RPM smoke
+
+on:
+ workflow_dispatch:
+ inputs:
+ run-id:
+ description: Release run containing both RPM artifacts (empty selects the latest available pair)
+ type: string
+ default: ""
+ pull_request:
+ paths:
+ - .github/workflows/release-rpm-smoke.yml
+ - .github/scripts/release-rpm-smoke.py
+ - .github/scripts/tests/test_release_rpm_smoke.py
+
+permissions: {}
+
+jobs:
+ source:
+ permissions:
+ actions: read
+ runs-on: ubuntu-24.04
+ timeout-minutes: 5
+ outputs:
+ run-id: ${{ steps.source.outputs.run-id }}
+ steps:
+ - id: source
+ env:
+ GH_TOKEN: ${{ github.token }}
+ RUN_ID: ${{ inputs.run-id }}
+ run: |
+ candidates="$RUN_ID"
+ if [ -z "$candidates" ]; then
+ candidates=$(gh run list --repo "$GITHUB_REPOSITORY" --workflow release.yml --branch release --limit 10 --json databaseId --jq '.[].databaseId')
+ fi
+ for candidate in $candidates; do
+ [[ "$candidate" =~ ^[0-9]+$ ]]
+ names=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$candidate/artifacts?per_page=100" --jq '.artifacts[] | select(.expired == false) | .name')
+ if grep -Fxq release-linux-x86_64 <<< "$names" && grep -Fxq release-linux-aarch64 <<< "$names"; then
+ printf 'run-id=%s\n' "$candidate" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+ done
+ echo '::error::No release run has both Linux package artifacts available'
+ exit 1
+ smoke:
+ permissions:
+ contents: read
+ actions: read
+ needs: source
+ timeout-minutes: 25
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - {arch: x86_64, runner: ubuntu-24.04}
+ - {arch: aarch64, runner: ubuntu-24.04-arm}
+ distro: [fedora, rocky, opensuse]
+ runs-on: ${{ matrix.platform.runner }}
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
+ with:
+ persist-credentials: false
+ - name: Download the release packages
+ env:
+ GH_TOKEN: ${{ github.token }}
+ RUN_ID: ${{ needs.source.outputs.run-id }}
+ ARCH: ${{ matrix.platform.arch }}
+ run: |
+ [[ "$RUN_ID" =~ ^[0-9]+$ ]]
+ mkdir -p packages results
+ gh run view "$RUN_ID" --json headSha,url > results/source.json
+ gh run download "$RUN_ID" --name "release-linux-$ARCH" --dir packages
+ sha256sum packages/*.rpm > results/rpm-sha256.txt
+ - name: Install and start the RPM on the target distribution
+ env:
+ DISTRO: ${{ matrix.distro }}
+ run: |
+ sudo apt-get update -qq
+ sudo apt-get install -y xvfb
+ Xvfb :99 -screen 0 1440x900x24 -ac -nolisten tcp > results/xvfb.log 2>&1 &
+ for _attempt in {1..20}; do
+ [ -S /tmp/.X11-unix/X99 ] && break
+ sleep 1
+ done
+ [ -S /tmp/.X11-unix/X99 ]
+ case "$DISTRO" in
+ fedora) image=fedora:latest ;;
+ rocky) image=rockylinux:10 ;;
+ opensuse) image=opensuse/tumbleweed:latest ;;
+ esac
+ docker pull "$image"
+ docker image inspect "$image" --format '{{json .RepoDigests}}' > results/container-digest.json
+ docker run --rm --ipc=host --name rpm-smoke -e DISTRO -e DISPLAY=:99 -e LIBGL_ALWAYS_SOFTWARE=1 \
+ -v /tmp/.X11-unix:/tmp/.X11-unix:ro -v "$PWD/packages:/packages:ro" \
+ -v "$PWD/results:/results" -v "$PWD/.github/scripts:/checks:ro" "$image" bash -euc '
+ cat /etc/os-release > /results/os-release.txt
+ if [ "$DISTRO" = opensuse ]; then
+ zypper --non-interactive refresh
+ zypper --non-interactive install python3 Mesa-dri Mesa-libEGL1 libX11-6 libXcursor1 libXi6 libXrandr2 libxkbcommon0 libxkbcommon-x11-0
+ zypper --non-interactive --no-gpg-checks install /packages/*.rpm
+ else
+ dnf -y install python3 mesa-dri-drivers mesa-libEGL libX11 libXcursor libXi libXrandr libxkbcommon libxkbcommon-x11
+ dnf -y --nogpgcheck install /packages/*.rpm
+ fi
+ rpm -qp --requires /packages/*.rpm > /results/rpm-requires.txt
+ python3 /checks/release-rpm-smoke.py
+ '
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
+ if: always()
+ with:
+ name: rpm-smoke-${{ matrix.distro }}-${{ matrix.platform.arch }}
+ path: results/
+ if-no-files-found: error
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 226830fc1b..ea3bf92583 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -42,6 +42,8 @@ jobs:
dry-run: ${{ github.event_name == 'schedule' }}
app-name: vectorcraft
app-title: VectorCraft
+ macos-runner: macos-15
+ macos-split-build: true
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
web-craft-fonts: true
version: ${{ inputs.version }}
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index 4cd4eb6387..98e9c1d00a 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -11,7 +11,7 @@ permissions:
contents: read
concurrency:
- group: sonarcloud-${{ github.ref }}
+ group: ${{ github.ref == 'refs/heads/main' && format('sonarcloud-main-{0}', github.sha) || format('sonarcloud-{0}', github.ref) }}
# A push to main is the run that publishes coverage; superseded runs there would never finish.
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
@@ -21,4 +21,7 @@ jobs:
# The reusable workflow defaults build-jobs to 2 so a cold instrumented
# archive stays within hosted-runner memory (craft-common-actions#333).
uses: storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main
+ with:
+ python-coverage-source: .github/scripts
+ python-coverage-script: .github/scripts/tests/test_release_rpm_smoke.py
secrets: inherit
diff --git a/Cargo.lock b/Cargo.lock
index 520647b95d..772196967a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -626,12 +626,6 @@ dependencies = [
"cpufeatures 0.3.1",
]
-[[package]]
-name = "block"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
-
[[package]]
name = "block-buffer"
version = "0.10.4"
@@ -725,6 +719,17 @@ dependencies = [
"brotli-decompressor 5.0.3",
]
+[[package]]
+name = "brotli"
+version = "9.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9071f285ed78f04f37d675abaaef5de7689e2f30a216c8dc6795465d81910a13"
+dependencies = [
+ "alloc-no-stdlib 3.0.0",
+ "alloc-stdlib 0.3.0",
+ "brotli-decompressor 6.3.2",
+]
+
[[package]]
name = "brotli-decompressor"
version = "5.0.3"
@@ -1184,19 +1189,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "core-graphics2"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b65858d95344d2711161cd92196732f67d6c5fea238cf12f994584828731a5c"
-dependencies = [
- "bitflags 2.13.2",
- "block",
- "cfg-if",
- "core-foundation 0.10.1",
- "libc",
-]
-
[[package]]
name = "core_detect"
version = "1.0.0"
@@ -1239,7 +1231,7 @@ dependencies = [
[[package]]
name = "craft"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-automation",
"craft-behavior",
@@ -1280,7 +1272,7 @@ dependencies = [
[[package]]
name = "craft-affinity"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"crc32fast",
"flate2",
@@ -1291,18 +1283,19 @@ dependencies = [
[[package]]
name = "craft-appkit"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"block2 0.6.2",
"objc2 0.6.5",
"objc2-app-kit 0.3.2",
+ "objc2-core-graphics",
"objc2-foundation 0.3.2",
]
[[package]]
name = "craft-atomic"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"rustix 1.1.6",
]
@@ -1310,7 +1303,7 @@ dependencies = [
[[package]]
name = "craft-automation"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"base64 0.23.1",
"craft-behavior",
@@ -1335,7 +1328,7 @@ dependencies = [
[[package]]
name = "craft-behavior"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"accesskit",
"bitflags 2.13.2",
@@ -1353,7 +1346,7 @@ dependencies = [
[[package]]
name = "craft-browse"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-docpath",
@@ -1371,7 +1364,7 @@ dependencies = [
[[package]]
name = "craft-cdr"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"crc32fast",
"flate2",
@@ -1380,7 +1373,7 @@ dependencies = [
[[package]]
name = "craft-cloud-ui"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"egui",
]
@@ -1388,7 +1381,7 @@ dependencies = [
[[package]]
name = "craft-cms"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"md-5",
"rayon",
@@ -1397,12 +1390,12 @@ dependencies = [
[[package]]
name = "craft-codepage"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
[[package]]
name = "craft-color-ui"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-cms",
@@ -1422,7 +1415,7 @@ dependencies = [
[[package]]
name = "craft-control"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-control-protocol",
"craft-platform",
@@ -1433,7 +1426,7 @@ dependencies = [
[[package]]
name = "craft-control-protocol"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"getrandom 0.3.4",
"serde_json",
@@ -1443,7 +1436,7 @@ dependencies = [
[[package]]
name = "craft-dds"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"rayon",
]
@@ -1451,7 +1444,7 @@ dependencies = [
[[package]]
name = "craft-dialogs"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"block2 0.6.2",
"craft-appkit",
@@ -1477,7 +1470,7 @@ dependencies = [
[[package]]
name = "craft-doc"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"blake3",
"craft-ecproj-format",
@@ -1493,7 +1486,7 @@ dependencies = [
[[package]]
name = "craft-docpath"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"serde",
]
@@ -1501,7 +1494,7 @@ dependencies = [
[[package]]
name = "craft-draw"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-color-ui",
@@ -1520,7 +1513,7 @@ dependencies = [
[[package]]
name = "craft-dxf"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-codepage",
"encoding_rs",
@@ -1532,7 +1525,7 @@ dependencies = [
[[package]]
name = "craft-ecproj-format"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"serde",
"serde_json",
@@ -1542,12 +1535,12 @@ dependencies = [
[[package]]
name = "craft-eps"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
[[package]]
name = "craft-font-catalog"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"fontique",
"harfrust 0.13.3",
@@ -1562,7 +1555,7 @@ dependencies = [
[[package]]
name = "craft-font-manager"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-font-catalog",
@@ -1581,7 +1574,7 @@ dependencies = [
[[package]]
name = "craft-font-os-windows"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"windows-registry",
"windows-sys 0.61.2",
@@ -1590,7 +1583,7 @@ dependencies = [
[[package]]
name = "craft-font-store"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"cap-primitives",
"craft-atomic",
@@ -1613,12 +1606,12 @@ dependencies = [
[[package]]
name = "craft-fonts-build"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
[[package]]
name = "craft-gif"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"gif",
]
@@ -1626,7 +1619,7 @@ dependencies = [
[[package]]
name = "craft-gzip"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"flate2",
]
@@ -1634,7 +1627,7 @@ dependencies = [
[[package]]
name = "craft-host"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"bitflags 2.13.2",
"craft-i18n",
@@ -1647,8 +1640,10 @@ dependencies = [
[[package]]
name = "craft-i18n"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
+ "brotli 9.1.3",
+ "brotli-decompressor 6.3.2",
"chrono",
"fixed_decimal",
"icu_calendar",
@@ -1675,7 +1670,7 @@ dependencies = [
[[package]]
name = "craft-image-codecs"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-dds",
"craft-jpeg",
@@ -1702,7 +1697,7 @@ dependencies = [
[[package]]
name = "craft-imaging"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-color-ui",
@@ -1720,7 +1715,7 @@ dependencies = [
[[package]]
name = "craft-jpeg"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"thiserror 2.0.21",
]
@@ -1728,7 +1723,7 @@ dependencies = [
[[package]]
name = "craft-jxl"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"brotli-decompressor 5.0.3",
"jixel",
@@ -1739,7 +1734,7 @@ dependencies = [
[[package]]
name = "craft-keymap"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-host",
"craft-i18n",
@@ -1754,7 +1749,7 @@ dependencies = [
[[package]]
name = "craft-layers"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-i18n",
@@ -1768,7 +1763,7 @@ dependencies = [
[[package]]
name = "craft-menu"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-host",
@@ -1786,7 +1781,7 @@ dependencies = [
[[package]]
name = "craft-metadata"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"brotli-decompressor 6.3.2",
"chrono",
@@ -1798,7 +1793,7 @@ dependencies = [
[[package]]
name = "craft-metafile"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"encoding_rs",
"image",
@@ -1809,17 +1804,26 @@ dependencies = [
[[package]]
name = "craft-mime"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"chrono",
"craft-codepage",
"encoding_rs",
]
+[[package]]
+name = "craft-nightly"
+version = "0.1.0"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
+dependencies = [
+ "uds_windows",
+ "winsafe",
+]
+
[[package]]
name = "craft-pages"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-keymap",
@@ -1835,7 +1839,7 @@ dependencies = [
[[package]]
name = "craft-pcraft-format"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"flate2",
"serde",
@@ -1846,7 +1850,7 @@ dependencies = [
[[package]]
name = "craft-pdf"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"hayro-interpret",
"hayro-syntax",
@@ -1858,12 +1862,12 @@ dependencies = [
[[package]]
name = "craft-platform"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"async-channel",
"async-io",
"async-process",
- "core-graphics2",
+ "craft-appkit",
"craft-atomic",
"craft-docpath",
"craft-host",
@@ -1873,6 +1877,8 @@ dependencies = [
"js-sys",
"log",
"objc2-app-kit 0.3.2",
+ "objc2-core-foundation",
+ "objc2-core-graphics",
"rfd",
"serde",
"serde_json",
@@ -1889,7 +1895,7 @@ dependencies = [
[[package]]
name = "craft-plotter"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"kurbo 0.13.1",
"thiserror 2.0.21",
@@ -1898,7 +1904,7 @@ dependencies = [
[[package]]
name = "craft-print"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-host",
@@ -1922,7 +1928,7 @@ dependencies = [
[[package]]
name = "craft-proof"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"log",
"miniz_oxide 0.9.1",
@@ -1933,7 +1939,7 @@ dependencies = [
[[package]]
name = "craft-ps"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-eps",
"flate2",
@@ -1947,7 +1953,7 @@ dependencies = [
[[package]]
name = "craft-psd"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"encoding_rs",
"flate2",
@@ -1958,7 +1964,7 @@ dependencies = [
[[package]]
name = "craft-quit"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"dispatch2",
"egui",
@@ -1971,7 +1977,7 @@ dependencies = [
[[package]]
name = "craft-review"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"base64 0.23.1",
"craft-behavior",
@@ -1990,7 +1996,7 @@ dependencies = [
[[package]]
name = "craft-settings"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-atomic",
"craft-host",
@@ -2007,7 +2013,7 @@ dependencies = [
[[package]]
name = "craft-stream-codecs"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"fax",
"hayro-ccitt",
@@ -2018,7 +2024,7 @@ dependencies = [
[[package]]
name = "craft-svg"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-image-codecs",
"craft-xml",
@@ -2039,7 +2045,7 @@ dependencies = [
[[package]]
name = "craft-table"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-keymap",
@@ -2051,7 +2057,7 @@ dependencies = [
[[package]]
name = "craft-text"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-font-manager",
@@ -2076,7 +2082,7 @@ dependencies = [
[[package]]
name = "craft-theme"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"bitflags 2.13.2",
"craft-tracked",
@@ -2091,7 +2097,7 @@ dependencies = [
[[package]]
name = "craft-theme-store"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-atomic",
"craft-behavior",
@@ -2106,7 +2112,7 @@ dependencies = [
[[package]]
name = "craft-tiff"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"serde",
"thiserror 2.0.21",
@@ -2116,7 +2122,7 @@ dependencies = [
[[package]]
name = "craft-time"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"serde",
"thiserror 2.0.21",
@@ -2125,7 +2131,7 @@ dependencies = [
[[package]]
name = "craft-timeline"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-keymap",
@@ -2140,12 +2146,12 @@ dependencies = [
[[package]]
name = "craft-tracked"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
[[package]]
name = "craft-ui"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-cloud-ui",
"craft-ui-canvas",
@@ -2159,7 +2165,7 @@ dependencies = [
[[package]]
name = "craft-ui-canvas"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-i18n",
@@ -2175,7 +2181,7 @@ dependencies = [
[[package]]
name = "craft-ui-contract"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"accesskit",
"craft-behavior",
@@ -2213,7 +2219,7 @@ dependencies = [
[[package]]
name = "craft-ui-macros"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -2224,7 +2230,7 @@ dependencies = [
[[package]]
name = "craft-ui-panels"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2242,7 +2248,7 @@ dependencies = [
[[package]]
name = "craft-ui-patterns"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2263,7 +2269,7 @@ dependencies = [
[[package]]
name = "craft-ui-shell"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2284,7 +2290,7 @@ dependencies = [
[[package]]
name = "craft-ui-widgets"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2303,7 +2309,7 @@ dependencies = [
[[package]]
name = "craft-update"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"base64 0.22.1",
"chrono",
@@ -2335,7 +2341,7 @@ dependencies = [
[[package]]
name = "craft-vectorcraft-format"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"flate2",
"serde",
@@ -2346,7 +2352,7 @@ dependencies = [
[[package]]
name = "craft-wayland"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"raw-window-handle",
"wayland-backend",
@@ -2356,7 +2362,7 @@ dependencies = [
[[package]]
name = "craft-web-api"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"js-sys",
"serde_json",
@@ -2367,7 +2373,7 @@ dependencies = [
[[package]]
name = "craft-win32"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"winsafe",
]
@@ -2375,7 +2381,7 @@ dependencies = [
[[package]]
name = "craft-window"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"craft-appkit",
"craft-atomic",
@@ -2407,7 +2413,7 @@ dependencies = [
[[package]]
name = "craft-xml"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"quick-xml 0.41.0",
"serde",
@@ -2752,7 +2758,7 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "ecolor"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"bytemuck",
"emath",
@@ -2785,7 +2791,7 @@ dependencies = [
[[package]]
name = "eframe"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"ahash",
"bytemuck",
@@ -2820,7 +2826,7 @@ dependencies = [
[[package]]
name = "egui"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"accesskit",
"ahash",
@@ -2839,7 +2845,7 @@ dependencies = [
[[package]]
name = "egui-wgpu"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"ahash",
"bytemuck",
@@ -2858,7 +2864,7 @@ dependencies = [
[[package]]
name = "egui-winit"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"accesskit_winit",
"arboard",
@@ -2883,7 +2889,7 @@ dependencies = [
[[package]]
name = "egui_extras"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"ahash",
"egui",
@@ -2897,7 +2903,7 @@ dependencies = [
[[package]]
name = "egui_glow"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"bytemuck",
"egui",
@@ -2910,7 +2916,7 @@ dependencies = [
[[package]]
name = "egui_kittest"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"dify",
"eframe",
@@ -2936,7 +2942,7 @@ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
[[package]]
name = "emath"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"bytemuck",
]
@@ -3017,7 +3023,7 @@ dependencies = [
[[package]]
name = "epaint"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"ahash",
"bytemuck",
@@ -3043,7 +3049,11 @@ dependencies = [
[[package]]
name = "epaint_default_fonts"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
+dependencies = [
+ "brotli 9.1.3",
+ "brotli-decompressor 6.3.2",
+]
[[package]]
name = "equivalent"
@@ -3762,16 +3772,16 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a"
[[package]]
name = "hayro-cmap"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
- "brotli",
+ "brotli 8.0.4",
"hayro-postscript",
]
[[package]]
name = "hayro-interpret"
version = "0.7.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"bitflags 2.13.2",
"hayro-cmap",
@@ -3789,7 +3799,7 @@ dependencies = [
[[package]]
name = "hayro-jbig2"
version = "0.3.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"fearless_simd",
"hayro-ccitt",
@@ -3807,12 +3817,12 @@ dependencies = [
[[package]]
name = "hayro-postscript"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
[[package]]
name = "hayro-syntax"
version = "0.7.2"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"flate2",
"hayro-ccitt",
@@ -4795,7 +4805,7 @@ dependencies = [
[[package]]
name = "krilla"
version = "0.8.2"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"base64 0.22.1",
"bumpalo",
@@ -4952,7 +4962,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"
[[package]]
name = "linesweeper"
version = "0.5.0"
-source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853"
+source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
dependencies = [
"arrayvec",
"kurbo 0.13.1",
@@ -8515,13 +8525,14 @@ dependencies = [
[[package]]
name = "vectorcraft"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"arboard",
"block2 0.6.2",
"chrono",
"clipboard-win",
"craft",
+ "craft-nightly",
"eframe",
"egui",
"egui_extras",
@@ -8538,7 +8549,6 @@ dependencies = [
"raw-window-handle",
"rustix 1.1.6",
"serde_json",
- "socket2",
"tempfile",
"vectorcraft-engine",
"vectorcraft-render",
@@ -8559,7 +8569,7 @@ dependencies = [
[[package]]
name = "vectorcraft-affinity"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-affinity",
"craft-image-codecs",
@@ -8570,26 +8580,26 @@ dependencies = [
[[package]]
name = "vectorcraft-apischema"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"serde_json",
]
[[package]]
name = "vectorcraft-brush"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"kurbo 0.13.1",
"serde",
"serde_json",
"vectorcraft-color",
"vectorcraft-doc",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
]
[[package]]
name = "vectorcraft-cad"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-dxf",
"craft-image-codecs",
@@ -8601,14 +8611,14 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.24.1",
- "vectorcraft-pathops 0.24.1",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-text",
]
[[package]]
name = "vectorcraft-cli"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"log",
"objc2-core-foundation",
@@ -8619,7 +8629,7 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-engine",
"vectorcraft-format",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-mcp",
"vectorcraft-render",
"vectorcraft-svg",
@@ -8631,7 +8641,7 @@ dependencies = [
[[package]]
name = "vectorcraft-color"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-cms",
"craft-color-ui",
@@ -8647,7 +8657,7 @@ dependencies = [
[[package]]
name = "vectorcraft-doc"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"chrono",
"craft-image-codecs",
@@ -8663,13 +8673,13 @@ dependencies = [
"thiserror 2.0.21",
"tiff",
"vectorcraft-color",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"zune-jpeg",
]
[[package]]
name = "vectorcraft-effects"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"craft-svg",
@@ -8679,8 +8689,8 @@ dependencies = [
"svgtypes 0.16.1",
"vectorcraft-color",
"vectorcraft-doc",
- "vectorcraft-geom 0.24.1",
- "vectorcraft-pathops 0.24.1",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-plugins",
"vectorcraft-text",
"vectorcraft-three-d",
@@ -8690,7 +8700,7 @@ dependencies = [
[[package]]
name = "vectorcraft-engine"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"apple-native-keyring-store",
"cfb",
@@ -8699,6 +8709,8 @@ dependencies = [
"craft-codepage",
"craft-doc",
"craft-docpath",
+ "craft-font-catalog",
+ "craft-font-store",
"craft-image-codecs",
"craft-jxl",
"craft-proof",
@@ -8737,10 +8749,10 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-eps",
"vectorcraft-format",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-js",
"vectorcraft-metafile",
- "vectorcraft-pathops 0.24.1",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-pdf",
"vectorcraft-plugins",
"vectorcraft-render",
@@ -8760,7 +8772,7 @@ dependencies = [
[[package]]
name = "vectorcraft-eps"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-eps",
"craft-image-codecs",
@@ -8781,9 +8793,9 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-effects",
"vectorcraft-eps",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-metafile",
- "vectorcraft-pathops 0.24.1",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-pdf",
"vectorcraft-render",
"vectorcraft-testkit",
@@ -8792,7 +8804,7 @@ dependencies = [
[[package]]
name = "vectorcraft-format"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-gzip",
"craft-vectorcraft-format",
@@ -8804,7 +8816,7 @@ dependencies = [
"thiserror 2.0.21",
"vectorcraft-brush",
"vectorcraft-doc",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-testkit",
]
@@ -8820,7 +8832,7 @@ dependencies = [
[[package]]
name = "vectorcraft-geom"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"kurbo 0.13.1",
"proptest",
@@ -8831,7 +8843,7 @@ dependencies = [
[[package]]
name = "vectorcraft-js"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"chrono",
"craft-xml",
@@ -8842,7 +8854,7 @@ dependencies = [
[[package]]
name = "vectorcraft-mcp"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft",
"craft-image-codecs",
@@ -8854,7 +8866,7 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-engine",
"vectorcraft-format",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-render",
"vectorcraft-svg",
"vectorcraft-testkit",
@@ -8863,7 +8875,7 @@ dependencies = [
[[package]]
name = "vectorcraft-metafile"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"craft-metafile",
@@ -8873,7 +8885,7 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-text",
]
@@ -8890,19 +8902,19 @@ dependencies = [
[[package]]
name = "vectorcraft-pathops"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"kurbo 0.13.1",
"linesweeper",
"proptest",
"thiserror 2.0.21",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-testkit",
]
[[package]]
name = "vectorcraft-pdf"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"aes 0.8.4",
"chrono",
@@ -8931,7 +8943,7 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-pdf",
"vectorcraft-testkit",
"vectorcraft-text",
@@ -8939,7 +8951,7 @@ dependencies = [
[[package]]
name = "vectorcraft-plugin-worker"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"js-sys",
"vectorcraft-plugins",
@@ -8949,7 +8961,7 @@ dependencies = [
[[package]]
name = "vectorcraft-plugins"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"craft-vectorcraft-format",
@@ -8961,7 +8973,7 @@ dependencies = [
"thiserror 2.0.21",
"vectorcraft-color",
"vectorcraft-doc",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-js",
"vectorcraft-plugins",
"wasmi",
@@ -8972,7 +8984,7 @@ dependencies = [
[[package]]
name = "vectorcraft-render"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-gif",
"craft-image-codecs",
@@ -8990,7 +9002,7 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-plugins",
"vectorcraft-testkit",
"vectorcraft-text",
@@ -9003,7 +9015,7 @@ dependencies = [
[[package]]
name = "vectorcraft-scriptcheck"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"proptest",
"unicode-properties",
@@ -9011,7 +9023,7 @@ dependencies = [
[[package]]
name = "vectorcraft-svg"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-docpath",
"craft-image-codecs",
@@ -9035,15 +9047,16 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.24.1",
- "vectorcraft-pathops 0.24.1",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
+ "vectorcraft-render",
"vectorcraft-testkit",
"vectorcraft-text",
]
[[package]]
name = "vectorcraft-testkit"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"fax",
@@ -9054,14 +9067,14 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-engine",
"vectorcraft-format",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-render",
"vectorcraft-svg",
]
[[package]]
name = "vectorcraft-text"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft",
"craft-fonts-build",
@@ -9079,23 +9092,23 @@ dependencies = [
"unicode-script",
"unicode-segmentation",
"vectorcraft-doc",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vello_cpu",
"write-fonts",
]
[[package]]
name = "vectorcraft-three-d"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"proptest",
- "vectorcraft-geom 0.24.1",
- "vectorcraft-pathops 0.24.1",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
]
[[package]]
name = "vectorcraft-thumbnail-handler"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"png 0.18.1",
"windows",
@@ -9104,7 +9117,7 @@ dependencies = [
[[package]]
name = "vectorcraft-tools"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"kurbo 0.13.1",
@@ -9114,15 +9127,15 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.24.1",
- "vectorcraft-pathops 0.24.1",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-text",
"vectorcraft-tools",
]
[[package]]
name = "vectorcraft-trace"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"image",
@@ -9130,12 +9143,12 @@ dependencies = [
"serde",
"serde_json",
"thiserror 2.0.21",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
]
[[package]]
name = "vectorcraft-ui-egui"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"bytemuck",
"chrono",
@@ -9159,7 +9172,7 @@ dependencies = [
"vectorcraft-engine",
"vectorcraft-eps",
"vectorcraft-format",
- "vectorcraft-geom 0.24.1",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-pdf",
"vectorcraft-plugins",
"vectorcraft-render",
@@ -9174,7 +9187,7 @@ dependencies = [
[[package]]
name = "vectorcraft-web"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"craft",
"craft-web-api",
@@ -10066,7 +10079,7 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winit"
version = "0.30.13"
-source = "git+https://github.com/storytold/winit.git?rev=a517b3846ee8457d84ee4975110bfda6797c44dc#a517b3846ee8457d84ee4975110bfda6797c44dc"
+source = "git+https://github.com/storytold/winit.git?rev=0dfcec0eb62fda5904137a63a6dd0c3d83295f45#0dfcec0eb62fda5904137a63a6dd0c3d83295f45"
dependencies = [
"ahash",
"android-activity",
@@ -10403,7 +10416,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee"
[[package]]
name = "xtask"
-version = "0.24.1"
+version = "0.25.1"
dependencies = [
"serde_json",
]
@@ -10758,18 +10771,3 @@ dependencies = [
"syn 3.0.9",
"winnow",
]
-
-[[patch.unused]]
-name = "egui_demo_lib"
-version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
-
-[[patch.unused]]
-name = "egui_inspection"
-version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
-
-[[patch.unused]]
-name = "egui_system_font_provider"
-version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081"
diff --git a/Cargo.toml b/Cargo.toml
index a0fb986dcc..e1a20cac68 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,53 +4,57 @@ members = ["crates/*", "apps/*", "xtask"]
default-members = ["crates/*", "apps/vectorcraft", "apps/vectorcraft-cli", "xtask"]
[workspace.package]
-version = "0.24.1"
+version = "0.25.1"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
-repository = "https://github.com/storytold/vectorcraft"
[workspace.dependencies]
-craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", default-features = false, features = ["interpret", "write"] }
-craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", default-features = false, features = ["interpret", "write"] }
+craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+# Language packs: the Craft apps' shared font store installs them (#4936).
+craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON.
-craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile.
-craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", features = ["pcraft-pixels"] }
+craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", features = ["pcraft-pixels"] }
# Native Affinity documents (craft-libs#914).
-craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778).
-craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# SVG parsing, limits, SVGZ and writer (craft-libs#778).
-craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", features = ["tree"] }
-craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", features = ["tree"] }
+craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# EPS container, previews, ASCII85 and DSC comments (craft-libs#778).
-craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# DXF tags, reader and writer (craft-libs#778, #926, #927).
-craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# WMF, EMF and EMF+ reader (craft-libs#778).
-craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", default-features = false, features = ["read", "write"] }
-craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", default-features = false, features = ["read", "write"] }
+craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names
# the members it imports.
-craft = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui
# without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes.
-craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
+craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+# Nightly profile isolation, launch protocol, and security fence.
+craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
# internal
vectorcraft-geom = { path = "crates/geom" }
vectorcraft-color = { path = "crates/color" }
@@ -86,7 +90,6 @@ vectorcraft-apischema = { path = "crates/apischema" }
# foundation
kurbo = { version = "0.13", features = ["serde"] }
-peniko = "0.6"
thiserror = "2"
serde = { version = "1", features = ["derive", "rc"] }
serde_json = { version = "1", features = ["float_roundtrip"] }
@@ -156,10 +159,8 @@ egui = "0.37"
egui_extras = { version = "0.37", default-features = false, features = ["svg"] }
eframe = { version = "0.37", default-features = false }
egui_kittest = "0.37"
-rfd = "0.17"
arboard = { version = "3.6", default-features = false }
clipboard-win = "5.4"
-webbrowser = "1"
[workspace.lints.rust]
unsafe_code = "deny"
@@ -193,25 +194,22 @@ lto = "thin"
codegen-units = 1
[patch.crates-io]
-hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-krilla = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" }
-ecolor = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-emath = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-epaint = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-egui = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-egui-winit = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-egui_glow = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-egui_extras = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-eframe = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" }
-winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" }
+hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+krilla = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
+ecolor = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+emath = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+epaint = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui-winit = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui_glow = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui_extras = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+eframe = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+winit = { git = "https://github.com/storytold/winit.git", rev = "0dfcec0eb62fda5904137a63a6dd0c3d83295f45" }
diff --git a/README.md b/README.md
index 8e51d4930e..366b0711a8 100644
--- a/README.md
+++ b/README.md
@@ -233,8 +233,8 @@ VectorCraft is under active development. [**ROADMAP.md**](ROADMAP.md) has the st
and what's next; [`docs/target-app-parity.md`](docs/target-app-parity.md) the full parity assessment and
[`docs/gaps.md`](docs/gaps.md) the ranked list of what's missing.
-**Where we are (2026-10-10): alpha.** About 88% of core menu items, tools, effects and formats exist
-(92.5% of menu items do something), feature depth is ~75%, and we estimate ~65% ready for real work for a mainstream illustrator (~62% across all tracked features): everyday
+**Where we are (2026-11-30): alpha.** About 96% of core menu items, tools, effects and formats exist
+(99.9% of menu items do something), feature depth is ~79%, and we estimate ~65% ready for real work for a mainstream illustrator (~67% across all tracked features): everyday
vector illustration is close to usable: drawing and path tools,
Pathfinder and Shape Builder, paint, gradients, appearance and transparency, type with styles, threading and Hebrew/Arabic bidirectional layout, and
files (SVG, PDF and PDF-compatible `.ai` with PDF/X, legacy version 7 `.ai` keeping layers, groups and type, EPS, DXF, EMF/WMF, raster formats, PSD out, PSD/PSB opened with their layers and placed as their merged image, JPEG XL in, Print, Package).
diff --git a/ROADMAP.md b/ROADMAP.md
index bc350856d2..2266edeb77 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -10,7 +10,7 @@ control channel. This page is the summary; the evidence is in [`docs/target-app-
and the work list in [`docs/gaps.md`](docs/gaps.md).
**Why alpha:** the core workflows exist end to end (drawing and path editing, Pathfinder, paint and appearance,
-type, SVG/PDF/EPS, print, export) and feature depth is ~75%, but a professional can't yet switch: Illustrator's
+type, SVG/PDF/EPS, print, export) and feature depth is ~79%, but a professional can't yet switch: Illustrator's
own `.ai` files open with a wrong layer structure in real cases and are saved back with an editing copy that
keeps live effects only on paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports (see [docs/file-format-parity.md](docs/file-format-parity.md)), and writes live objects as their art, the interaction details have never been checked side by side, and some machines fail to start the
app. Beta needs those closed (the beta list in [gaps.md](docs/gaps.md)). It passes the core-workflow
@@ -24,8 +24,8 @@ blocking it ([Alpha gate](docs/roadmap.md#alpha-gate)).
| | Value | Kind |
|---|---|---|
-| **Feature breadth** (Illustrator's menu items, tools, effects, formats exist) | **~88%** | measured in part: menu items 717/719 wired (99.7%), tools 89/92, Illustrator effects 46/50, Photoshop effects 57/57, 3D 4/4 (initial types, no materials) |
-| **Feature depth** (weighted by use, scored by behaviour) | **~75%** | estimated |
+| **Feature breadth** (Illustrator's menu items, tools, effects, formats exist) | **~96%** | measured in part: menu items 815/816 wired (99.9%), tools 91/92, Illustrator effects 50/50, Photoshop effects 57/57, 3D 4/4 plus 3 Classic (initial types, graphics on the Materials page (#6960), no base materials) |
+| **Feature depth** (weighted by use, scored by behaviour) | **~79%** | estimated |
| **To beta** | **~170–270 h** one agent · ~50–80 h with 4–6 agents | estimated |
| **To full parity** | **~360–590 h** one agent · ~95–165 h with 4–6 agents | estimated |
@@ -33,9 +33,9 @@ blocking it ([Alpha gate](docs/roadmap.md#alpha-gate)).
| Audience | Ready % | Opus 5.5 agent hours to ~95% (one agent) | With 4–6 agents | Work that dominates |
|---|---:|---:|---:|---|
-| **Full Illustrator** (ready for real work; decides the stage) | **~62%** (57–67%) | **~340–560 h** | ~95–160 h | the mainstream work below, plus 3D (50–85 h), raster effects (23–39 h), advanced type (20–28 h), generative AI (30–60 h), localization (50–85 h) and ecosystem |
+| **Full Illustrator** (ready for real work; decides the stage) | **~67%** (62–72%) | **~340–560 h** | ~95–160 h | the mainstream work below, plus 3D (50–85 h), raster effects (23–39 h), advanced type (20–28 h), generative AI (30–60 h), localization (50–85 h) and ecosystem |
| **Mainstream illustrator** | **~65%** (60–70%) | **~230–380 h** | ~65–110 h | the interaction-fidelity pass (60–90 h), hardening and QA (30–50 h), stability (20–35 h), performance budgets (15–25 h), `.ai` exchange (10–20 h), the remaining depth of the everyday areas |
-| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder depth (4–8 h; #937's reproduced case is fixed, unconfirmed on the reporter's file), UI polish |
+| **Essentials user** | **~77%** (72–82%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), the Windows print crashes (#8021, #9261), help articles and onboarding (8–15 h), basic QA (10–15 h), Shape Builder depth (4–8 h; #937's reproduced case is fixed, unconfirmed on the reporter's file), UI polish |
Hours are Opus 5.5 agent wall-clock hours, calibrated from this repo's merged-PR timestamps (e.g. 0.7–1.2 h per
Photoshop-style filter, ~0.8 h per medium feature); see [calibration](docs/target-app-parity.md#calibration).
@@ -46,15 +46,15 @@ everything is measured from our code against Illustrator's public documentation.
| Dimension | % | One agent (h) | Doc |
|---|---:|---:|---|
-| Features (depth) | 75% | 220–360 | [target-app-parity.md](docs/target-app-parity.md) |
-| UI/UX fidelity | 55% | 70–110 | [ui-parity.md](docs/ui-parity.md) |
+| Features (depth) | 79% | 220–360 | [target-app-parity.md](docs/target-app-parity.md) |
+| UI/UX fidelity | 60% | 70–110 | [ui-parity.md](docs/ui-parity.md) |
| File formats | 75% | 15–30 | [file-format-parity.md](docs/file-format-parity.md) |
-| Hardware (GPU, pen, touch, displays) | 35% | 25–45 | [hardware-parity.md](docs/hardware-parity.md) |
-| Localization (12 key languages) | 74% (measured) | 50–85 | [localization-parity.md](docs/localization-parity.md) |
+| Hardware (GPU, pen, touch, displays) | 45% | 25–45 | [hardware-parity.md](docs/hardware-parity.md) |
+| Localization (12 key languages) | 87% (measured) | 50–85 | [localization-parity.md](docs/localization-parity.md) |
| Performance | ~60% | 15–25 | [gaps.md › G15](docs/gaps.md#g15-performance-budgets-and-a-gpu-renderer) |
-| Stability | ~60% | 30–50 | [gaps.md › G10](docs/gaps.md#g10-launch-and-stability-on-real-machines) |
-| Platforms | 80% | 15–25 | [gaps.md › G8](docs/gaps.md#g8-hardening-at-scale) |
-| Ecosystem and plug-ins | 15% | 30–60 | [gaps.md › G17](docs/gaps.md#g17-ecosystem-third-party-plug-ins) |
+| Stability | ~55% | 30–50 | [gaps.md › G10](docs/gaps.md#g10-launch-and-stability-on-real-machines) |
+| Platforms | 82% | 15–25 | [gaps.md › G8](docs/gaps.md#g8-hardening-at-scale) |
+| Ecosystem and plug-ins | 30% | 30–60 | [gaps.md › G17](docs/gaps.md#g17-ecosystem-third-party-plug-ins) |
| AI features (generative) | 0% | 30–60 + owner decision | [gaps.md › G18](docs/gaps.md#g18-generative-ai-features) |
| Agent automation | beyond Illustrator | — | [mcp.md](docs/mcp.md) |
@@ -64,26 +64,26 @@ The dimension hours overlap (feature rows hold some UI, format and AI work), so
| Area | % | One agent (h) |
|---|---:|---:|
-| Selection, transform & align | 85% | 4–6 |
-| Drawing tools | 85% | 8–13 |
-| Path operations, Pathfinder, Shape Builder, Live Paint | 80% | 4–8 |
+| Selection, transform & align | 86% | 4–6 |
+| Drawing tools | 88% | 8–13 |
+| Path operations, Pathfinder, Shape Builder, Live Paint | 85% | 4–8 |
| Colour, swatches, gradients, patterns, mesh, recolor | 92% | 4–7 |
-| Strokes, brushes, width profiles | 88% | 8–15 |
+| Strokes, brushes, width profiles | 90% | 8–15 |
| Appearance, transparency, graphic styles, masks | 97% | 1–2 |
-| Live vector effects | 85% | 4–8 |
-| Raster effects (Effect Gallery) — [effects-parity.md](docs/effects-parity.md) | 88% | — |
-| 3D and Materials | ~25% | 30–55 |
-| Type core — [type-parity.md](docs/type-parity.md) | 80% | 14–19 |
-| Type advanced (CJK, spelling, Touch Type) | 50% | 20–28 |
-| Symbols, blends, envelopes, Repeat, perspective | 88% | 4–7 |
-| Image Trace, graphs, image tools | 75% | 5–8 |
-| Layers, artboards, document setup | 78% | 5–8 |
-| View & navigation | 70% | 9–14 |
+| Live vector effects | 90% | 4–8 |
+| Raster effects (Effect Gallery) — [effects-parity.md](docs/effects-parity.md) | 55% | — |
+| 3D and Materials | ~35% | 30–55 |
+| Type core — [type-parity.md](docs/type-parity.md) | 83% | 14–19 |
+| Type advanced (CJK, spelling, Touch Type) | 60% | 20–28 |
+| Symbols, blends, envelopes, Repeat, perspective | 90% | 4–7 |
+| Image Trace, graphs, image tools | 78% | 5–8 |
+| Layers, artboards, document setup | 82% | 5–8 |
+| View & navigation | 80% | 9–14 |
| Guides, grids, smart guides, snapping | 80% | 4–7 |
| File formats — [file-format-parity.md](docs/file-format-parity.md) | 75% | 10–20 |
-| Export for Screens, Asset Export, slices | 85% | 2–4 |
+| Export for Screens, Asset Export, slices | 87% | 2–4 |
| Print, colour management, separations | 80% | 2–4 |
-| Automation (Actions, Variables, scripting) | 60% | 8–14 |
+| Automation (Actions, Variables, scripting) | 80% | 8–14 |
| UI chrome (panels, Properties, preferences) | 80% | 13–20 |
| Libraries, Links, Package | 82% | 2–3 |
| Generative AI | 0% | 30–60 |
@@ -95,7 +95,7 @@ Weights, evidence and the missing items per area: [target-app-parity.md](docs/ta
| Language | Code | Status | Translated |
|---|---|---|---:|
| English | `en` | full | 100% |
-| Simplified Chinese | `zh-hans` | partial (messages in English) | 85% |
+| Simplified Chinese | `zh-hans` | partial (messages translated, #2578) | 85% |
| Spanish | `es` | full | 100% |
| Hindi | `hi` | catalog complete; machine-assisted draft, native review pending | complete under the scanner |
| Gujarati | `gu` | 4,673 contributor-reviewed catalog rows; 11 corrections applied to the 387 additions | menus and dialogs; status/error messages partial |
@@ -119,7 +119,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
1. **Interaction-fidelity pass** (G1), tool by tool from [ui-parity.md](docs/ui-parity.md): 60–90 h.
2. **`.ai` files from real users** (G9): layer structure, guides, speed: 10–20 h.
3. **Launch and stability on real machines** (G10): 20–35 h.
-4. **Core-tool correctness** (G11: the unit preference reverting to points, #864, SVG export units fixed; a Transform effect in a fill's or stroke's own effects, #885; Shape Builder regions and Asset Export borders are fixed): 6–13 h.
+4. **Core-tool correctness** (G11: the unit preference reverting to points, #864, SVG export units fixed; a Transform effect in a fill's or stroke's own effects (#5221, #885), Shape Builder regions and Asset Export borders are fixed): 6–13 h.
5. **Then:** type core and advanced type (G4), the Illustrator 2026 additions (G13), 3D (G3). The Effect Gallery's filter thumbnails and in-dialog preview are in (G2).
## Progress log
@@ -164,6 +164,8 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
- 2026-11-01: Expand Dashes into Paths joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): each selected path's dashed stroke becomes separate open paths, one per dash, laid out exactly as the stroke draws them (pattern, offset, Align Dashes to Corners and Path Ends), each keeping the stroke with the dashes off, so the gaps are real gaps for cutters and plotters, as one undo step (`addon.pathtools.expandDashes`, #4922).
- 2026-11-01: Randomize Opacity joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): each selected object gets its own opacity at random between a minimum and a maximum percent, with a seed that repeats the result, as one undo step (`addon.arrange.randomizeOpacity`, #4925).
- 2026-11-01: Sort Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the selected objects are sorted by width, height, area, position, opacity or stacking order (small to large, large to small or at random) and take another of those in that order, trading their values or stepping them evenly, as one undo step (`addon.arrange.sort`, #4917).
+- 2026-11-29: Match Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the other selected objects take the width, the height or both, the bounding-box angle and the stacking place of the key object, or of the top or the bottom selected object, about a reference point, with Preview, as one undo step (`addon.arrange.match`). A VectorCraft addition: headline numbers unchanged.
+- 2026-11-29: Offset Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the selected objects are chained one after another in a row or a column with a set gap (negative to overlap them), in stacking order or by position, either way; the first stays in place and the others move only along the row or column, as one undo step (`addon.arrange.offset`). A VectorCraft addition: headline numbers unchanged.
- 2026-11-15: Tangent Circle joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the circles that touch two selected paths or compound paths at a set radius, or three of them (up to eight for three circles), touching each outline without crossing it; circles, rotated ellipses and other paths alike. A dialog that previews every circle or one picked by number, the current paint, one undo step (`addon.pathtools.tangentCircle`). A VectorCraft addition: headline numbers unchanged.
- 2026-11-17: Add Bounding Rectangle and Add Bounding Circle join the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): a live rectangle on the selection's geometric bounding box, or the smallest live circle that holds its outlines, around the whole selection or around each object, with the current paint and one undo step; the menu items open a dialog with Offset, One per Object and Preview (`addon.pathtools.boundingRectangle`, `addon.pathtools.boundingCircle`, #6966). A VectorCraft addition: headline numbers unchanged.
- 2026-11-22: Add Inscribed Circle joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the largest live circle inside each selected closed path or compound path, in the area it fills under its fill rule, with the current paint and one undo step (`addon.pathtools.inscribedCircle`, #6966). A VectorCraft addition: headline numbers unchanged.
diff --git a/apps/vectorcraft-cli/Cargo.toml b/apps/vectorcraft-cli/Cargo.toml
index 376f431903..25cffe599e 100644
--- a/apps/vectorcraft-cli/Cargo.toml
+++ b/apps/vectorcraft-cli/Cargo.toml
@@ -48,3 +48,14 @@ objc2-core-text = { version = "0.3", default-features = false, features = ["std"
tempfile = "3"
vectorcraft-testkit = { workspace = true }
serde_json = { workspace = true }
+
+# The files of other crates that this crate compiles or its tests read, for CI's test selection.
+[package.metadata.craft]
+reads = [
+ "apps/vectorcraft/src/mac_fonts.rs",
+ "apps/vectorcraft/src/prefs_dir.rs",
+ "apps/vectorcraft/src/profile.rs",
+ "apps/vectorcraft/src/system_fonts.rs",
+ "apps/vectorcraft/src/windows_cores.rs",
+ "crates/plugins/tests/fixtures/desaturate.wasm",
+]
diff --git a/apps/vectorcraft-cli/src/main.rs b/apps/vectorcraft-cli/src/main.rs
index f42a24e9b1..c01f84edd9 100644
--- a/apps/vectorcraft-cli/src/main.rs
+++ b/apps/vectorcraft-cli/src/main.rs
@@ -211,6 +211,9 @@ fn main() -> ExitCode {
#[cfg(target_os = "macos")]
mac_fonts::install();
prefs_dir::install_fonts();
+ // The Language packs installed in the shared font store; `proof.installPack` returns once
+ // installed.
+ prefs_dir::use_language_packs();
let mut args: Vec = std::env::args().skip(1).collect();
// Before any subcommand attaches the plug-in folder.
let safe_mode = args.first().is_some_and(|a| a == "--safe-mode");
diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml
index e8b56c29a9..30d529a5e7 100644
--- a/apps/vectorcraft-web/Cargo.toml
+++ b/apps/vectorcraft-web/Cargo.toml
@@ -20,14 +20,15 @@ vectorcraft-format = { workspace = true }
vectorcraft-text = { workspace = true }
craft = { workspace = true, features = ["ui", "keymap", "automation", "platform"] }
egui = { workspace = true }
-egui_extras = { workspace = true }
log = { workspace = true }
[target.'cfg(target_arch = "wasm32")'.dependencies]
+# Image loaders for `src/web.rs`, which builds only for wasm32.
+egui_extras = { workspace = true }
# `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback.
eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] }
# The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft.
-craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", version = "0.1.0" }
+craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", version = "0.1.0" }
wasm-bindgen = "0.2"
serde_json = { workspace = true }
diff --git a/apps/vectorcraft-web/Trunk.toml b/apps/vectorcraft-web/Trunk.toml
index aad9a1638f..1bb9ef3f24 100644
--- a/apps/vectorcraft-web/Trunk.toml
+++ b/apps/vectorcraft-web/Trunk.toml
@@ -5,6 +5,10 @@ dist = "../../dist/web"
public_url = "./"
filehash = true
+[tools]
+# Binaryen 123 crashes while optimizing the release bundle; keep the optimizer explicit.
+wasm_opt = "version_133"
+
[serve]
addresses = ["127.0.0.1"]
port = 8766
diff --git a/apps/vectorcraft/Cargo.toml b/apps/vectorcraft/Cargo.toml
index 1c3e7f39e7..3ec7da1b75 100644
--- a/apps/vectorcraft/Cargo.toml
+++ b/apps/vectorcraft/Cargo.toml
@@ -22,6 +22,7 @@ vectorcraft-text = { workspace = true }
# frame policy and placement store (so VectorCraft matches the rest on Linux, see #217), printing and
# the update client.
craft = { workspace = true, features = ["ui", "ui-app", "settings", "automation", "platform", "window", "dialogs", "print", "update"] }
+craft-nightly = { workspace = true }
eframe = { workspace = true, features = ["clipboard", "default_fonts", "wayland", "x11"] }
egui = { workspace = true }
egui_extras = { workspace = true }
@@ -129,5 +130,3 @@ winresource = "0.1"
[dev-dependencies]
tempfile = "3"
-# Bound socket buffers in real loopback transport deadline regressions.
-socket2 = { workspace = true }
diff --git a/apps/vectorcraft/src/app.rs b/apps/vectorcraft/src/app.rs
index b91282e7da..2715e08125 100644
--- a/apps/vectorcraft/src/app.rs
+++ b/apps/vectorcraft/src/app.rs
@@ -1,4 +1,4 @@
-#[cfg(all(target_os = "macos", feature = "accessibility", feature = "wgpu"))]
+#[cfg(feature = "wgpu")]
use super::gpu;
use super::nightly_session;
use super::prefs::{flush, save_tick};
@@ -44,7 +44,7 @@ impl eframe::App for App {
if let Some(window_frame) = self.window_frame.as_mut() {
window_frame();
}
- // The characters Alt + keypad codes typed (#5108).
+ // The keypad digits of Alt + keypad codes leave the frame (#5108).
#[cfg(windows)]
super::windows_alt_codes::raw_input_hook(raw);
// Symbol-font characters a keyboard tool typed (NHM Writer legacy Tamil).
@@ -107,7 +107,7 @@ impl eframe::App for App {
// Plug-ins still loading end before the launch marker does (the macOS exit below skips
// dropping the app).
self.app.session.cancel_plugin_loads();
- end_before_teardown(self.frames);
+ end_before_teardown(self.frames, self.graphics_loss.happened());
}
}
@@ -202,16 +202,58 @@ impl App {
/// its own class, which AppKit's Touch Bar support was observing it under, and AppKit aborts the
/// app as it quits on Macs with a Touch Bar. On a normal quit, only the launch marker is needed
/// after the window, so it is ended here as `main` ends it after the window on other platforms.
+/// On every platform, the process also ends here when the window's graphics device was lost
+/// (`device_lost`, #6374). A frame the lost device could not present stays acquired, and releasing
+/// the window's surface as eframe tears it down then panics in wgpu (gfx-rs/wgpu#9277).
/// Not while the window is still starting up (`frames` below [`gpu::STARTUP_FRAMES`]): a graphics
/// failure then starts the app again on another adapter (#651).
-#[allow(unused_variables)]
-fn end_before_teardown(frames: u64) {
- #[cfg(all(target_os = "macos", feature = "accessibility", feature = "wgpu"))]
- if frames >= gpu::STARTUP_FRAMES {
- safe_mode::end_launch();
- log::info!("quitting");
- log::logger().flush();
- std::process::exit(0);
+fn end_before_teardown(frames: u64, device_lost: bool) {
+ if !ends_before_teardown(frames, device_lost) {
+ return;
+ }
+ if device_lost {
+ log::info!("the graphics device was lost: quitting before the window's graphics are torn down");
+ }
+ // `main` does these after the window, which this exit skips.
+ #[cfg(not(target_os = "macos"))]
+ single_instance::resign();
+ safe_mode::end_launch();
+ log::info!("quitting");
+ log::logger().flush();
+ std::process::exit(0);
+}
+
+/// Whether [`end_before_teardown`] ends the process: after the window's start-up, on macOS with
+/// accessibility, or once the graphics device was lost.
+#[cfg(feature = "wgpu")]
+fn ends_before_teardown(frames: u64, device_lost: bool) -> bool {
+ frames >= gpu::STARTUP_FRAMES && (device_lost || cfg!(all(target_os = "macos", feature = "accessibility")))
+}
+
+/// Without wgpu there is no device-lost report, and the window is torn down as usual.
+#[cfg(not(feature = "wgpu"))]
+fn ends_before_teardown(_frames: u64, _device_lost: bool) -> bool {
+ false
+}
+
+#[cfg(all(test, feature = "wgpu"))]
+mod tests {
+ use vectorcraft_ui_egui::graphics::GraphicsLoss;
+
+ use super::*;
+
+ /// A device lost while the app runs ends the process before eframe releases the window's
+ /// surface, on every platform; before the window has started, the start-up restart takes over.
+ #[test]
+ fn a_lost_graphics_device_ends_the_process_before_teardown() {
+ let always = cfg!(all(target_os = "macos", feature = "accessibility"));
+ let (loss, ctx) = (GraphicsLoss::default(), egui::Context::default());
+ assert_eq!(ends_before_teardown(gpu::STARTUP_FRAMES, loss.happened()), always, "no loss: the usual teardown");
+ let (l, c) = (loss.clone(), ctx.clone());
+ std::thread::spawn(move || l.report(&c, "Unknown: Device is lost")).join().unwrap();
+ assert!(loss.take().is_some(), "a frame handles the report");
+ assert!(ends_before_teardown(gpu::STARTUP_FRAMES, loss.happened()), "after a loss the window is not torn down");
+ assert!(!ends_before_teardown(gpu::STARTUP_FRAMES - 1, loss.happened()), "during start-up the adapter restart runs");
}
}
diff --git a/apps/vectorcraft/src/build_flavor.rs b/apps/vectorcraft/src/build_flavor.rs
index 9450a48972..93876b5cce 100644
--- a/apps/vectorcraft/src/build_flavor.rs
+++ b/apps/vectorcraft/src/build_flavor.rs
@@ -1,30 +1,13 @@
//! Build-time channel is distinct from a launch selector. A runtime environment cannot promote a
-//! stable build, and a nightly build refuses to start without its profile.
-use crate::launch_profile::Profile;
-use std::ffi::OsString;
+//! stable build, and a nightly build self-isolates into its canonical nightly profile root (or the
+//! profile root supplied by ArtCraft Launcher).
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
-pub enum BuildFlavor {
- Stable,
- NightlyV1,
-}
+pub use craft_nightly::BuildFlavor;
pub const COMPILED: BuildFlavor = if cfg!(vectorcraft_nightly_v1) { BuildFlavor::NightlyV1 } else { BuildFlavor::Stable };
-pub fn require_profile(flavor: BuildFlavor, profile: &Profile) -> Result<(), String> {
- match (flavor, profile.is_nightly()) {
- (BuildFlavor::NightlyV1, false) => Err("Open VectorCraft Nightly from ArtCraft Launcher".to_string()),
- (BuildFlavor::Stable, true) => Err("This is a stable VectorCraft build; nightly-v1 requires the nightly build".to_string()),
- _ => Ok(()),
- }
-}
-
-pub fn needs_native_error(flavor: BuildFlavor, desktop_session: bool) -> bool {
- desktop_session && flavor == BuildFlavor::NightlyV1
-}
-
-/// `--version` and `-V` on their own, before any other argument is read.
-pub fn version_query(args: &[OsString]) -> bool {
+/// An exact plain version query, before resolving any profile or environment paths.
+pub fn version_query(args: &[std::ffi::OsString]) -> bool {
matches!(args, [arg] if arg == "--version" || arg == "-V")
}
@@ -37,40 +20,19 @@ pub fn version(flavor: BuildFlavor, stable: &str) -> String {
#[cfg(test)]
mod tests {
- use super::*;
+ use super::{BuildFlavor, version, version_query};
#[test]
- fn only_a_nightly_desktop_refusal_requests_a_native_dialog() {
- assert!(needs_native_error(BuildFlavor::NightlyV1, true));
- assert!(!needs_native_error(BuildFlavor::NightlyV1, false));
- assert!(!needs_native_error(BuildFlavor::Stable, true));
- assert!(!needs_native_error(BuildFlavor::Stable, false));
- }
-
- #[test]
- fn nightly_build_without_a_profile_is_refused_before_startup() {
- let started = std::cell::Cell::new(false);
- let result = require_profile(BuildFlavor::NightlyV1, &Profile::Stable).map(|()| started.set(true));
- assert!(result.unwrap_err().contains("ArtCraft Launcher"));
- assert!(!started.get());
- }
-
- #[test]
- fn stable_and_nightly_flavors_accept_only_their_own_profile() {
- let nightly = Profile::NightlyV1(std::path::PathBuf::from("already validated root"));
- assert!(require_profile(BuildFlavor::Stable, &Profile::Stable).is_ok());
- assert!(require_profile(BuildFlavor::Stable, &nightly).is_err());
- assert!(require_profile(BuildFlavor::NightlyV1, &nightly).is_ok());
- assert!(require_profile(BuildFlavor::NightlyV1, &Profile::Stable).is_err());
- }
-
- #[test]
- fn nightly_version_query_is_unambiguous_and_never_reinterprets_file_arguments() {
- assert_eq!(version(BuildFlavor::Stable, "0.24.1"), "0.24.1");
- assert_eq!(version(BuildFlavor::NightlyV1, "0.24.1"), "0.24.1 (nightly-v1)");
+ fn plain_version_query_is_exact() {
assert!(version_query(&["--version".into()]));
assert!(version_query(&["-V".into()]));
assert!(!version_query(&["--".into(), "--version".into()]));
assert!(!version_query(&[]));
}
+
+ #[test]
+ fn version_labels_nightly_without_changing_stable() {
+ assert_eq!(version(BuildFlavor::Stable, "0.24.1"), "0.24.1");
+ assert_eq!(version(BuildFlavor::NightlyV1, "0.24.1"), "0.24.1 (nightly-v1)");
+ }
}
diff --git a/apps/vectorcraft/src/gpu.rs b/apps/vectorcraft/src/gpu.rs
index 198e7dcc85..f71cc434ba 100644
--- a/apps/vectorcraft/src/gpu.rs
+++ b/apps/vectorcraft/src/gpu.rs
@@ -32,6 +32,12 @@
//! that adapter, as the next one in the order would be tried. Each restart leaves out one more
//! adapter, so it ends when none is left.
//!
+//! When no adapter is picked at all, because none is left or no graphics backend started (wgpu
+//! needs Vulkan, OpenGL 3.3 or OpenGL ES 3.0, and the driver of Intel's Ironlake graphics offers
+//! none of them, so the window's surface failed "for any enabled backend" with no backend listed,
+//! #2654), Linux and the BSDs start once more on Mesa's software renderer ([`Software`]); after
+//! that, the error that ends the app says what the graphics driver needs.
+//!
//! An adapter can also hang instead of failing: on a hybrid laptop with High Performance chosen,
//! the discrete GPU never put the window's first frame on the screen, with no error and no panic,
//! and the app stayed in the background without a window (#964). [`watch_first_frame`] gives the
@@ -853,7 +859,7 @@ pub fn watch_first_frame(startup: Arc) {
// The new app records its own start.
startup.ended();
skip.push(failed.to_string());
- match restart(&skip.join(",")) {
+ match restart(&skip.join(","), false) {
Ok(()) => std::process::exit(0),
Err(e) => {
log::error!("starting again failed: {e}");
@@ -950,6 +956,94 @@ fn restart_without<'a>(graphics_failed: bool, frames: u64, picked: Option<&'a st
picked.filter(|p| graphics_failed && frames < STARTUP_FRAMES && !skip.iter().any(|s| s == p))
}
+/// Whether a start whose window no graphics adapter could show may start again on Mesa's software
+/// renderer, which draws OpenGL on the CPU (llvmpipe).
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum Software {
+ /// Linux and the BSDs, where Mesa provides OpenGL, and this start isn't on it yet.
+ Possible,
+ /// This start already draws on it: the app started again with [`SOFTWARE_ENV`], or the user
+ /// set `LIBGL_ALWAYS_SOFTWARE`.
+ Tried,
+ /// Windows and macOS, or a start that `WGPU_BACKEND` or `WGPU_ADAPTER_NAME` chooses.
+ Unavailable,
+}
+
+impl Software {
+ /// This start's [`Software`], from the platform and the environment.
+ pub fn from_env() -> Self {
+ if cfg!(any(windows, target_os = "macos")) || explicit_choice() {
+ Software::Unavailable
+ } else if software_start() || std::env::var_os("LIBGL_ALWAYS_SOFTWARE").is_some() {
+ Software::Tried
+ } else {
+ Software::Possible
+ }
+ }
+}
+
+/// Set by the app when it starts again on Mesa's software renderer because no graphics adapter
+/// could show the window (#2654).
+pub const SOFTWARE_ENV: &str = "VECTORCRAFT_GPU_SOFTWARE";
+
+/// Whether this start is the one the app made on Mesa's software renderer ([`SOFTWARE_ENV`]).
+pub fn software_start() -> bool {
+ std::env::var_os(SOFTWARE_ENV).is_some()
+}
+
+/// The graphics APIs the window can draw with on this platform, for the error that ends the app
+/// when no adapter can show it and for the note of a start on Mesa's software renderer.
+pub const NEEDS: &str = if cfg!(windows) {
+ "Direct3D 12, OpenGL 3.3 or OpenGL ES 3.0"
+} else if cfg!(target_os = "macos") {
+ "Metal"
+} else {
+ "Vulkan, OpenGL 3.3 or OpenGL ES 3.0"
+};
+
+/// What follows the window's run ([`next`]).
+#[derive(Debug, PartialEq, Eq)]
+enum Next {
+ /// The window closed normally.
+ Done,
+ /// Start again without the adapters in `skip`, on Mesa's software renderer when `software`.
+ Restart { skip: Vec, software: bool },
+ /// End the app with this error.
+ Stop(String),
+}
+
+/// What follows the window's run: `why` it failed (`None` when it closed normally), whether the
+/// graphics failed, the `frames` the UI ran, the adapter `picked`, those left out (`skip`) and
+/// whether the software renderer is still to try. A failure on an adapter while starting up starts
+/// again without it. When no adapter was picked, because none can show the window or no graphics
+/// backend started at all (an old GPU whose driver offers neither Vulkan nor OpenGL 3.3 or OpenGL
+/// ES 3.0, such as Intel's Ironlake graphics, #2654), Linux and the BSDs start once more on Mesa's
+/// software renderer, and after that the error says what the window needs.
+fn next(why: Option, graphics_failed: bool, frames: u64, picked: Option<&str>, mut skip: Vec, software: Software) -> Next {
+ let Some(why) = why else { return Next::Done };
+ if let Some(failed) = restart_without(graphics_failed, frames, picked, &skip) {
+ log::error!("the window failed on graphics adapter {failed} ({why}): starting again without it");
+ skip.push(failed.to_string());
+ return Next::Restart { skip, software: false };
+ }
+ if !graphics_failed {
+ return Next::Stop(why);
+ }
+ if picked.is_some() || frames >= STARTUP_FRAMES {
+ return Next::Stop(format!("{why} ({HELP})"));
+ }
+ match software {
+ Software::Possible => {
+ log::error!("no graphics adapter could show the window ({why}): starting again on Mesa's software renderer, which draws on the CPU");
+ Next::Restart { skip, software: true }
+ }
+ Software::Tried => Next::Stop(format!(
+ "{why}: no graphics adapter could show the window, not even Mesa's software renderer (the graphics driver needs {NEEDS}; {HELP})"
+ )),
+ Software::Unavailable => Next::Stop(format!("{why}: no graphics adapter could show the window (the graphics driver needs {NEEDS}; {HELP})")),
+ }
+}
+
/// After the window's run: `Ok` when it closed normally or the app started again (see the module
/// docs), otherwise why it failed. `outcome` is eframe's result, or the message of a panic that
/// ended it.
@@ -957,28 +1051,35 @@ pub fn finish(outcome: Result, startup: &Startup) -> Res
// Whatever follows, this start didn't crash; a new app records its own start.
startup.ended();
let (why, graphics_failed) = match outcome {
- Ok(Ok(())) => return Ok(()),
- Ok(Err(e @ eframe::Error::Wgpu(_))) => (e.to_string(), true),
- Ok(Err(e)) => (e.to_string(), false),
- Err(panic) => (panic, GRAPHICS_PANIC.load(Ordering::Relaxed)),
+ Ok(Ok(())) => (None, false),
+ Ok(Err(e @ eframe::Error::Wgpu(_))) => (Some(e.to_string()), true),
+ Ok(Err(e)) => (Some(e.to_string()), false),
+ Err(panic) => (Some(panic), GRAPHICS_PANIC.load(Ordering::Relaxed)),
};
let frames = startup.ui.get().map_or(0, egui::Context::cumulative_frame_nr);
- let mut skip = skipped();
- let Some(failed) = restart_without(graphics_failed, frames, startup.adapter.get().map(String::as_str), &skip) else {
- return Err(if graphics_failed { format!("{why} ({HELP})") } else { why });
- };
- log::error!("the window failed on graphics adapter {failed} ({why}): starting again without it");
- skip.push(failed.to_string());
- restart(&skip.join(",")).map_err(|e| format!("{why}; starting again failed: {e}"))
+ let picked = startup.adapter.get().map(String::as_str);
+ match next(why.clone(), graphics_failed, frames, picked, skipped(), Software::from_env()) {
+ Next::Done => Ok(()),
+ Next::Stop(e) => Err(e),
+ Next::Restart { skip, software } => {
+ let why = why.unwrap_or_default();
+ restart(&skip.join(","), software).map_err(|e| format!("{why}; starting again failed: {e}"))
+ }
+ }
}
-/// Start the app again with the same arguments, leaving out the adapters in `skip`. On Unix the
-/// new app replaces this process (same process id, so an AppImage keeps its files mounted), and
-/// this returns only on failure; on Windows it starts beside this one, which then exits.
-fn restart(skip: &str) -> std::io::Result<()> {
+/// Start the app again with the same arguments, leaving out the adapters in `skip`, and on Mesa's
+/// software renderer when `software` (`LIBGL_ALWAYS_SOFTWARE`, with [`SOFTWARE_ENV`] so it is
+/// tried once). On Unix the new app replaces this process (same process id, so an AppImage keeps
+/// its files mounted), and this returns only on failure; on Windows it starts beside this one,
+/// which then exits.
+fn restart(skip: &str, software: bool) -> std::io::Result<()> {
log::logger().flush();
let mut c = std::process::Command::new(std::env::current_exe()?);
c.args(std::env::args_os().skip(1)).env(SKIP_ENV, skip);
+ if software {
+ c.env("LIBGL_ALWAYS_SOFTWARE", "1").env(SOFTWARE_ENV, "1");
+ }
#[cfg(unix)]
{
use std::os::unix::process::CommandExt as _;
diff --git a/apps/vectorcraft/src/gpu/tests.rs b/apps/vectorcraft/src/gpu/tests.rs
index 792518993d..4b660854f6 100644
--- a/apps/vectorcraft/src/gpu/tests.rs
+++ b/apps/vectorcraft/src/gpu/tests.rs
@@ -602,15 +602,52 @@ fn only_a_graphics_failure_while_starting_up_restarts_without_the_adapter() {
fn a_normal_exit_or_another_failure_does_not_restart() {
let startup = Startup::default();
assert_eq!(finish(Ok(Ok(())), &startup), Ok(()));
- // No adapter was picked (none can show the window): the error is returned, nothing restarts.
- let none = eframe::Error::Wgpu(eframe::egui_wgpu::WgpuError::CustomNativeAdapterSelectionError("no graphics adapter can show the window".into()));
- assert_eq!(
- finish(Ok(Err(none)), &startup),
- Err(format!("WGPU error: Adapter selection failed: no graphics adapter can show the window ({HELP})"))
- );
let _ = startup.adapter.set("Vulkan:1002:164e".into());
GRAPHICS_PANIC.store(false, Ordering::Relaxed);
assert_eq!(finish(Err("a bug".into()), &startup), Err("a bug".into()));
+ // The same, decided without starting anything.
+ let amd = Some("Vulkan:1002:164e");
+ for software in [Software::Possible, Software::Tried, Software::Unavailable] {
+ assert_eq!(next(None, false, 0, amd, vec![], software), Next::Done);
+ assert_eq!(next(Some("a bug".into()), false, 0, None, vec![], software), Next::Stop("a bug".into()));
+ // A failure after start-up, or on an adapter already left out, is not the start's.
+ assert_eq!(next(Some("lost".into()), true, STARTUP_FRAMES, amd, vec![], software), Next::Stop(format!("lost ({HELP})")));
+ let skip = vec!["Vulkan:1002:164e".to_string()];
+ assert_eq!(next(Some("lost".into()), true, 0, amd, skip, software), Next::Stop(format!("lost ({HELP})")));
+ }
+ // An adapter that failed while starting up is left out, never with the software renderer.
+ assert_eq!(
+ next(Some("lost".into()), true, 0, amd, vec!["Gl:8086:0046".into()], Software::Possible),
+ Next::Restart { skip: vec!["Gl:8086:0046".into(), "Vulkan:1002:164e".into()], software: false }
+ );
+}
+
+/// #2654: on a ThinkPad T510 with Intel's Ironlake graphics, whose driver offers neither Vulkan
+/// nor OpenGL 3.3 or OpenGL ES 3.0, wgpu started no backend, so the window's surface failed before
+/// any adapter was listed and the app ended; started with `LIBGL_ALWAYS_SOFTWARE=1`, it ran on
+/// llvmpipe. With no adapter picked, Linux starts once more on Mesa's software renderer, keeping
+/// the adapters already left out, and the error after that says what the driver needs.
+#[test]
+fn a_start_no_adapter_can_show_tries_the_software_renderer_once() {
+ let surface = "WGPU error: Failed to create surface for any enabled backend: {}";
+ let skip = vec!["Vulkan:8086:0046".to_string()];
+ assert_eq!(next(Some(surface.into()), true, 0, None, skip.clone(), Software::Possible), Next::Restart { skip: skip.clone(), software: true });
+ // No adapter left that can show the window, after restarts without each.
+ let none = "WGPU error: Adapter selection failed: no graphics adapter can show the window";
+ assert_eq!(next(Some(none.into()), true, 0, None, skip.clone(), Software::Possible), Next::Restart { skip: skip.clone(), software: true });
+ // Already on the software renderer: the app ends, saying what the window needs.
+ let Next::Stop(tried) = next(Some(surface.into()), true, 0, None, skip.clone(), Software::Tried) else {
+ panic!("a start already on the software renderer starts again")
+ };
+ assert!(tried.starts_with(surface), "{tried}");
+ assert!(tried.contains("not even Mesa's software renderer") && tried.contains(NEEDS) && tried.contains(HELP), "{tried}");
+ // Windows, macOS or a backend the user chose: no software renderer to start on.
+ let Next::Stop(unavailable) = next(Some(surface.into()), true, 0, None, skip, Software::Unavailable) else {
+ panic!("a start without the software renderer starts again")
+ };
+ assert!(unavailable.contains(NEEDS) && unavailable.contains(HELP) && !unavailable.contains("Mesa"), "{unavailable}");
+ // A failure outside the graphics never starts again.
+ assert_eq!(next(Some("a bug".into()), false, 0, None, vec![], Software::Possible), Next::Stop("a bug".into()));
}
/// A log folder of its own for each test.
diff --git a/apps/vectorcraft/src/launch_profile.rs b/apps/vectorcraft/src/launch_profile.rs
index 12615dd81d..d986f28d71 100644
--- a/apps/vectorcraft/src/launch_profile.rs
+++ b/apps/vectorcraft/src/launch_profile.rs
@@ -1,130 +1,28 @@
-//! Launcher-owned nightly-v1 bootstrap. Selected before logging, updates, fonts or saved state.
-//! Stable launches retain their original arguments and directory policy.
-//!
-//! The protocol is `vectorcraft --launch-profile nightly-v1 --profile-root -- [files…]`: the
-//! selector and the root are separate tokens, exactly once each, and everything after `--` is a file
-//! even when it looks like one of them. The Launcher's version check
-//! (`… --version`) is answered before the root is validated or touched.
+//! Nightly-v1 bootstrap backed by [`craft_nightly`]. Selected before logging, updates, fonts or
+//! saved state. Stable launches retain their original arguments and directory policy; direct
+//! nightly launches self-isolate into [`craft_nightly::canonical_profile_root`], while ArtCraft
+//! Launcher can supply `--launch-profile nightly-v1 --profile-root -- [args…]`.
use std::ffi::OsString;
-use std::path::{Component, Path, PathBuf};
-use std::sync::OnceLock;
-pub const VERSION: &str = "nightly-v1";
+pub use craft_nightly::NIGHTLY_V1_CONTRACT as VERSION;
+use craft_nightly::{BuildFlavor, Launch, Profile, ProfileError, StartupOptions};
-#[derive(Clone, Debug, PartialEq, Eq)]
-pub enum Profile {
- Stable,
- NightlyV1(PathBuf),
-}
-
-impl Profile {
- pub fn is_nightly(&self) -> bool {
- matches!(self, Self::NightlyV1(_))
- }
-
- pub fn root(&self) -> Option<&Path> {
- match self {
- Self::Stable => None,
- Self::NightlyV1(root) => Some(root),
- }
- }
-}
-
-#[derive(Debug, PartialEq, Eq)]
-pub struct Launch {
- pub profile: Profile,
- pub args: Vec,
-}
-
-static PROFILE: OnceLock = OnceLock::new();
+static STABLE: Profile = Profile::Stable;
pub fn current() -> &'static Profile {
- PROFILE.get().unwrap_or(&Profile::Stable)
+ craft_nightly::current().unwrap_or(&STABLE)
}
-pub fn install(profile: Profile) -> Result<(), String> {
- PROFILE.set(profile).map_err(|_| "the launch profile was already selected".to_string())
-}
-
-/// Recognize only the agreed literal selector/root pair before `--`. No filesystem or startup hook
-/// runs here.
-pub fn parse(args: Vec) -> Result {
- let mut selector = None;
- let mut root = None;
- let mut other = Vec::new();
- let mut files = Vec::new();
- let mut iter = args.iter();
- let mut delimiter = false;
- while let Some(arg) = iter.next() {
- if arg == "--" {
- delimiter = true;
- files.extend(iter.cloned());
- break;
- }
- if arg == "--launch-profile" || arg == "--profile-root" {
- let slot = if arg == "--launch-profile" { &mut selector } else { &mut root };
- if slot.is_some() {
- return Err("the profile selector and root must each occur exactly once".to_string());
- }
- let value = iter.next().filter(|v| !v.is_empty()).ok_or_else(|| "the profile selector/root needs a value".to_string())?;
- if value.to_string_lossy().starts_with("--") {
- return Err("the profile selector/root needs a value".to_string());
- }
- *slot = Some(value.clone());
- } else if arg.to_string_lossy().starts_with("--launch-profile=") || arg.to_string_lossy().starts_with("--profile-root=") {
- return Err("the nightly protocol requires separate literal selector/root argument tokens".to_string());
- } else {
- other.push(arg.clone());
- }
- }
- match (selector, root) {
- (None, None) => Ok(Launch { profile: Profile::Stable, args }),
- (Some(version), Some(root)) if version == VERSION => {
- if !delimiter || !other.is_empty() {
- return Err("nightly-v1 accepts only its selector/root followed by -- and file names".to_string());
- }
- let root = PathBuf::from(root);
- if !root.is_absolute() || root.components().any(|c| matches!(c, Component::ParentDir)) {
- return Err("the nightly profile root must be absolute and contain no parent traversal".to_string());
- }
- Ok(Launch { profile: Profile::NightlyV1(root), args: std::iter::once(OsString::from("--")).chain(files).collect() })
- }
- (Some(_), Some(_)) => Err("unsupported launch profile (expected nightly-v1)".to_string()),
- _ => Err("--launch-profile and --profile-root must be supplied together".to_string()),
- }
-}
-
-/// The Launcher's version check: the selector/root pair followed by exactly `--version` (or `-V`),
-/// answered like a plain version query. Only [`parse`]'s lexical checks apply; the root is never
-/// validated or touched, and `-- --version` stays a file name.
-pub fn version_query(args: &[OsString]) -> bool {
- let Some((last, pair)) = args.split_last() else { return false };
- if last != "--version" && last != "-V" {
- return false;
- }
- let lexical = pair.iter().cloned().chain(std::iter::once(OsString::from("--"))).collect();
- matches!(parse(lexical), Ok(Launch { profile: Profile::NightlyV1(_), args }) if args.len() == 1)
-}
-
-/// Validation finishes before the caller's first startup effect. Stable never calls the nightly root
-/// validator, so its portable and config resolution stays unchanged.
-pub fn prepare(mut launch: Launch, validate: impl FnOnce(&Path) -> Result) -> Result {
- if let Profile::NightlyV1(root) = &launch.profile {
- launch.profile = Profile::NightlyV1(validate(root)?);
- }
- Ok(launch)
-}
-
-/// Resolve the selected private root before the caller's first startup effect.
-pub fn validate_root(root: &Path, env: impl Fn(&str) -> Option, exe: Option<&Path>) -> Result {
- crate::profile_root::validate(root, env, exe, crate::prefs_dir::profile::ensure_writable)
+pub fn prepare_launch(flavor: BuildFlavor, args: impl IntoIterator- ) -> Result {
+ let spec = crate::profile_root::app_profile_spec();
+ craft_nightly::prepare_launch(flavor, &spec, args, &StartupOptions::default())
}
/// The arguments a child of this process starts with: a nightly launch hands its profile on, so the
-/// child opens the same private profile instead of being refused ("Open VectorCraft Nightly…"), and
-/// `--` keeps a file whose name starts with '-' a file. Stable's child arguments are unchanged.
-/// Only `single_instance` starts a child, and macOS does not build it.
+/// child opens the same private profile, and `--` keeps a file whose name starts with '-' a file.
+/// Stable's child arguments are unchanged. Only `single_instance` starts a child, and macOS does
+/// not build it.
#[cfg(not(target_os = "macos"))]
pub fn child_args(files: &[String]) -> Vec {
child_args_for(current(), files)
@@ -132,21 +30,24 @@ pub fn child_args(files: &[String]) -> Vec {
#[cfg(not(target_os = "macos"))]
fn child_args_for(profile: &Profile, files: &[String]) -> Vec {
- let mut args: Vec = match profile {
- Profile::Stable => Vec::new(),
- Profile::NightlyV1(root) => {
- vec![OsString::from("--launch-profile"), OsString::from(VERSION), OsString::from("--profile-root"), root.clone().into_os_string()]
- }
- };
- args.push(OsString::from("--"));
- args.extend(files.iter().map(OsString::from));
- args
+ let delimited: Vec = std::iter::once(OsString::from("--")).chain(files.iter().map(OsString::from)).collect();
+ match profile {
+ Profile::Stable => delimited,
+ Profile::NightlyV1(root) => craft_nightly::launch_arguments(root, &delimited),
+ }
}
#[cfg(test)]
mod tests {
- use super::*;
- use std::cell::Cell;
+ use std::ffi::OsString;
+ use std::path::PathBuf;
+
+ use craft_nightly::{BuildFlavor, Profile, ProfileError, StartupOptions, canonical_profile_root, parse_startup};
+
+ use super::VERSION;
+ #[cfg(not(target_os = "macos"))]
+ use super::child_args_for;
+ use crate::profile_root::app_profile_spec;
fn args(values: &[&str]) -> Vec {
values.iter().map(OsString::from).collect()
@@ -156,95 +57,72 @@ mod tests {
if cfg!(windows) { r"C:\NightlyData\profiles\vectorcraft" } else { "/nightly-data/profiles/vectorcraft" }
}
- fn nightly() -> Vec {
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--"])
- }
-
#[test]
- fn stable_arguments_and_directory_policy_are_unchanged() {
+ fn stable_arguments_are_unchanged_and_nightly_flags_are_refused() {
+ let spec = app_profile_spec();
for argv in [args(&[]), args(&["--new-instance", "a.svg"]), args(&["--", "--launch-profile", "file.svg"])] {
- let launch = prepare(parse(argv.clone()).unwrap(), |_| panic!("stable must never validate a nightly root")).unwrap();
- assert_eq!(launch, Launch { profile: Profile::Stable, args: argv });
+ let launch = parse_startup(BuildFlavor::Stable, &spec, argv.clone(), &StartupOptions::default()).unwrap();
+ assert_eq!(launch.profile, Profile::Stable);
+ assert_eq!(launch.passthrough_args, argv);
}
+
+ let nightly_flags = args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--"]);
+ let err = parse_startup(BuildFlavor::Stable, &spec, nightly_flags, &StartupOptions::default()).unwrap_err();
+ assert!(matches!(err, ProfileError::NightlyFlagsInStableBuild));
}
#[test]
- fn exact_version_and_root_are_parsed_without_reinterpreting_file_names() {
- let mut argv = nightly();
- argv.extend(args(&["--profile-root", "art with spaces.svg"]));
- let launch = parse(argv).unwrap();
+ fn nightly_direct_launch_self_isolates_into_canonical_profile_root() {
+ let spec = app_profile_spec();
+ let expected_root = canonical_profile_root("vectorcraft").unwrap();
+
+ let empty = parse_startup(BuildFlavor::NightlyV1, &spec, Vec::new(), &StartupOptions::default()).unwrap();
+ assert_eq!(empty.profile, Profile::NightlyV1(expected_root.clone()));
+ assert!(empty.passthrough_args.is_empty());
+
+ let with_args = parse_startup(BuildFlavor::NightlyV1, &spec, args(&["--safe-mode", "art.svg"]), &StartupOptions::default()).unwrap();
+ assert_eq!(with_args.profile, Profile::NightlyV1(expected_root));
+ assert_eq!(with_args.passthrough_args, args(&["--safe-mode", "art.svg"]));
+ }
+
+ #[test]
+ fn explicit_launcher_arguments_preserve_profile_root_and_user_args() {
+ let spec = app_profile_spec();
+ let argv = args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", "--profile-root", "art with spaces.svg"]);
+ let launch = parse_startup(BuildFlavor::NightlyV1, &spec, argv, &StartupOptions::default()).unwrap();
assert_eq!(launch.profile, Profile::NightlyV1(PathBuf::from(absolute())));
- assert_eq!(launch.args, args(&["--", "--profile-root", "art with spaces.svg"]));
+ assert_eq!(launch.passthrough_args, args(&["--profile-root", "art with spaces.svg"]));
}
#[test]
- fn missing_duplicate_unknown_and_conflicting_profile_arguments_are_refused() {
- for argv in [
- args(&["--launch-profile", VERSION]),
- args(&["--profile-root", absolute()]),
- args(&["--launch-profile", "future-v2", "--profile-root", absolute(), "--"]),
- args(&["--launch-profile", VERSION, "--launch-profile", VERSION, "--profile-root", absolute(), "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--profile-root", absolute(), "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", "relative", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", "../escape", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", "", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--new-instance", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute()]),
- ] {
- assert!(parse(argv.clone()).is_err(), "{argv:?}");
- }
- }
-
- #[test]
- fn the_launcher_version_check_is_a_version_query_only_in_its_exact_form() {
- let pair = &["--launch-profile", VERSION, "--profile-root", absolute()];
- let reversed = &["--profile-root", absolute(), "--launch-profile", VERSION];
+ fn version_queries_are_recognized_plain_and_via_launcher() {
+ let spec = app_profile_spec();
for flag in ["--version", "-V"] {
- for form in [pair, reversed] {
- let mut argv = args(form);
- argv.push(flag.into());
- assert!(version_query(&argv), "{argv:?}");
+ for argv in [
+ args(&[flag]),
+ args(&["--launch-profile", VERSION, "--profile-root", absolute(), flag]),
+ args(&["--profile-root", absolute(), "--launch-profile", VERSION, flag]),
+ args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", flag]),
+ ] {
+ let launch = parse_startup(BuildFlavor::NightlyV1, &spec, argv.clone(), &StartupOptions::default()).unwrap();
+ assert!(launch.is_version_query(), "{argv:?}");
}
}
- for argv in [
- args(&["--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", "--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--new-instance", "--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version", "--version"]),
- args(&["--version", "--launch-profile", VERSION, "--profile-root", absolute()]),
- args(&["--launch-profile", "future-v2", "--profile-root", absolute(), "--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", "relative", "--version"]),
- args(&["--launch-profile", VERSION, "--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--help"]),
- ] {
- assert!(!version_query(&argv), "{argv:?}");
- }
- // Outside the query the strict protocol still refuses the version flag.
- assert!(parse(args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version"])).is_err());
}
#[test]
- fn failed_root_validation_never_reaches_startup_or_falls_back_to_stable() {
- let reached = Cell::new(false);
- let result = prepare(parse(nightly()).unwrap(), |_| Err("read-only or unsafe profile".to_string())).map(|_| reached.set(true));
- assert!(result.is_err());
- assert!(!reached.get());
- }
-
- #[test]
- fn successful_root_validation_keeps_the_persistent_root_not_the_binary_tag() {
- let checked = PathBuf::from(absolute()).join("checked");
- let launch = prepare(parse(nightly()).unwrap(), |_| Ok(checked.clone())).unwrap();
- assert_eq!(launch.profile.root(), Some(checked.as_path()));
- assert!(launch.profile.is_nightly());
- }
-
- #[test]
- fn a_joined_flag_form_is_refused() {
- for joined in [format!("--launch-profile={VERSION}"), format!("--profile-root={}", absolute())] {
- let argv = vec![OsString::from(joined), OsString::from("--")];
- assert!(parse(argv).is_err());
+ fn version_and_document_arguments_are_not_a_version_only_query() {
+ let spec = app_profile_spec();
+ for flag in ["--version", "-V"] {
+ for argv in [
+ args(&[flag, "art with spaces.svg"]),
+ args(&["--launch-profile", VERSION, "--profile-root", absolute(), flag, "art with spaces.svg"]),
+ args(&["--profile-root", absolute(), "--launch-profile", VERSION, flag, "art with spaces.svg"]),
+ ] {
+ let launch = parse_startup(BuildFlavor::NightlyV1, &spec, argv, &StartupOptions::default()).unwrap();
+ assert!(!launch.is_version_query());
+ assert_eq!(launch.passthrough_args, args(&[flag, "art with spaces.svg"]));
+ }
}
}
@@ -258,6 +136,7 @@ mod tests {
#[cfg(not(target_os = "macos"))]
#[test]
fn a_nightly_child_inherits_the_selected_profile() {
+ let spec = app_profile_spec();
let root = PathBuf::from(absolute());
let child = child_args_for(&Profile::NightlyV1(root.clone()), &["art.svg".to_string()]);
let expected = vec![
@@ -266,12 +145,12 @@ mod tests {
OsString::from("--profile-root"),
root.into_os_string(),
OsString::from("--"),
+ OsString::from("--"),
OsString::from("art.svg"),
];
assert_eq!(child, expected);
- // The child's own parse finds the same profile and the file list.
- let launch = parse(child).unwrap();
+ let launch = parse_startup(BuildFlavor::NightlyV1, &spec, child, &StartupOptions::default()).unwrap();
assert!(launch.profile.is_nightly());
- assert_eq!(launch.args, args(&["--", "art.svg"]));
+ assert_eq!(launch.passthrough_args, args(&["--", "art.svg"]));
}
}
diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs
index 7812264ac0..b603ed7960 100644
--- a/apps/vectorcraft/src/main.rs
+++ b/apps/vectorcraft/src/main.rs
@@ -112,6 +112,43 @@ use prefs::{load_prefs, log_dir, open_store, prefs_enabled};
const DEFAULT_SIZE: [f32; 2] = [1440.0, 900.0];
const MIN_SIZE: [f32; 2] = [800.0, 500.0];
+/// Apply the saved main-window placement before the first frame. On a first launch the
+/// framework maximizes the window when its default size would not fit the current screen.
+fn restore_main_window(window: &winit::window::Window, store: &Store, legacy: Option, wayland: bool) {
+ use craft::behavior::placement::{Defaults, Placement, place};
+ use craft::behavior::{Monitor, MonitorKey};
+ use winit::dpi::{LogicalSize, PhysicalPosition};
+
+ let handles: Vec<_> = window.available_monitors().collect();
+ let monitors: Vec<_> = handles
+ .iter()
+ .map(|monitor| {
+ let size = monitor.size();
+ let size = [size.width, size.height];
+ let position = monitor.position();
+ Monitor::new(MonitorKey::new(monitor.name().unwrap_or_default(), size), [position.x, position.y], size, monitor.scale_factor() as f32)
+ })
+ .collect();
+ let home = window.current_monitor().or_else(|| window.primary_monitor()).and_then(|monitor| handles.iter().position(|m| *m == monitor));
+ let defaults = Defaults::new(DEFAULT_SIZE, MIN_SIZE).with_no_position(wayland);
+ let saved = store.get(craft::window::restore::MAIN).or_else(|| {
+ let old = legacy?;
+ let mut placement = Placement::new(old.size, window.scale_factor() as f32);
+ placement.position_px = old.pos;
+ placement.maximized = old.maximized;
+ placement.repaired()
+ });
+ let placement = place(saved.as_ref(), &monitors, home, &defaults);
+ if let Some([x, y]) = placement.position_px {
+ window.set_outer_position(PhysicalPosition::new(x, y));
+ }
+ let [width, height] = placement.normal.size;
+ let _ = window.request_inner_size(LogicalSize::new(width, height));
+ if placement.maximized {
+ window.set_maximized(true);
+ }
+}
+
/// The window, Dock, taskbar and app-switcher icon (`assets/app-icon/`, see its README). macOS gets
/// the version with Apple's transparent margin; elsewhere the full-bleed tile. The app ID matches
/// `packaging/linux/ai.storyteller.vectorcraft.desktop` so Wayland docks find the launcher icon.
@@ -359,15 +396,36 @@ fn read_command_line(
/// Whether the window opens through XWayland, for Linux Display Server `pref` (`main`).
#[cfg(target_os = "linux")]
fn opens_through_xwayland(pref: Option<&str>) -> bool {
- if !xwayland::wanted(pref, |name| std::env::var_os(name), xwayland::pen_attached) {
+ use xwayland::Choice;
+ let choice = xwayland::choose(pref, |name| std::env::var_os(name), xwayland::pen_attached);
+ // On native Wayland winit 0.30 receives no pen input, so the log says why the window stays there.
+ match &choice {
+ Choice::NotWayland | Choice::Chosen | Choice::Pen(_) => {}
+ Choice::NoXDisplay { x11: true } => {
+ log::warn!("Linux Display Server is X11, but there is no X display (DISPLAY is unset): opening the window on Wayland")
+ }
+ Choice::NoXDisplay { x11: false } => log::info!(
+ "opening the window on Wayland, where a pen does not reach it: there is no X display (DISPLAY is unset) to open it through XWayland"
+ ),
+ Choice::NativeWayland => log::info!("VECTORCRAFT_NATIVE_WAYLAND is set: opening the window on Wayland, where a pen does not reach it"),
+ Choice::NoPen => log::info!("no pen in /proc/bus/input/devices: opening the window on Wayland"),
+ Choice::NoDeviceList(e) => log::warn!("can't look for a pen ({e}): opening the window on Wayland, where a pen does not reach it"),
+ }
+ if !choice.xwayland() {
return false;
}
if !xwayland::x11_libraries_found() {
- log::warn!("Linux Display Server is X11, but the X11 libraries aren't all installed: opening the window on Wayland");
+ if let Choice::Pen(name) = &choice {
+ log::warn!(
+ "pen found ({name}), but the X11 libraries aren't all installed: opening the window on Wayland, where the pen does not reach it"
+ );
+ } else {
+ log::warn!("Linux Display Server is X11, but the X11 libraries aren't all installed: opening the window on Wayland");
+ }
return false;
}
- if pref != Some("x11") {
- log::info!("pen found: opening the window through XWayland, where the pen works (VECTORCRAFT_NATIVE_WAYLAND=1 keeps Wayland)");
+ if let Choice::Pen(name) = &choice {
+ log::info!("pen found ({name}): opening the window through XWayland, where the pen works (VECTORCRAFT_NATIVE_WAYLAND=1 keeps Wayland)");
} else {
log::info!("opening the window through XWayland (Preferences › Performance › Linux Display Server)");
}
@@ -384,58 +442,47 @@ fn channel_name() -> &'static str {
/// Says why a nightly launch was refused, then exits 2. A window could not have shown it yet: this
/// app has no message box of its own before eframe starts (its dialogs are egui windows), so the
-/// text goes to standard error, which a Launcher launch records. The desktop-session test still
-/// decides whether a daily user would have seen it, for the message's wording.
+/// text goes to standard error, which a Launcher launch records.
fn report_launch_profile_error(error: &str) {
eprintln!("VectorCraft launch profile: {error}");
- let desktop_session = cfg!(windows)
- || cfg!(target_os = "macos")
- || (cfg!(target_os = "linux") && ["DISPLAY", "WAYLAND_DISPLAY"].into_iter().any(|key| std::env::var_os(key).is_some_and(|v| !v.is_empty())));
- if build_flavor::needs_native_error(build_flavor::COMPILED, desktop_session) {
- eprintln!("VectorCraft Nightly: open it from ArtCraft Launcher, which starts it in its own profile");
- }
+}
+
+fn write_nightly_version() {
+ use std::io::Write as _;
+ let line = format!("VectorCraft {}\n", build_flavor::version(build_flavor::COMPILED, env!("VECTORCRAFT_BUILT_VERSION")));
+ let _ = std::io::stdout().write_all(line.as_bytes());
}
/// Selects the immutable launch profile before any startup service or side effect, and returns the
/// arguments the rest of `main` reads. `None` means the process ends here (`--version` answered).
fn prepare_launch() -> Option> {
- // The trusted Launcher protocol is decided before the logger, updates, fonts or any saved state.
+ // The launch profile is decided before the logger, updates, fonts or any saved state.
let argv: Vec<_> = std::env::args_os().skip(1).collect();
- // A nightly answers its version before root validation, process identity, IPC or any window:
- // plain `--version`/`-V`, or the Launcher's `--launch-profile nightly-v1 --profile-root
- // --version`. A stable build leaves the answer to `read_command_line`, exactly as before.
- if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && (build_flavor::version_query(&argv) || launch_profile::version_query(&argv))
- {
- use std::io::Write as _;
- let line = format!("VectorCraft {}\n", build_flavor::version(build_flavor::COMPILED, env!("VECTORCRAFT_BUILT_VERSION")));
- let _ = std::io::stdout().write_all(line.as_bytes());
+ // A plain nightly version query does not even need the OS home/data root to resolve.
+ if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && build_flavor::version_query(&argv) {
+ write_nightly_version();
+ return None;
+ }
+ let early = launch_profile::prepare_launch(build_flavor::COMPILED, argv).unwrap_or_else(|error| {
+ report_launch_profile_error(&error.to_string());
+ std::process::exit(2)
+ });
+ // A launcher version query also exits before process identity, IPC or any window.
+ // `craft_nightly::prepare_launch` skips root preparation for version queries.
+ // A stable build leaves the answer to `read_command_line`, exactly as before.
+ if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && early.is_version_query() {
+ write_nightly_version();
return None;
}
- let early = launch_profile::parse(argv)
- .and_then(|launch| {
- build_flavor::require_profile(build_flavor::COMPILED, &launch.profile)?;
- Ok(launch)
- })
- .and_then(|launch| {
- launch_profile::prepare(launch, |root| {
- launch_profile::validate_root(root, |key| std::env::var_os(key), std::env::current_exe().ok().as_deref())
- })
- })
- .unwrap_or_else(|error| {
- report_launch_profile_error(&error);
- std::process::exit(2)
- });
let nightly = early.profile.is_nightly();
let identity =
if nightly { vectorcraft_ui_egui::os_window::LaunchIdentity::NightlyV1 } else { vectorcraft_ui_egui::os_window::LaunchIdentity::Stable };
- let install = launch_profile::install(early.profile).and_then(|()| {
- // Every data path follows the selected profile from here on: settings, logs, recovery, the
- // user's libraries, plug-ins, caches and the single-instance record.
- if let Some(root) = launch_profile::current().root() {
- prefs_dir::profile::install_data_root(root.to_path_buf())?;
- }
- vectorcraft_ui_egui::os_window::select_identity(identity)
- });
+ // Every data path follows the selected profile from here on: settings, logs, recovery, the
+ // user's libraries, plug-ins, caches and the single-instance record.
+ let install = launch_profile::current()
+ .root()
+ .map_or(Ok(()), |root| prefs_dir::profile::install_data_root(root.to_path_buf()))
+ .and_then(|()| vectorcraft_ui_egui::os_window::select_identity(identity));
if let Err(error) = install {
report_launch_profile_error(&error);
std::process::exit(2);
@@ -453,11 +500,11 @@ fn prepare_launch() -> Option> {
// The window's identity, not the profile, failed: main's own failure status (1).
std::process::exit(1);
}
- Some(early.args)
+ Some(early.passthrough_args)
}
/// The arguments the rest of `main` reads: a nightly's profile tokens were consumed by
-/// `prepare_launch`, so what is left is `--` and the files to open. A stable launch reads its
+/// `prepare_launch`, leaving any user flags and files to open. A stable launch reads its
/// arguments exactly as it always did.
fn launch_arguments(nightly: bool, arguments: &[std::ffi::OsString]) -> Vec {
if nightly { arguments.iter().map(|a| a.to_string_lossy().into_owned()).collect() } else { std::env::args().skip(1).collect() }
@@ -520,8 +567,9 @@ fn finish_pending_update(nightly: bool) {
}
fn main() -> std::process::ExitCode {
- // The launch profile first: a nightly build without one is refused here, before the update
- // helper, the logger, fonts or any saved state, and `--version` is answered here too.
+ // The launch profile first: a nightly build self-isolates or uses the Launcher's profile here,
+ // before the update helper, the logger, fonts or any saved state, and `--version` is answered
+ // here too.
let Some(arguments) = prepare_launch() else { return std::process::ExitCode::SUCCESS };
let nightly = launch_profile::current().is_nightly();
#[cfg(windows)]
@@ -571,6 +619,10 @@ fn main() -> std::process::ExitCode {
mac_fonts::install();
// VectorCraft's own Fonts folder, which text.addFontFiles copies fonts into.
prefs_dir::install_fonts();
+ // Language packs: installs and index fetches run on their own threads, so the window keeps
+ // working while a pack downloads.
+ prefs_dir::use_language_packs();
+ vectorcraft_engine::packs::run_in_background(true);
// The log file lives in the settings directory, next to the preferences; opened after the
// arguments, so `--version` leaves no file behind. Records logged until now are written to it
// first. Runs without preferences (agents' test runs) log to standard error only, so they
@@ -691,14 +743,14 @@ fn main() -> std::process::ExitCode {
// With Windows Ink, winit reports a pen as a touch and drops its barrel button and which end
// is down; the message hook notes each pointer contact and whether it starts with the barrel
// button held, and writes the pen's end into the pen feed (`windows_stylus`). It also notes the
- // characters Alt + keypad codes type (`windows_alt_codes`).
+ // keypad digits of Alt + keypad codes (`windows_alt_codes`).
#[cfg(windows)]
let options = {
use winit::platform::windows::EventLoopBuilderExtWindows as _;
let mut options = options;
options.event_loop_builder = Some(Box::new(|builder| {
builder.with_msg_hook(|msg| {
- // Alt + keypad codes (#5108), which winit drops; neither hook consumes a message.
+ // Alt + keypad codes (#5108); neither hook consumes a message.
windows_alt_codes::msg_hook(msg);
windows_stylus::msg_hook(msg)
});
@@ -787,9 +839,13 @@ fn main() -> std::process::ExitCode {
Box::new(move |cc| {
let ctx = &cc.egui_ctx;
let winit_window = cc.winit_window().cloned();
+ let placement = placement_store();
+ if let Some(window) = &winit_window {
+ restore_main_window(window, &placement, settings.lock().get().ui.legacy_window, wayland);
+ }
let spec = InstallSpec::new(shell_info, Arc::new(SystemWindows))
.app_id(vectorcraft_ui_egui::os_window::app_id())
- .placement(Arc::new(Mutex::new(placement_store())))
+ .placement(Arc::new(Mutex::new(placement)))
.frame(decision);
let spec = match start_pen(&winit_window) {
Some(pen) => spec.pen(pen),
@@ -804,7 +860,7 @@ fn main() -> std::process::ExitCode {
};
let (files, file_panels) = file_service(wake, folders);
let files = Arc::new(files);
- craft::host::Host::builder(AppInfo {
+ let host = craft::host::Host::builder(AppInfo {
id: vectorcraft_ui_egui::os_window::SETTINGS_APP_ID,
name: vectorcraft_ui_egui::os_window::name(),
version: vectorcraft_ui_egui::os_window::version(),
@@ -812,7 +868,8 @@ fn main() -> std::process::ExitCode {
.i18n(vectorcraft_ui_egui::i18n::shared())
.settings(Arc::new(settings.clone()))
.files(files.clone())
- .install(ctx);
+ .build();
+ host.clone().install(ctx);
let mut session = Session::new();
// The profiles loaded before come back before the preferences name any of them.
prefs_dir::attach_profile_store(&mut session);
@@ -837,6 +894,7 @@ fn main() -> std::process::ExitCode {
prefs_dir::attach_proof_setups(&mut session);
prefs_dir::attach_script_data(&mut session);
let mut app = VectorcraftApp::new(session, services(winit_window.clone()));
+ app.host = Arc::new(host);
app.adopt_context(&cc.egui_ctx);
// A nightly is updated by the Launcher: it never checks for a stable release, which
// would install this program's own updater over the nightly build.
@@ -883,7 +941,13 @@ fn main() -> std::process::ExitCode {
let summary = adapter_summary(&rs.adapter.get_info());
log::info!("rendering with {summary} (power preference {power:?})");
created.created(&cc.egui_ctx);
- if !gpu::skipped().is_empty() {
+ if gpu::software_start() {
+ // No graphics processor could show the window, so Mesa draws it on the CPU (#2654).
+ app.status(format!(
+ "No graphics processor could show the window, so VectorCraft started again on {summary}, which draws on the CPU and is slower. Showing it on the graphics processor needs a driver with {}",
+ gpu::NEEDS
+ ));
+ } else if !gpu::skipped().is_empty() {
// A processor chosen in Settings can be the one that can't show the window.
if chosen_gpu {
app.status(format!(
diff --git a/apps/vectorcraft/src/prefs_dir.rs b/apps/vectorcraft/src/prefs_dir.rs
index b2d79faaed..3857ce2772 100644
--- a/apps/vectorcraft/src/prefs_dir.rs
+++ b/apps/vectorcraft/src/prefs_dir.rs
@@ -24,6 +24,14 @@ pub fn install_fonts() {
}
}
+/// Have spelling and hyphenation read the Language packs installed in the Craft apps' shared font
+/// store (`proof.installPack`, or another Craft app), and install new ones there (#4936). Like the
+/// Fonts folder, whether or not `VECTORCRAFT_NO_PREFS` is set: the packs are the store's, not
+/// VectorCraft's preferences.
+pub fn use_language_packs() {
+ vectorcraft_engine::packs::use_font_store();
+}
+
/// The folder `name` next to the settings, for what the user keeps: none in a run without
/// preferences (`VECTORCRAFT_NO_PREFS`), which keeps nothing.
fn store_dir(name: &str) -> Option {
diff --git a/apps/vectorcraft/src/profile_root.rs b/apps/vectorcraft/src/profile_root.rs
index 7f46e77766..d5ae707a17 100644
--- a/apps/vectorcraft/src/profile_root.rs
+++ b/apps/vectorcraft/src/profile_root.rs
@@ -1,264 +1,17 @@
-//! App-owned nightly profile fences: a profile every one of VectorCraft's data paths is redirected
-//! into ([`crate::prefs_dir::profile::install_data_root`]), and that never overlaps stable's folders, a portable
-//! copy or an installation.
+//! App-owned nightly profile specification for [`craft_nightly`]: describes VectorCraft's stable
+//! directories, forbidden environment variables, portable markers, folder-only profile entries, and
+//! extra installation/package boundaries so a nightly profile never overlaps stable state.
use std::ffi::OsString;
-use std::path::{Component, Path, PathBuf};
+use std::path::{Path, PathBuf};
-use crate::prefs_dir::profile::PORTABLE_DATA_DIR;
+use craft_nightly::AppProfileSpec;
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
-enum Platform {
- Windows,
- Linux,
- Mac,
-}
+use crate::prefs_dir::profile::{PORTABLE_DATA_DIR, PORTABLE_MARKERS};
-impl Platform {
- fn current() -> Result {
- match std::env::consts::OS {
- "windows" => Ok(Self::Windows),
- "linux" => Ok(Self::Linux),
- "macos" => Ok(Self::Mac),
- other => Err(format!("nightly-v1 is not defined for this operating system ({other})")),
- }
- }
+const STABLE_DIR_NAMES: [&str; 2] = ["VectorCraft", "vectorcraft"];
- fn ignores_case(self) -> bool {
- self != Self::Linux
- }
-}
-
-fn absolute(path: PathBuf, label: &str) -> Result {
- if !path.is_absolute() || path.components().any(|c| matches!(c, Component::ParentDir)) {
- return Err(format!("{label} must be absolute and contain no parent traversal"));
- }
- Ok(path)
-}
-
-fn required_base(env: &impl Fn(&str) -> Option, key: &str) -> Result {
- let value = env(key).filter(|v| !v.is_empty()).ok_or_else(|| format!("cannot establish the stable {key} boundary"))?;
- absolute(PathBuf::from(value), key)
-}
-
-fn xdg_base(env: &impl Fn(&str) -> Option, key: &str, fallback: &str) -> Result {
- match env(key).filter(|v| !v.is_empty()) {
- Some(value) => absolute(PathBuf::from(value), key),
- None => Ok(required_base(env, "HOME")?.join(fallback)),
- }
-}
-
-/// Resolve existing ancestors before creating anything. A dangling link or an inaccessible ancestor
-/// is not a missing directory that may be replaced or followed later.
-fn canonical_future(path: &Path) -> Result {
- let mut parent = path;
- let mut missing = Vec::new();
- loop {
- match std::fs::symlink_metadata(parent) {
- Ok(_) => break,
- Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
- missing.push(parent.file_name().ok_or_else(|| "the profile root has no existing ancestor".to_string())?.to_os_string());
- parent = parent.parent().ok_or_else(|| "the profile root has no existing ancestor".to_string())?;
- }
- Err(error) => return Err(format!("cannot inspect the profile boundary: {error}")),
- }
- }
- let mut resolved = std::fs::canonicalize(parent).map_err(|e| format!("cannot resolve the profile boundary: {e}"))?;
- for part in missing.into_iter().rev() {
- resolved.push(part);
- }
- Ok(resolved)
-}
-
-/// A stable entry point may be a dangling link once its target is uninstalled. Its own name is still
-/// the fence, so only the folder it lives in is resolved: a link that cannot be resolved would refuse
-/// every launch, a valid private profile included.
-fn canonical_future_entry(path: &Path) -> Result {
- let parent = path.parent().ok_or_else(|| "an entry point has no folder".to_string())?;
- let name = path.file_name().ok_or_else(|| "an entry point has no name".to_string())?;
- Ok(canonical_future(parent)?.join(name))
-}
-
-fn overlaps(a: &Path, b: &Path, platform: Platform) -> bool {
- let parts = |p: &Path| {
- p.components()
- .map(|c| {
- let value = c.as_os_str().to_string_lossy().into_owned();
- if platform.ignores_case() { value.to_lowercase() } else { value }
- })
- .collect::>()
- };
- let (a, b) = (parts(a), parts(b));
- a.starts_with(&b) || b.starts_with(&a)
-}
-
-fn installation_boundary(platform: Platform, exe: &Path) -> Result {
- let parent = exe.parent().ok_or_else(|| "cannot establish the installation boundary".to_string())?;
- if platform == Platform::Mac {
- // A profile in Resources is still inside the versioned install, not beside MacOS.
- if let Some(bundle) = exe.ancestors().find(|p| p.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("app"))) {
- return Ok(bundle.to_path_buf());
- }
- }
- Ok(parent.to_path_buf())
-}
-
-/// Every folder a stable VectorCraft keeps user state in, on `platform`: the settings folder each
-/// platform convention and the portable layout use, the eframe window state, the logs, the recovery
-/// copies, the plug-ins, the caches, the install folders and the entry points. A nightly profile that
-/// overlapped any of them would read, rewrite or prune stable's own state.
-fn forbidden_roots(platform: Platform, env: &impl Fn(&str) -> Option, exe: &Path) -> Result, String> {
- let mut roots = match platform {
- Platform::Windows => {
- // The settings folder (`profile.rs`) and the eframe window state, which eframe puts under
- // `%APPDATA%\ai.storyteller.vectorcraft\data` (the window id).
- let mut roots = ["APPDATA", "LOCALAPPDATA"]
- .into_iter()
- .map(|key| required_base(env, key).map(|p| p.join("VectorCraft")))
- .collect::, _>>()?;
- roots.push(required_base(env, "APPDATA")?.join("ai.storyteller.vectorcraft"));
- // The MSI's default per-user and per-machine folders (install-policy.wxi). A custom
- // install folder is not known here; the executable's own folder is fenced below.
- roots.push(required_base(env, "LOCALAPPDATA")?.join("Programs").join("ArtCraft").join("VectorCraft"));
- for key in ["ProgramW6432", "ProgramFiles", "ProgramFiles(x86)"] {
- if let Some(base) = env(key).filter(|v| !v.is_empty()) {
- roots.push(absolute(PathBuf::from(base), key)?.join("ArtCraft").join("VectorCraft"));
- }
- }
- roots
- }
- Platform::Linux => {
- let mut roots =
- [("XDG_CONFIG_HOME", ".config"), ("XDG_DATA_HOME", ".local/share"), ("XDG_CACHE_HOME", ".cache"), ("XDG_STATE_HOME", ".local/state")]
- .into_iter()
- .map(|(key, fallback)| xdg_base(env, key, fallback).map(|p| p.join("vectorcraft")))
- .collect::, _>>()?;
- // The eframe window state, under the lowercased window id.
- roots.push(xdg_base(env, "XDG_DATA_HOME", ".local/share")?.join("ai.storyteller.vectorcraft"));
- roots.push(required_base(env, "HOME")?.join(".config").join("VectorCraft"));
- // The same folders at their HOME defaults: an XDG override moves this launch's own paths,
- // not stable's, which stays where a launch without the override finds it.
- for (directory, app) in
- [(".config", "vectorcraft"), (".local/share", "vectorcraft"), (".cache", "vectorcraft"), (".local/state", "vectorcraft")]
- {
- roots.push(required_base(env, "HOME")?.join(directory).join(app));
- }
- // The stable Flatpak keeps its data in its own per-app folder.
- roots.push(required_base(env, "HOME")?.join(".var/app/ai.storyteller.vectorcraft"));
- roots
- }
- Platform::Mac => {
- let home = required_base(env, "HOME")?;
- let library = home.join("Library");
- vec![
- library.join("Application Support/VectorCraft"),
- library.join("Application Support/ai.storyteller.vectorcraft"),
- library.join("Caches/VectorCraft"),
- library.join("Caches/ai.storyteller.vectorcraft"),
- library.join("Preferences/VectorCraft"),
- library.join("Preferences/ai.storyteller.vectorcraft.plist"),
- library.join("Saved Application State/ai.storyteller.vectorcraft.savedState"),
- home.join("Applications/VectorCraft.app"),
- PathBuf::from("/Applications/VectorCraft.app"),
- ]
- }
- };
- roots.push(installation_boundary(platform, exe)?);
- let mut fences = roots.into_iter().map(|p| canonical_future(&p)).collect::, _>>()?;
- if platform == Platform::Linux {
- for entry in ["/usr/bin/vectorcraft", "/usr/local/bin/vectorcraft", "/opt/vectorcraft"] {
- fences.push(canonical_future_entry(Path::new(entry))?);
- }
- }
- Ok(fences)
-}
-
-fn private_subdirectory(root: &Path, name: impl AsRef, label: &str) -> Result {
- let chosen = canonical_future(&absolute(root.to_path_buf(), "the nightly profile root")?)?;
- let target = chosen.join(name);
- match std::fs::symlink_metadata(&target) {
- Ok(metadata) if !metadata.is_dir() => {
- return Err(format!("the nightly {label} must be a directory inside its selected profile"));
- }
- Ok(_) => {}
- Err(error) if error.kind() == std::io::ErrorKind::NotFound => {}
- Err(error) => return Err(format!("cannot inspect the nightly {label}: {error}")),
- }
- let child = canonical_future(&target)?;
- if child == chosen || !child.starts_with(&chosen) {
- return Err(format!("the nightly {label} must stay inside its selected profile"));
- }
- Ok(child)
-}
-
-/// Every existing entry directly in the profile (settings, logs, the user's libraries and so on) must
-/// resolve inside it, so a link there cannot point Nightly's writes at another app's data.
-fn entries_stay_inside(root: &Path) -> Result<(), String> {
- let entries = match std::fs::read_dir(root) {
- Ok(entries) => entries,
- Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(()),
- Err(error) => return Err(format!("cannot inspect the nightly profile: {error}")),
- };
- for entry in entries {
- let entry = entry.map_err(|e| format!("cannot inspect the nightly profile: {e}"))?;
- let path = entry.path();
- let metadata = std::fs::symlink_metadata(&path).map_err(|e| format!("cannot inspect the nightly profile: {e}"))?;
- // Settings and session state are ordinary files, not directories. Keep the existing
- // directory-boundary check for folders (including the known folder-only entries).
- let folder_only = PROFILE_FOLDERS.iter().any(|name| entry.file_name().eq_ignore_ascii_case(name));
- if metadata.is_file() && !folder_only {
- private_regular_file(&path, &metadata)?;
- } else {
- private_subdirectory(root, entry.file_name(), "profile entry")?;
- }
- }
- Ok(())
-}
-
-/// Persisted files must have their own ordinary file identity, not an alias to other data.
-fn private_regular_file(path: &Path, metadata: &std::fs::Metadata) -> Result<(), String> {
- #[cfg(unix)]
- {
- use std::os::unix::fs::MetadataExt as _;
- if metadata.nlink() != 1 {
- return Err("the nightly profile file must not be shared".into());
- }
- }
- #[cfg(all(windows, feature = "wgpu"))]
- {
- use winsafe::{HFILE, co};
- let (file, _) = HFILE::CreateFile(
- path.to_str().ok_or("the nightly profile file path is not textual")?,
- co::GENERIC::default(),
- Some(co::FILE_SHARE::READ | co::FILE_SHARE::WRITE | co::FILE_SHARE::DELETE),
- None,
- co::DISPOSITION::OPEN_EXISTING,
- co::FILE_ATTRIBUTE::NORMAL,
- Some(co::FILE_FLAG::OPEN_REPARSE_POINT),
- None,
- None,
- )
- .map_err(|e| e.to_string())?;
- let info = file.GetFileInformationByHandle().map_err(|e| e.to_string())?;
- if info.dwFileAttributes.has(co::FILE_ATTRIBUTE::REPARSE_POINT) || info.dwFileAttributes.has(co::FILE_ATTRIBUTE::DIRECTORY) {
- return Err("the nightly profile file must not be an alias or directory".into());
- }
- if info.nNumberOfLinks != 1 {
- return Err("the nightly profile file must not be shared".into());
- }
- }
- #[cfg(all(windows, not(feature = "wgpu")))]
- {
- use std::os::windows::fs::MetadataExt as _;
- const FILE_ATTRIBUTE_DIRECTORY: u32 = 0x10;
- const FILE_ATTRIBUTE_REPARSE_POINT: u32 = 0x400;
- if metadata.file_attributes() & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT) != 0 {
- return Err("the nightly profile file must not be an alias or directory".into());
- }
- }
- let _ = (path, metadata);
- Ok(())
-}
+const FORBIDDEN_ENV_VARS: [&str; 2] = ["VECTORCRAFT_CONFIG_DIR", "VECTORCRAFT_NO_PREFS"];
const PROFILE_FOLDERS: [&str; 18] = [
"Data Recovery",
@@ -281,397 +34,207 @@ const PROFILE_FOLDERS: [&str; 18] = [
"Libraries",
];
-/// Recognise the shared portable data namespace in both the supplied and the resolved path. Up to
-/// the chosen folder itself, a marker only counts beside a VectorCraft executable, so an unrelated
-/// `portable.txt` higher up (in a user folder or at a drive root) does not refuse the profile.
-fn is_portable_layout(path: &Path, platform: Platform) -> bool {
- path.ancestors().enumerate().any(|(depth, ancestor)| {
- crate::prefs_dir::profile::PORTABLE_MARKERS.iter().any(|marker| ancestor.join(marker).is_file())
- && (depth == 0 || ["vectorcraft.exe", "vectorcraft"].iter().any(|exe| ancestor.join(exe).is_file()))
- }) || path.components().any(|component| match component {
- Component::Normal(name) if platform.ignores_case() => name.to_string_lossy().eq_ignore_ascii_case(PORTABLE_DATA_DIR),
- Component::Normal(name) => name == PORTABLE_DATA_DIR,
- _ => false,
- })
+/// Builds VectorCraft's [`AppProfileSpec`] for [`craft_nightly`].
+pub fn app_profile_spec() -> AppProfileSpec {
+ AppProfileSpec {
+ app_id: vectorcraft_ui_egui::os_window::SETTINGS_APP_ID,
+ display_name: vectorcraft_ui_egui::os_window::APP_NAME,
+ stable_dir_names: &STABLE_DIR_NAMES,
+ stable_package_id: vectorcraft_ui_egui::os_window::APP_ID,
+ nightly_package_id: vectorcraft_ui_egui::os_window::NIGHTLY_PACKAGE_ID,
+ profile_root_env: None,
+ forbidden_env_vars: &FORBIDDEN_ENV_VARS,
+ portable_markers: &PORTABLE_MARKERS,
+ folder_only_entries: &PROFILE_FOLDERS,
+ extra_forbidden_roots: extra_forbidden_roots(),
+ }
}
-/// The writable hook is the app's own exclusive probe ([`crate::prefs_dir::profile::ensure_writable`]). Keeping
-/// it injected lets the boundary tests exercise the real policy without starting the app.
-pub fn validate(
- root: &Path,
- env: impl Fn(&str) -> Option,
- exe: Option<&Path>,
- writable: impl FnOnce(&Path) -> std::io::Result<()>,
-) -> Result {
- validate_for(Platform::current()?, root, env, exe, writable)
+fn non_empty_abs(env: &impl Fn(&str) -> Option, key: &str) -> Option {
+ let value = env(key)?;
+ if value.is_empty() {
+ return None;
+ }
+ let path = PathBuf::from(value);
+ path.is_absolute().then_some(path)
}
-fn validate_for(
- platform: Platform,
- root: &Path,
- env: impl Fn(&str) -> Option,
- exe: Option<&Path>,
- writable: impl FnOnce(&Path) -> std::io::Result<()>,
-) -> Result {
- absolute(root.to_path_buf(), "the nightly profile root")?;
- if env("VECTORCRAFT_CONFIG_DIR").is_some_and(|v| !v.is_empty()) {
- return Err("nightly-v1 cannot be combined with VECTORCRAFT_CONFIG_DIR".to_string());
- }
- // The app turns preferences off whenever the variable is present, empty value included.
- if env("VECTORCRAFT_NO_PREFS").is_some() {
- // A run without preferences keeps nothing: its own profile would stay unused and the app
- // would log to standard error only, so it is never a nightly launch.
- return Err("nightly-v1 cannot inherit VECTORCRAFT_NO_PREFS".to_string());
- }
- let nightly_flatpak = vectorcraft_ui_egui::os_window::NIGHTLY_PACKAGE_ID;
- if platform != Platform::Windows
- && let Some(id) = env("FLATPAK_ID").filter(|value| !value.is_empty())
- && id.to_string_lossy().as_ref() != nightly_flatpak
+fn extra_forbidden_roots() -> Vec {
+ extra_forbidden_roots_with(|key| std::env::var_os(key), std::env::current_exe().ok().as_deref())
+}
+
+fn extra_forbidden_roots_with(env: impl Fn(&str) -> Option, exe: Option<&Path>) -> Vec {
+ let mut roots = Vec::new();
+
+ #[cfg(target_os = "windows")]
{
- // `packaging/linux/flatpak-bundle.sh` builds VectorCraft Nightly as its own Flatpak
- // (`ai.storyteller.vectorcraft.nightly`), whose sandbox is already a private home. Any other
- // instance, the stable app's included, would put this profile inside another app's tree.
- return Err(format!("nightly-v1 can only run inside its own Flatpak instance ({nightly_flatpak}), not {}", id.to_string_lossy()));
+ if let Some(local) = non_empty_abs(&env, "LOCALAPPDATA") {
+ roots.push(local.join("Programs").join("ArtCraft").join("VectorCraft"));
+ }
+ for key in ["ProgramW6432", "ProgramFiles", "ProgramFiles(x86)"] {
+ if let Some(base) = non_empty_abs(&env, key) {
+ roots.push(base.join("ArtCraft").join("VectorCraft"));
+ }
+ }
}
- let chosen = canonical_future(root)?;
- if is_portable_layout(root, platform) || is_portable_layout(&chosen, platform) {
- return Err("the nightly root must not use a portable VectorCraft installation or its VectorCraftData settings folder".to_string());
- }
- let exe = absolute(exe.ok_or_else(|| "cannot establish the installation boundary".to_string())?.to_path_buf(), "the executable")?;
- let forbidden = forbidden_roots(platform, &env, &exe)?;
- if forbidden.iter().any(|stable| overlaps(&chosen, stable, platform)) {
- return Err("the nightly root must not overlap stable data or an installation".to_string());
- }
- // Data Recovery can read, adopt, overwrite and sweep entries: never let its alias leave the
- // private profile.
- private_subdirectory(&chosen, "Data Recovery", "recovery folder")?;
- entries_stay_inside(&chosen)?;
- let mut create = std::fs::DirBuilder::new();
- create.recursive(true);
- #[cfg(unix)]
+
+ #[cfg(all(unix, not(target_os = "macos")))]
{
- use std::os::unix::fs::DirBuilderExt as _;
- create.mode(0o700);
+ if let Some(home) = non_empty_abs(&env, "HOME") {
+ roots.push(home.join(".var").join("app").join(vectorcraft_ui_egui::os_window::APP_ID));
+ }
+ for entry in ["/usr/bin/vectorcraft", "/usr/local/bin/vectorcraft", "/opt/vectorcraft"] {
+ roots.push(PathBuf::from(entry));
+ }
}
- create.create(&chosen).map_err(|e| format!("cannot create the nightly profile: {e}"))?;
- let confirmed = std::fs::canonicalize(&chosen).map_err(|e| format!("cannot resolve the created nightly profile: {e}"))?;
- if confirmed != chosen || forbidden.iter().any(|stable| overlaps(&confirmed, stable, platform)) {
- return Err("the nightly profile changed while it was being validated".to_string());
+
+ #[cfg(target_os = "macos")]
+ {
+ if let Some(home) = non_empty_abs(&env, "HOME") {
+ let library = home.join("Library");
+ roots.push(library.join("Preferences").join(format!("{}.plist", vectorcraft_ui_egui::os_window::APP_ID)));
+ roots.push(library.join("Saved Application State").join(format!("{}.savedState", vectorcraft_ui_egui::os_window::APP_ID)));
+ roots.push(home.join("Applications").join("VectorCraft.app"));
+ }
+ roots.push(PathBuf::from("/Applications/VectorCraft.app"));
}
- private_subdirectory(&confirmed, "Data Recovery", "recovery folder")?;
- entries_stay_inside(&confirmed)?;
- writable(&confirmed).map_err(|e| format!("the nightly profile is not writable: {e}"))?;
- Ok(confirmed)
+
+ if let Some(exe) = exe {
+ if let Some(parent) = exe.parent() {
+ roots.push(parent.join(PORTABLE_DATA_DIR));
+ }
+ #[cfg(target_os = "macos")]
+ if let Some(bundle_parent) = exe.ancestors().find(|p| p.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("app"))).and_then(Path::parent)
+ {
+ roots.push(bundle_parent.join(PORTABLE_DATA_DIR));
+ }
+ }
+
+ roots
}
#[cfg(test)]
mod tests {
- use super::*;
- use std::cell::Cell;
- use std::collections::BTreeMap;
- use std::sync::atomic::{AtomicU64, Ordering};
+ use std::ffi::OsString;
+ use std::fs;
+ #[cfg(unix)]
+ use std::path::PathBuf;
- /// An owned fixture tree: a home, a roaming/local app-data pair and an install folder, so the
- /// fence can be checked for every platform on any host.
- struct Fixture {
- root: PathBuf,
- env: BTreeMap,
- exe: PathBuf,
- }
+ use craft_nightly::validate_and_prepare_root;
- impl Fixture {
- fn new() -> Self {
- static NEXT: AtomicU64 = AtomicU64::new(0);
- let root = loop {
- let candidate =
- std::env::temp_dir().join(format!("vectorcraft-profile-policy-{}-{}", std::process::id(), NEXT.fetch_add(1, Ordering::Relaxed)));
- match std::fs::create_dir(&candidate) {
- Ok(()) => break std::fs::canonicalize(candidate).unwrap(),
- Err(error) if error.kind() == std::io::ErrorKind::AlreadyExists => continue,
- Err(error) => panic!("cannot create owned fixture: {error}"),
- }
- };
- let home = root.join("home");
- let exe = root.join("install/vectorcraft");
- std::fs::create_dir_all(&home).unwrap();
- std::fs::create_dir_all(exe.parent().unwrap()).unwrap();
- std::fs::write(&exe, b"fixture executable, never run").unwrap();
- let env = [("HOME", home), ("APPDATA", root.join("roaming")), ("LOCALAPPDATA", root.join("local"))]
- .into_iter()
- .map(|(key, value)| (key.into(), value.into_os_string()))
- .collect();
- Self { root, env, exe }
- }
-
- fn get(&self, key: &str) -> Option {
- self.env.get(key).cloned()
- }
-
- fn home(&self) -> PathBuf {
- PathBuf::from(self.get("HOME").unwrap())
- }
-
- fn check(&self, platform: Platform, root: &Path) -> Result {
- self.check_with(platform, root, |_| Ok(()))
- }
-
- fn check_with(&self, platform: Platform, root: &Path, writable: impl FnOnce(&Path) -> std::io::Result<()>) -> Result {
- validate_for(platform, root, |key| self.get(key), Some(&self.exe), writable)
- }
- }
-
- impl Drop for Fixture {
- fn drop(&mut self) {
- // Only the directory this fixture created is owned for removal.
- std::fs::remove_dir_all(&self.root).unwrap();
- }
- }
-
- const PLATFORMS: [Platform; 3] = [Platform::Windows, Platform::Linux, Platform::Mac];
+ use super::{FORBIDDEN_ENV_VARS, PROFILE_FOLDERS, STABLE_DIR_NAMES, app_profile_spec, extra_forbidden_roots_with};
+ use crate::prefs_dir::profile::{PORTABLE_DATA_DIR, PORTABLE_MARKERS};
#[test]
- fn a_private_profile_is_accepted_on_every_platform() {
- let fixture = Fixture::new();
- for platform in PLATFORMS {
- let root = fixture.root.join(format!("nightly profiles/{platform:?}/vectorcraft"));
- let resolved = fixture.check(platform, &root).unwrap();
- assert!(resolved.is_dir(), "{platform:?}");
- assert_eq!(resolved, std::fs::canonicalize(root).unwrap(), "{platform:?}");
- std::fs::remove_dir_all(fixture.root.join("nightly profiles")).unwrap();
- }
+ fn spec_preserves_vectorcraft_invariants() {
+ let spec = app_profile_spec();
+ assert_eq!(spec.app_id, "vectorcraft");
+ assert_eq!(spec.display_name, "VectorCraft");
+ assert_eq!(spec.stable_dir_names, &STABLE_DIR_NAMES);
+ assert_eq!(spec.stable_package_id, "ai.storyteller.vectorcraft");
+ assert_eq!(spec.nightly_package_id, "ai.storyteller.vectorcraft.nightly");
+ assert_eq!(spec.profile_root_env, None);
+ assert_eq!(spec.forbidden_env_vars, &FORBIDDEN_ENV_VARS);
+ assert_eq!(spec.portable_markers, &PORTABLE_MARKERS);
+ assert_eq!(spec.folder_only_entries, &PROFILE_FOLDERS);
}
#[test]
- fn stable_settings_folders_are_refused_on_every_platform() {
- let fixture = Fixture::new();
- let stable = [
- (Platform::Windows, fixture.get("APPDATA").map(|v| PathBuf::from(v).join("VectorCraft"))),
- (Platform::Windows, fixture.get("APPDATA").map(|v| PathBuf::from(v).join("ai.storyteller.vectorcraft"))),
- (Platform::Windows, fixture.get("LOCALAPPDATA").map(|v| PathBuf::from(v).join("VectorCraft"))),
- (Platform::Windows, fixture.get("LOCALAPPDATA").map(|v| PathBuf::from(v).join("Programs/ArtCraft/VectorCraft"))),
- (Platform::Linux, Some(fixture.home().join(".config/vectorcraft"))),
- (Platform::Linux, Some(fixture.home().join(".local/share/vectorcraft"))),
- (Platform::Linux, Some(fixture.home().join(".local/share/ai.storyteller.vectorcraft"))),
- (Platform::Linux, Some(fixture.home().join(".cache/vectorcraft"))),
- (Platform::Linux, Some(fixture.home().join(".var/app/ai.storyteller.vectorcraft"))),
- (Platform::Mac, Some(fixture.home().join("Library/Application Support/VectorCraft"))),
- (Platform::Mac, Some(fixture.home().join("Library/Application Support/ai.storyteller.vectorcraft"))),
- (Platform::Mac, Some(fixture.home().join("Library/Preferences/ai.storyteller.vectorcraft.plist"))),
- ];
- for (platform, stable) in stable {
- let stable = stable.unwrap();
- for candidate in [stable.clone(), stable.join("nested nightly")] {
- let probed = Cell::new(false);
- let result = fixture.check_with(platform, &candidate, |_| {
- probed.set(true);
- Ok(())
- });
- assert!(result.is_err(), "{platform:?} accepted {candidate:?}");
- assert!(!probed.get(), "a refused root is rejected before the writable probe");
- }
- }
- }
+ fn extra_forbidden_roots_fences_platform_installs_and_portable_data() {
+ let tmp = tempfile::tempdir().unwrap();
+ let home = tmp.path().join("home");
+ let exe = tmp.path().join("install/vectorcraft");
+ let roots = extra_forbidden_roots_with(
+ |key| match key {
+ "HOME" | "LOCALAPPDATA" | "ProgramFiles" => Some(home.clone().into_os_string()),
+ _ => None,
+ },
+ Some(&exe),
+ );
+ assert!(roots.contains(&tmp.path().join("install").join(PORTABLE_DATA_DIR)));
- #[test]
- fn the_install_folder_and_the_entry_points_are_refused() {
- let fixture = Fixture::new();
- for platform in PLATFORMS {
- let install = fixture.exe.parent().unwrap();
- assert!(fixture.check(platform, install).is_err(), "{platform:?}: the install folder");
- assert!(fixture.check(platform, &install.join("NightlyData")).is_err(), "{platform:?}: inside the install");
- }
- }
-
- #[test]
- fn an_inherited_config_or_no_prefs_override_is_refused() {
- let fixture = Fixture::new();
- let root = fixture.root.join("nightly");
- for (key, value) in [
- ("VECTORCRAFT_CONFIG_DIR", "/elsewhere"),
- ("VECTORCRAFT_NO_PREFS", "1"),
- // The app turns preferences off on presence, so an empty value is a run too.
- ("VECTORCRAFT_NO_PREFS", ""),
- ("FLATPAK_ID", "ai.storyteller.vectorcraft"),
- ] {
- for platform in PLATFORMS {
- let result = validate_for(
- platform,
- &root,
- |name| if name == key { Some(value.into()) } else { fixture.get(name) },
- Some(&fixture.exe),
- |_| Ok(()),
- );
- let refused = result.is_err();
- // A Flatpak instance only keeps the stable app's sockets on native Unix packages.
- assert_eq!(refused, !(key == "FLATPAK_ID" && platform == Platform::Windows), "{key} on {platform:?}");
- if refused {
- assert!(!root.exists(), "a refused launch creates nothing ({key} on {platform:?})");
- } else if root.exists() {
- // The accepted case validated the root, which creates it: start the next one clean.
- std::fs::remove_dir_all(&root).expect("remove the accepted launch's root");
- }
- }
- }
- }
-
- #[test]
- fn only_the_nightly_s_own_flatpak_instance_may_carry_a_profile() {
- let fixture = Fixture::new();
- let root = fixture.root.join("flatpak profile");
- for (id, accepted) in
- [(vectorcraft_ui_egui::os_window::NIGHTLY_PACKAGE_ID, true), ("ai.storyteller.vectorcraft", false), ("io.other.App", false)]
+ #[cfg(target_os = "windows")]
{
- let result = validate_for(
- Platform::Linux,
- &root,
- |name| if name == "FLATPAK_ID" { Some(id.into()) } else { fixture.get(name) },
- Some(&fixture.exe),
- |_| Ok(()),
- );
- assert_eq!(result.is_ok(), accepted, "{id}");
- let _ = std::fs::remove_dir_all(&root);
+ assert!(roots.contains(&home.join("Programs").join("ArtCraft").join("VectorCraft")));
+ assert!(roots.contains(&home.join("ArtCraft").join("VectorCraft")));
+ }
+ #[cfg(all(unix, not(target_os = "macos")))]
+ {
+ assert!(roots.contains(&home.join(".var/app/ai.storyteller.vectorcraft")));
+ assert!(roots.contains(&PathBuf::from("/usr/bin/vectorcraft")));
+ assert!(roots.contains(&PathBuf::from("/usr/local/bin/vectorcraft")));
+ assert!(roots.contains(&PathBuf::from("/opt/vectorcraft")));
+ }
+ #[cfg(target_os = "macos")]
+ {
+ assert!(roots.contains(&home.join("Library/Preferences/ai.storyteller.vectorcraft.plist")));
+ assert!(roots.contains(&home.join("Library/Saved Application State/ai.storyteller.vectorcraft.savedState")));
+ assert!(roots.contains(&home.join("Applications/VectorCraft.app")));
+ assert!(roots.contains(&PathBuf::from("/Applications/VectorCraft.app")));
}
}
#[test]
- fn a_portable_copy_and_its_data_folder_are_refused() {
- let fixture = Fixture::new();
- let portable = fixture.root.join("portable copy");
- let data = portable.join(crate::prefs_dir::profile::PORTABLE_DATA_DIR);
- std::fs::create_dir_all(&data).unwrap();
- std::fs::write(portable.join("portable.txt"), b"owned portable fixture").unwrap();
- std::fs::write(data.join("config.toml"), b"stable settings must not change").unwrap();
- for platform in PLATFORMS {
- for candidate in [&data, &data.join("nested nightly")] {
- let probed = Cell::new(false);
- let result = fixture.check_with(platform, candidate, |_| {
- probed.set(true);
- Ok(())
- });
- assert!(result.is_err(), "{platform:?} accepted {candidate:?}");
- assert!(!probed.get());
- assert!(!data.join("nested nightly").exists());
- assert_eq!(std::fs::read(data.join("config.toml")).unwrap(), b"stable settings must not change");
- }
+ fn nightly_profile_reopens_after_saving_settings_and_enforces_folder_only_entries() {
+ let tmp = tempfile::tempdir().unwrap();
+ let private = tmp.path().join("nightly-reopen");
+ let mut spec = app_profile_spec();
+ spec.forbidden_env_vars = &[];
+
+ let canonical = validate_and_prepare_root(&private, &spec).unwrap();
+ assert_eq!(canonical, fs::canonicalize(&private).unwrap());
+
+ for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] {
+ fs::write(canonical.join(name), b"saved profile data").unwrap();
+ }
+ for name in PROFILE_FOLDERS {
+ fs::create_dir(canonical.join(name)).unwrap();
+ }
+ assert_eq!(validate_and_prepare_root(&private, &spec).unwrap(), canonical);
+ for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] {
+ assert_eq!(fs::read(canonical.join(name)).unwrap(), b"saved profile data", "{name} remains intact after reopen");
+ }
+
+ for name in PROFILE_FOLDERS {
+ let path = canonical.join(name);
+ fs::remove_dir(&path).unwrap();
+ fs::write(&path, b"not a directory").unwrap();
+ assert!(validate_and_prepare_root(&private, &spec).is_err(), "{name} must stay a directory");
+ fs::remove_file(&path).unwrap();
+ fs::create_dir(&path).unwrap();
}
- // A merely similar name is not the portable settings folder.
- let similar = fixture.root.join("VectorCraftData-backup-name/nightly");
- assert!(fixture.check(Platform::Linux, &similar).is_ok());
}
#[cfg(unix)]
#[test]
- fn a_link_inside_the_profile_cannot_redirect_recovery_or_a_library() {
- let fixture = Fixture::new();
- let root = fixture.root.join("nightly");
- std::fs::create_dir_all(&root).unwrap();
- let external = fixture.root.join("stable-document");
- std::fs::write(&external, b"stable bytes").unwrap();
+ fn symlink_inside_profile_is_refused() {
+ let tmp = tempfile::tempdir().unwrap();
+ let private = tmp.path().join("nightly");
+ fs::create_dir_all(&private).unwrap();
+ let external = tmp.path().join("stable-document");
+ fs::write(&external, b"stable bytes").unwrap();
+
+ let mut spec = app_profile_spec();
+ spec.forbidden_env_vars = &[];
+
for name in ["Data Recovery", "Swatches"] {
- let alias = root.join(name);
+ let alias = private.join(name);
std::os::unix::fs::symlink(&external, &alias).unwrap();
- assert!(fixture.check(Platform::Linux, &root).is_err(), "{name} alias");
- std::fs::remove_file(&alias).unwrap();
+ assert!(validate_and_prepare_root(&private, &spec).is_err(), "{name} alias");
+ fs::remove_file(&alias).unwrap();
}
- assert_eq!(std::fs::read(&external).unwrap(), b"stable bytes");
- }
-
- #[cfg(unix)]
- #[test]
- fn a_dangling_link_or_a_linked_ancestor_is_refused() {
- let fixture = Fixture::new();
- let elsewhere = fixture.root.join("elsewhere");
- std::fs::create_dir_all(&elsewhere).unwrap();
- let linked = fixture.root.join("nightly");
- std::os::unix::fs::symlink(&elsewhere, &linked).unwrap();
- // Canonical resolution keeps a link's target: a profile reached through one is fine, but it
- // is judged (and named) as its target, so nothing is written under the link.
- let resolved = fixture.check(Platform::Linux, &linked).unwrap();
- assert_eq!(resolved, std::fs::canonicalize(&elsewhere).unwrap());
- std::fs::remove_file(&linked).unwrap();
- let dangling = fixture.root.join("dangling/nightly");
- std::fs::create_dir_all(dangling.parent().unwrap()).unwrap();
- std::os::unix::fs::symlink(fixture.root.join("missing"), dangling.parent().unwrap().join("nightly")).unwrap();
- assert!(fixture.check(Platform::Linux, &dangling).is_err());
+ assert_eq!(fs::read(&external).unwrap(), b"stable bytes");
}
#[test]
- fn a_home_settings_folder_is_fenced_even_when_the_xdg_override_moves_elsewhere() {
- let fixture = Fixture::new();
- let xdg = fixture.root.join("override");
- std::fs::create_dir_all(&xdg).unwrap();
- let config = fixture.home().join(".config/vectorcraft");
- let data = fixture.home().join(".local/share/vectorcraft");
- for stable in [config.clone(), data.clone()] {
- for candidate in [stable.clone(), stable.join("nested nightly")] {
- let result = validate_for(
- Platform::Linux,
- &candidate,
- |name| match name {
- "XDG_CONFIG_HOME" | "XDG_DATA_HOME" => Some(xdg.clone().into_os_string()),
- _ => fixture.get(name),
- },
- Some(&fixture.exe),
- |_| Ok(()),
- );
- assert!(result.is_err(), "accepted {candidate:?} with the XDG folders moved to {xdg:?}");
- }
- }
- assert!(!config.exists() && !data.exists(), "a refused root creates nothing");
- }
-
- #[cfg(unix)]
- #[test]
- fn a_dangling_entry_point_keeps_its_fence_instead_of_refusing_every_launch() {
- let fixture = Fixture::new();
- let bin = fixture.root.join("entry/bin");
- std::fs::create_dir_all(&bin).unwrap();
- let entry = bin.join("vectorcraft");
- std::os::unix::fs::symlink(fixture.root.join("uninstalled target"), &entry).unwrap();
- // The shared resolver refuses the dangling link, as a profile root must be.
- assert!(canonical_future(&entry).is_err());
- assert_eq!(canonical_future_entry(&entry).unwrap(), std::fs::canonicalize(&bin).unwrap().join("vectorcraft"));
- }
-
- #[test]
- fn an_unwritable_profile_is_refused_after_the_probe_and_never_used() {
- let fixture = Fixture::new();
- let root = fixture.root.join("nightly");
- let result = fixture.check_with(Platform::Linux, &root, |_| Err(std::io::Error::other("read-only")));
- assert!(result.unwrap_err().contains("not writable"));
- }
-
- #[test]
- fn nightly_profile_reopens_after_saving_settings_and_session_state() {
- let fixture = Fixture::new();
- for platform in PLATFORMS {
- let private = fixture.root.join(format!("nightly-reopen-{platform:?}"));
- assert_eq!(fixture.check(platform, &private).unwrap(), private);
- for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] {
- std::fs::write(private.join(name), b"saved profile data").unwrap();
- }
- for name in PROFILE_FOLDERS {
- std::fs::create_dir(private.join(name)).unwrap();
- }
- assert_eq!(fixture.check(platform, &private).unwrap(), private);
- assert_eq!(std::fs::read(private.join("config.toml")).unwrap(), b"saved profile data");
- for name in PROFILE_FOLDERS {
- let path = private.join(name);
- std::fs::remove_dir(&path).unwrap();
- std::fs::write(&path, b"not a directory").unwrap();
- assert!(fixture.check(platform, &private).is_err(), "{name} must stay a directory");
- std::fs::remove_file(&path).unwrap();
- std::fs::create_dir(&path).unwrap();
- }
- }
- }
-
- #[test]
- fn the_platform_case_rules_are_the_file_systems_ones() {
- let fixture = Fixture::new();
- let upper = fixture.root.join("NIGHTLY");
- assert!(fixture.check(Platform::Linux, &upper).is_ok());
- let stable_mac = fixture.home().join("library/application support/vectorcraft");
- assert!(fixture.check(Platform::Mac, &stable_mac).is_err(), "macOS compares folders case-insensitively");
+ fn non_empty_abs_ignores_empty_and_relative_values() {
+ let env = |key: &str| match key {
+ "EMPTY" => Some(OsString::new()),
+ "RELATIVE" => Some(OsString::from("relative/path")),
+ _ => None,
+ };
+ assert!(super::non_empty_abs(&env, "EMPTY").is_none());
+ assert!(super::non_empty_abs(&env, "RELATIVE").is_none());
+ assert!(super::non_empty_abs(&env, "MISSING").is_none());
}
}
diff --git a/apps/vectorcraft/src/single_instance.rs b/apps/vectorcraft/src/single_instance.rs
index 249309fa87..4dba61d6b4 100644
--- a/apps/vectorcraft/src/single_instance.rs
+++ b/apps/vectorcraft/src/single_instance.rs
@@ -155,8 +155,8 @@ pub fn launch_with_plug_ins(files: &[String]) -> io::Result<()> {
}
/// The command [`launch_with_plug_ins`] runs: `exe -- files…`, so a file whose name starts with '-'
-/// stays a file. A nightly launch hands its profile on first (`launch_profile::child_args`), or the
-/// child would refuse to start without one.
+/// stays a file. A nightly launch hands its profile on first (`launch_profile::child_args`), so the
+/// child opens the same private profile.
fn app_with_plug_ins(exe: &Path, files: &[String]) -> std::process::Command {
let mut command = std::process::Command::new(exe);
command.args(super::launch_profile::child_args(files));
diff --git a/apps/vectorcraft/src/tablet.rs b/apps/vectorcraft/src/tablet.rs
index 4dd8f7d9ec..2c6a8b68c1 100644
--- a/apps/vectorcraft/src/tablet.rs
+++ b/apps/vectorcraft/src/tablet.rs
@@ -41,7 +41,7 @@
//! the rotation's range is 0°, and an axis a pen lacks reads nothing.
#![cfg_attr(not(target_os = "linux"), allow(dead_code))]
-use std::collections::HashMap;
+use std::collections::{HashMap, HashSet};
use craft::behavior::PointerSample;
use craft::ui::runtime::pen::PenSource;
@@ -189,6 +189,8 @@ enum Update {
struct Pens {
devices: HashMap,
last: HashMap; 5]>,
+ /// The pens an event has come from, for the log.
+ heard: HashSet,
}
impl Pens {
@@ -197,10 +199,37 @@ impl Pens {
/// same id starts without them.
fn set_devices(&mut self, devices: impl IntoIterator
- ) {
let devices: HashMap = devices.into_iter().take(MAX_DEVICES).map(|d| (d.id, d)).collect();
- self.last.retain(|id, _| devices.get(id).is_some_and(|d| self.devices.get(id) == Some(d)));
+ let unchanged = |id: &u16| devices.get(id).is_some_and(|d| self.devices.get(id) == Some(d));
+ self.last.retain(|id, _| unchanged(id));
+ self.heard.retain(|id| unchanged(id));
self.devices = devices;
}
+ /// The names of the pens listed, by device id, for the log.
+ fn pen_names(&self) -> Vec<&str> {
+ let mut pens: Vec<&Device> = self.devices.values().filter(|d| d.is_pen()).collect();
+ pens.sort_by_key(|d| d.id);
+ pens.into_iter().map(|d| d.name.as_str()).collect()
+ }
+
+ /// The pens listed, as the log line says it: under XWayland on a Wayland session this tells
+ /// whether XWayland lists the pen at all (#5622).
+ fn summary(&self) -> String {
+ let names = self.pen_names();
+ if names.is_empty() {
+ "the X server lists no pen (a pointer device with an \"Abs Pressure\" valuator): a pen draws at full pressure".to_string()
+ } else {
+ format!("pens listed: {}", names.join(", "))
+ }
+ }
+
+ /// The name of pen `id` when this is the first event from it since it was listed, for the log:
+ /// it tells whether the pen's events reach the app at all.
+ fn first_event(&mut self, id: u16) -> Option<&str> {
+ let device = self.devices.get(&id).filter(|d| d.is_pen())?;
+ self.heard.insert(id).then_some(device.name.as_str())
+ }
+
/// A raw motion or button event of device `id`, with the valuators that changed.
fn handle(&mut self, id: u16, valuators: impl IntoIterator
- ) -> Update {
let Some(device) = self.devices.get(&id) else { return Update::Keep };
@@ -231,6 +260,9 @@ impl Pens {
/// A raw event as the X server sends it: its valuator mask and the values of the valuators
/// set in it. A pen's sample or another pointer's `None` goes into `pen`.
fn raw_event(&mut self, pen: &PenSource, id: u16, mask: &[u32], values: &[f64]) {
+ if let Some(name) = self.first_event(id) {
+ log::info!("tablet: events arrive from the pen {name:?}");
+ }
if let Update::Set(sample) = self.handle(id, valuators(mask, values)) {
pen.set(sample);
}
@@ -304,6 +336,7 @@ mod x11 {
.map_err(|e| format!("XISelectEvents failed: {e}"))?;
let mut pens = Pens::default();
pens.set_devices(query_devices(&conn));
+ log::info!("tablet: {}", pens.summary());
std::thread::Builder::new()
.name("vectorcraft-tablet-x11".into())
.spawn(move || run(&conn, &mut pens, &pen))
@@ -321,7 +354,14 @@ mod x11 {
let values: Vec = e.axisvalues.iter().map(|v| fp3232(v.integral, v.frac)).collect();
pens.raw_event(pen, e.deviceid, &e.valuator_mask, &values);
}
- Event::XinputHierarchy(_) | Event::XinputDeviceChanged(_) => pens.set_devices(query_devices(conn)),
+ Event::XinputHierarchy(_) | Event::XinputDeviceChanged(_) => {
+ let before = pens.summary();
+ pens.set_devices(query_devices(conn));
+ let after = pens.summary();
+ if after != before {
+ log::info!("tablet: {after}");
+ }
+ }
_ => {}
}
}
@@ -623,6 +663,31 @@ mod tests {
assert!(s.pressure < 0.001, "{}", s.pressure);
}
+ /// #5622: the log names the pens the X server lists (XWayland's included) and the first event
+ /// from each, once, again after the pen is listed anew, and never for a mouse.
+ #[test]
+ fn the_log_names_the_pens_listed_and_the_first_event_from_each() {
+ let stylus = Device::new(11, "xwayland-tablet stylus:16", Some("xwayland-tablet stylus"), pen_valuators());
+ let eraser = Device::new(12, "xwayland-tablet eraser:16", Some("xwayland-tablet eraser"), pen_valuators());
+ let mut pens = Pens::default();
+ assert!(pens.summary().contains("lists no pen"), "{}", pens.summary());
+ pens.set_devices([eraser.clone(), mouse(4), stylus.clone()]);
+ assert_eq!(pens.summary(), "pens listed: xwayland-tablet stylus:16, xwayland-tablet eraser:16");
+ assert_eq!(pens.first_event(11), Some("xwayland-tablet stylus:16"));
+ assert_eq!(pens.first_event(11), None, "once");
+ assert_eq!(pens.first_event(4), None, "a mouse");
+ assert_eq!(pens.first_event(99), None, "a device not listed");
+ // Listed again unchanged: still heard. Another device under the same id: heard anew.
+ pens.set_devices([eraser.clone(), mouse(4), stylus]);
+ assert_eq!(pens.first_event(11), None);
+ pens.set_devices([eraser, mouse(4), pen(11)]);
+ assert_eq!(pens.first_event(11), Some("Wacom Intuos Pro M Pen stylus"));
+ // The events go into the feed as before.
+ let source = PenSource::default();
+ pens.raw_event(&source, 12, &[0b100], &[65535.0]);
+ assert_eq!(source.current().map(|s| (s.eraser, s.pressure)), Some((true, 1.0)));
+ }
+
#[test]
fn fixed_point_values() {
assert_eq!(fp3232(3, 1 << 31), 3.5);
diff --git a/apps/vectorcraft/src/windows_alt_codes.rs b/apps/vectorcraft/src/windows_alt_codes.rs
index 0abf65ddc9..c358a65653 100644
--- a/apps/vectorcraft/src/windows_alt_codes.rs
+++ b/apps/vectorcraft/src/windows_alt_codes.rs
@@ -4,14 +4,12 @@
//! Windows does the work: when Alt comes up after keypad digits, `TranslateMessage` posts a
//! `WM_CHAR` holding the character the code stands for (in the system's ANSI code page for a code
//! with a leading 0, else its OEM code page), the convention every Windows text field follows
-//! (). winit
-//! 0.30 reads a `WM_CHAR` only as part of the key press before it, so it drops this one, which
-//! follows a key release, and egui never sees the text. winit's message hook ([`msg_hook`]) sees
-//! the message before winit handles it: [`AltCodes`] notes keypad digits typed with Alt held, takes
-//! the character that follows Alt's release, and [`raw_input_hook`] hands it to the frame as typed
-//! text, so the Type tool (or a panel's text field) types it like any other character, in the
-//! same undo step as the typing round it. The keypad digits themselves are taken out of the frame,
-//! so they don't run a shortcut bound to Alt and a digit.
+//! (). winit reports
+//! that character as a key press of its own with the character as its text (storytold/winit W36),
+//! so egui types it like any other character. Each keypad digit typed with Alt held also arrives
+//! as Alt and a digit, which would run a shortcut bound to Alt and that digit: winit's message
+//! hook ([`msg_hook`]) sees each message before winit handles it, [`AltCodes`] notes the keypad
+//! digits typed with Alt held, and [`raw_input_hook`] takes them out of the frame.
//!
//! With NumLock off the keypad keys arrive as Insert, End, Down, Page Down, Left, Clear, Right,
//! Home, Up and Page Up, and Windows still composes the code from them. They are told from the
@@ -29,11 +27,11 @@ use std::cell::RefCell;
use egui::{Event, Key};
+#[cfg(windows)]
const WM_KEYDOWN: u32 = 0x0100;
-const WM_KEYUP: u32 = 0x0101;
-const WM_CHAR: u32 = 0x0102;
const WM_SYSKEYDOWN: u32 = 0x0104;
const WM_SYSKEYUP: u32 = 0x0105;
+#[cfg(windows)]
const WM_SYSCHAR: u32 = 0x0106;
/// `VK_NUMPAD0` to `VK_NUMPAD9` (`winuser.h`): keypad digits with NumLock on.
const VK_NUMPAD0: usize = 0x60;
@@ -49,25 +47,15 @@ const DIGIT_KEYS: [Key; 10] = [Key::Num0, Key::Num1, Key::Num2, Key::Num3, Key::
/// Bit 24 of a key message's `lParam`: an extended key, such as the navigation keys beside the
/// keypad (the keypad's own keys clear it).
const EXTENDED_KEY: isize = 1 << 24;
-/// `VK_MENU`, `VK_LMENU` and `VK_RMENU`: Alt.
-const ALT_KEYS: [usize; 3] = [0x12, 0xA4, 0xA5];
thread_local! {
/// The UI thread's sequence: [`msg_hook`] and [`raw_input_hook`] both run on it.
static CODES: RefCell = RefCell::new(AltCodes::default());
}
-/// Where an Alt + keypad code stands, from the keyboard messages of the thread's queue.
+/// The keypad digits typed with Alt held, from the keyboard messages of the thread's queue.
#[derive(Default)]
struct AltCodes {
- /// Keypad digits typed while Alt has been held.
- digits: usize,
- /// Alt came up after keypad digits: the next character message is the code's character.
- armed: bool,
- /// A high surrogate waiting for its low half.
- high: Option,
- /// Characters the codes typed, for the next frame.
- typed: String,
/// The digits of the keypad presses and releases with Alt held since the last frame, which
/// egui reports as Alt and a digit (or, with NumLock off, Alt and a navigation key): taken
/// out of the frame.
@@ -88,80 +76,45 @@ fn keypad_digit(wparam: usize, lparam: isize) -> Option {
impl AltCodes {
/// Note a keyboard message `message` with `wparam` (the virtual-key code, or a UTF-16 unit)
- /// and `lparam` (its flags).
+ /// and `lparam` (its flags). Windows sends a key pressed or released with Alt held as a system
+ /// key.
fn message(&mut self, message: u32, wparam: usize, lparam: isize) {
- let keypad = match message {
- WM_SYSKEYDOWN | WM_SYSKEYUP => keypad_digit(wparam, lparam),
- _ => None,
- };
- if let Some(d) = keypad {
- // Windows sends a key pressed with Alt held as a system key.
- if message == WM_SYSKEYDOWN {
- self.digits += 1;
- self.armed = false;
- }
+ if matches!(message, WM_SYSKEYDOWN | WM_SYSKEYUP)
+ && let Some(d) = keypad_digit(wparam, lparam)
+ {
self.keypad_events.push(d);
- return;
- }
- match message {
- WM_KEYDOWN | WM_SYSKEYDOWN if ALT_KEYS.contains(&wparam) => {}
- // Any other key ends the sequence and keeps its own meaning.
- WM_KEYDOWN | WM_SYSKEYDOWN => self.reset(),
- WM_KEYUP | WM_SYSKEYUP if ALT_KEYS.contains(&wparam) => {
- self.armed = self.digits > 0;
- self.digits = 0;
- }
- WM_CHAR | WM_SYSCHAR if self.armed => {
- let unit = (wparam & 0xffff) as u16;
- if (0xd800..0xdc00).contains(&unit) {
- self.high = Some(unit);
- return;
- }
- let units: Vec = self.high.take().into_iter().chain([unit]).collect();
- self.typed.extend(char::decode_utf16(units).filter_map(Result::ok).filter(|c| !c.is_control()));
- self.armed = false;
- }
- _ => {}
}
}
- fn reset(&mut self) {
- self.digits = 0;
- self.armed = false;
- self.high = None;
- }
-
- /// Hand the frame `events` the characters typed since the last frame, as typed text, and take
- /// out the keypad digits typed with Alt held.
+ /// Take out of the frame `events` the keypad digits typed with Alt held since the last frame.
+ /// The character a code types comes from winit, as typed text.
fn drain(&mut self, events: &mut Vec) {
let mut keypad = std::mem::take(&mut self.keypad_events);
- if !keypad.is_empty() {
- events.retain(|e| {
- let Event::Key { key, modifiers, .. } = e else {
- return true;
- };
- if !modifiers.alt {
- return true;
- }
- // The first keypad key still to take out that egui reports as `key`.
- let stands_for = |d: &usize| DIGIT_KEYS.get(*d) == Some(key) || NUMLOCK_OFF_EGUI_KEYS.get(*d) == Some(key);
- match keypad.iter().position(stands_for) {
- Some(i) => {
- keypad.remove(i);
- false
- }
- None => true,
- }
- });
- }
- if !self.typed.is_empty() {
- events.push(Event::Text(std::mem::take(&mut self.typed)));
+ if keypad.is_empty() {
+ return;
}
+ events.retain(|e| {
+ let Event::Key { key, modifiers, .. } = e else {
+ return true;
+ };
+ if !modifiers.alt {
+ return true;
+ }
+ // The first keypad key still to take out that egui reports as `key`.
+ let stands_for = |d: &usize| DIGIT_KEYS.get(*d) == Some(key) || NUMLOCK_OFF_EGUI_KEYS.get(*d) == Some(key);
+ match keypad.iter().position(stands_for) {
+ Some(i) => {
+ keypad.remove(i);
+ false
+ }
+ None => true,
+ }
+ });
}
}
-/// winit's message hook for the keyboard: notes Alt + keypad codes and the characters they type,
-/// and hands each message to `windows_symbol_chars`. It never consumes the message.
+/// winit's message hook for the keyboard: notes the keypad digits typed with Alt held, and hands
+/// each message to `windows_symbol_chars`. It never consumes the message.
#[cfg(windows)]
#[allow(unsafe_code)]
pub fn msg_hook(msg: *const std::ffi::c_void) {
@@ -182,7 +135,7 @@ pub fn msg_hook(msg: *const std::ffi::c_void) {
}
}
-/// Before egui reads the main window's frame: the characters Alt + keypad codes typed, as text.
+/// Before egui reads the main window's frame: the keypad digits typed with Alt held are taken out.
pub fn raw_input_hook(raw: &mut egui::RawInput) {
CODES.with(|c| {
if let Ok(mut c) = c.try_borrow_mut() {
@@ -196,6 +149,9 @@ mod tests {
use super::*;
const ALT: usize = 0x12;
+ const WM_KEYDOWN: u32 = 0x0100;
+ const WM_KEYUP: u32 = 0x0101;
+ const WM_CHAR: u32 = 0x0102;
/// Alt held, keypad digits `code`, Alt released, and the character Windows then posts.
fn alt_code(c: &mut AltCodes, code: &str, posted: u16) {
@@ -215,59 +171,53 @@ mod tests {
}
#[test]
- fn an_alt_code_types_its_character_when_alt_comes_up() {
+ fn an_alt_codes_keypad_digits_leave_the_frame_and_its_character_is_typed_once() {
let mut c = AltCodes::default();
alt_code(&mut c, "0176", 0xB0);
alt_code(&mut c, "0151", 0x2014);
- let mut events = vec![key(Key::Num0, true, true), key(Key::Num0, true, false), key(Key::Num1, false, true)];
+ // winit reports each code's character as typed text.
+ let mut events = vec![
+ key(Key::Num0, true, true),
+ key(Key::Num0, true, false),
+ key(Key::Num1, false, true),
+ Event::Text("°".into()),
+ Event::Text("—".into()),
+ ];
c.drain(&mut events);
// The keypad digits typed with Alt are gone (eight presses and eight releases, two here);
- // the digit typed without Alt stays, and the characters follow.
- assert_eq!(events, vec![key(Key::Num1, false, true), Event::Text("°—".into())]);
+ // the digit typed without Alt stays, and each character stays once.
+ assert_eq!(events, vec![key(Key::Num1, false, true), Event::Text("°".into()), Event::Text("—".into())]);
let mut events = vec![key(Key::Num0, true, true)];
c.drain(&mut events);
assert_eq!(events.len(), 1, "counts don't carry over to a later frame");
}
#[test]
- fn a_character_without_a_code_before_it_is_left_to_winit() {
+ fn characters_are_left_to_winit() {
let mut c = AltCodes::default();
- // A plain key press's character (winit types it), and Alt pressed and released alone.
+ // A plain key press's character, Alt pressed and released alone, and a code's character.
c.message(WM_KEYDOWN, 0x41, 0);
c.message(WM_CHAR, usize::from(b'a'), 0);
c.message(WM_SYSKEYDOWN, ALT, 0);
c.message(WM_KEYUP, ALT, 0);
c.message(WM_CHAR, usize::from(b'b'), 0);
+ alt_code(&mut c, "0176", 0xB0);
let mut events = vec![];
c.drain(&mut events);
assert!(events.is_empty(), "{events:?}");
}
#[test]
- fn another_key_while_alt_is_held_cancels_the_code() {
+ fn alt_with_another_key_keeps_its_shortcut() {
let mut c = AltCodes::default();
c.message(WM_SYSKEYDOWN, ALT, 0);
c.message(WM_SYSKEYDOWN, VK_NUMPAD0 + 1, 0);
// Alt+F: a shortcut, not a code.
c.message(WM_SYSKEYDOWN, 0x46, 0);
c.message(WM_KEYUP, ALT, 0);
- c.message(WM_CHAR, 0x41, 0);
- let mut events = vec![];
+ let mut events = vec![key(Key::Num1, true, true), key(Key::F, true, true)];
c.drain(&mut events);
- assert!(!events.iter().any(|e| matches!(e, Event::Text(_))), "{events:?}");
- }
-
- #[test]
- fn a_code_above_the_basic_plane_arrives_as_two_halves() {
- let mut c = AltCodes::default();
- c.message(WM_SYSKEYDOWN, ALT, 0);
- c.message(WM_SYSKEYDOWN, VK_NUMPAD0 + 1, 0);
- c.message(WM_KEYUP, ALT, 0);
- c.message(WM_CHAR, 0xD83D, 0);
- c.message(WM_CHAR, 0xDE00, 0);
- let mut events = vec![];
- c.drain(&mut events);
- assert_eq!(events, vec![Event::Text("😀".into())]);
+ assert_eq!(events, vec![key(Key::F, true, true)]);
}
/// Alt held, keypad digits `code` with NumLock off (keypad Insert, End, …, flags without the
@@ -284,7 +234,7 @@ mod tests {
}
#[test]
- fn with_numlock_off_the_keypad_keys_type_the_code_and_leave_the_caret_alone() {
+ fn with_numlock_off_the_keypad_keys_leave_the_caret_alone() {
let mut c = AltCodes::default();
alt_code_numlock_off(&mut c, "0176", 0xB0);
// What egui reports for keypad 0, 1, 7 and 6 with NumLock off and Alt held, a press and a
@@ -296,7 +246,7 @@ mod tests {
}
events.push(key(Key::Home, false, true));
c.drain(&mut events);
- assert_eq!(events, vec![key(Key::Home, false, true), Event::Text("°".into())]);
+ assert_eq!(events, vec![key(Key::Home, false, true)]);
}
#[test]
@@ -309,11 +259,11 @@ mod tests {
let mut events =
vec![key(Key::Num5, true, true), key(Key::ArrowDown, true, true), key(Key::PageDown, true, true), key(Key::ArrowLeft, true, true)];
c.drain(&mut events);
- assert_eq!(events, vec![Event::Text("—ê".into())]);
+ assert!(events.is_empty(), "{events:?}");
}
#[test]
- fn the_separate_navigation_keys_still_move_the_caret_and_cancel_the_code() {
+ fn the_separate_navigation_keys_still_move_the_caret() {
let mut c = AltCodes::default();
c.message(WM_SYSKEYDOWN, ALT, 0);
c.message(WM_SYSKEYDOWN, NUMLOCK_OFF_KEYS[1], 0);
@@ -322,7 +272,6 @@ mod tests {
c.message(WM_SYSKEYDOWN, NUMLOCK_OFF_KEYS[7], EXTENDED_KEY);
c.message(WM_SYSKEYUP, NUMLOCK_OFF_KEYS[7], EXTENDED_KEY);
c.message(WM_KEYUP, ALT, 0);
- c.message(WM_CHAR, 0x41, 0);
let mut events = vec![key(Key::End, true, true), key(Key::End, true, false), key(Key::Home, true, true), key(Key::Home, true, false)];
c.drain(&mut events);
assert_eq!(events, vec![key(Key::Home, true, true), key(Key::Home, true, false)]);
diff --git a/apps/vectorcraft/src/xwayland.rs b/apps/vectorcraft/src/xwayland.rs
index 38b210c05e..1471f44199 100644
--- a/apps/vectorcraft/src/xwayland.rs
+++ b/apps/vectorcraft/src/xwayland.rs
@@ -22,18 +22,61 @@ use std::path::{Path, PathBuf};
const X11_LIBS: &[&str] =
&["libX11.so.6", "libX11-xcb.so.1", "libxcb.so.1", "libXcursor.so.1", "libXi.so.6", "libxkbcommon.so.0", "libxkbcommon-x11.so.0"];
-/// Whether the saved `linuxDisplayServer` and the environment ask for XWayland: `x11` chosen, or
-/// any other choice (`automatic`, `x11WithPen`, none saved) with `pen` finding a pen and
-/// `VECTORCRAFT_NATIVE_WAYLAND` unset (or `0`); a Wayland session (winit picks Wayland whenever
-/// `WAYLAND_DISPLAY` or `WAYLAND_SOCKET` is set); and an X display to open. `pen` runs only after
-/// the other checks.
-pub fn wanted(pref: Option<&str>, var: impl Fn(&str) -> Option, pen: impl FnOnce() -> bool) -> bool {
+/// What the pen check found: the name of the first pen, `None` when there is none, or why the
+/// device list could not be read.
+pub type PenProbe = Result