Skip to content

armgit / SOMA

Public Imported from GitHub
0

Desktop app for designing parametric 3D models in CadQuery together with the coding agent of your choice

Doku: Changelog und README zum Bytecode der Basisumgebung

Kai-Jungsthoefel1da10994b3a1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a92edc8..9087601 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,7 @@ the version is bumped.
### Fixed
+- The macOS app no longer changes its own files while it runs: Python wrote cached bytecode into the app bundle, which breaks the code signature. The bundled Python now comes precompiled and writes no cache, so model folders no longer get a `__pycache__` folder either. Thanks to Mike O'Connor (fork mjoconr/SOMA) for spotting this.
- Some STEP files could not be shown in the viewer ("Step file does not contain an assembly"), for example a single body like a logo from another CAD program. They now open with one part per body, keeping names and colors where the file has them. `import_assembly()` reads such files too, and `import_step()` no longer drops all bodies but the first when a file has several side by side.
- Saving could crash with "A JavaScript error occurred in the main process: file data stream has unexpected number of bytes" when a file of the model changed while it was being packed, for example by a build or the agent. No build starts while the model is being saved or exported, a file that changes anyway is packed a second time, and if it keeps changing, saving reports it instead of crashing.
diff --git a/app/README.md b/app/README.md
index 5a65871..2001f86 100644
--- a/app/README.md
+++ b/app/README.md
@@ -67,7 +67,7 @@ SOMA_TEST_EXE="$LOCALAPPDATA/soma-dev/release/win-unpacked/SOMA.exe" node test/s
```
- Ohne `--target` und `SOMA_RUNTIME` liegt die Basisumgebung in `app/python-runtime`, die Pakete in `app/release` (beide in `.gitignore`). In einem synchronisierten Ordner (OneDrive, Netzlaufwerk) besser nicht: rund 1,4 GB in Zehntausenden Dateien.
-- **Basisumgebung:** Ein venv lässt sich nicht verschieben, deshalb ein eigenständiges Python. Die Startprogramme (`soma`, `pip` …) bekommen einen relativen Pfad zum Python: unter Windows als `.cmd` (PowerShell, cmd) und ohne Endung (Git Bash), sonst als Shell-Vorspann. `build_runtime.py` prüft am Ende eine Kopie in einem Ordner mit Leerzeichen. `EXTERNALLY-MANAGED` bleibt, pip installiert nur in die Projektumgebung (E67).
+- **Basisumgebung:** Ein venv lässt sich nicht verschieben, deshalb ein eigenständiges Python. Die Startprogramme (`soma`, `pip` …) bekommen einen relativen Pfad zum Python: unter Windows als `.cmd` (PowerShell, cmd) und ohne Endung (Git Bash), sonst als Shell-Vorspann. `build_runtime.py` übersetzt die ganze Umgebung vorab (`compileall`, unchecked-hash) und prüft am Ende eine Kopie in einem Ordner mit Leerzeichen, dort auch, dass beim Import keine neue `.pyc` entsteht. Die App startet Python mit `PYTHONDONTWRITEBYTECODE` (`pythonEnv` in `paths.ts`): Unter macOS machte jede neue `.pyc` im Paket die Signatur ungültig. `EXTERNALLY-MANAGED` bleibt, pip installiert nur in die Projektumgebung (E67).
- **Im Paket:** `resources/python` (Basisumgebung, `paths.ts` findet sie vor der Entwicklungsumgebung), `resources/app` mit `dist/`, `resources/` und nur `dugite` und `node-pty` aus `node_modules` (alles andere bündelt esbuild), ohne asar. Dazu `LICENSE.txt`, `MODEL-EXCEPTION.md` und `THIRD_PARTY_NOTICES.md` (von Hand gepflegt). Die Lizenztexte der npm-Pakete sammelt `esbuild.config.mjs` beim Build nach `dist/licenses/<paket>@<version>/`, weil esbuild sie beim Bündeln verliert.
- **Windows:** Installation für den Nutzer nach `%LOCALAPPDATA%\Programs\SOMA` ohne Adminrechte, unsigniert (SmartScreen warnt beim ersten Start). Dazu `win-unpacked` als ZIP zum Entpacken ohne Installation (nicht das Ziel `portable`, das bei jedem Start nach %TEMP% entpackt). Die App-Daten liegen auch dann unter `%APPDATA%`. Windows überträgt die Download-Markierung (Mark of the Web) beim Entpacken mit dem Explorer auf alle Dateien, ohne „Zulassen“ in den Eigenschaften des ZIPs warnt SmartScreen beim Start von `SOMA.exe` genauso.
- **macOS:** nur Apple Silicon (für Intel fehlt `cryptography` als Wheel), ad-hoc signiert, nicht notarisiert: Gatekeeper lässt die App erst nach Rechtsklick > Öffnen oder `xattr -cr /Applications/SOMA.app` starten. Die installierte App übernimmt beim Start den PATH einer Login-Shell, sonst fänden Agenten-Erkennung und Terminals nichts aus Homebrew oder npm.