Skip to content

add OpenModelica, a Modelica simulation environment (org.openmodelica.OpenModelica) - #808

Merged
jing2uo merged 7 commits into
flatpark:mainfrom
rhgKc2yp:add/org.openmodelica.OpenModelica
Oct 25, 2026
Merged

jing2uo merged 7 commits into
flatpark:mainfrom
rhgKc2yp:add/org.openmodelica.OpenModelica

Conversation

@rhgKc2yp

@rhgKc2yp rhgKc2yp commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

OpenModelica is an open-source Modelica modeling and simulation environment for academic and industrial use. This package provides its OMEdit graphical interface, compiler, simulation libraries, and offline Modelica Standard Library cache.

This is an independent community package; upstream approval has not been obtained.

Packaging

  • One extra-data download: a release bundle from rhgKc2yp/OMEdit-release, pinned by URL, SHA-256 and size. apply_extra only extracts it.

  • The bundle is assembled by that repo's GitHub Actions workflow, which compiles and patches nothing:

    • official stable 1.27.1 Trixie .deb packages from upstream's versioned release archive;
    • the Debian Trixie libraries the KDE runtime lacks;
    • the Qt WebEngine closure that OMEdit links, copied from an exact io.qt.qtwebengine.BaseApp//6.11 Flathub commit.

    Every .deb is checked against its Packages SHA-256 and size. No Debian maintainer scripts run. SOURCES and SOURCES.lock.json in the bundle record every input.

  • Before publishing, the workflow runs a release gate inside org.kde.Sdk//6.11: ldd over every ELF, omc --version, and an offline headless simulation. The gate runs on the assembled tree and again after extracting the finished archive.

  • No BaseApp is copied into our ref. The stored Flatpak tree holds only the wrapper, desktop file, metainfo and icon.

  • Runtime is org.kde.Sdk//6.11, because simulations generate and compile native code. GCC, binutils, Make and headers stay inside the sandbox. The bundle's clang/clang++ launchers call the SDK's GCC, because the Debian build defaults to clang.

  • resolve-update.sh follows the release repo's latest release. The repo rebuilds when upstream, Debian packages, the BaseApp or the SDK change.

Sandbox

Granted:

  • Network access for Modelica library downloads, online documentation, and release information.
  • Wayland with fallback X11 for the Qt interface.
  • GPU access for accelerated Qt and Qt WebEngine rendering.
  • IPC for the graphical stack.
  • --persist=.openmodelica for downloaded Modelica libraries and package-manager data.

Not granted:

  • No home or host filesystem access.
  • No host command or toolchain access.
  • No audio, device-wide, session-bus, or system-bus permissions.

Files outside the sandbox can be opened and saved through the desktop file chooser.

Tested

On the release bundle:

  • The release gate passed in CI (run 40130837168): all 99 shipped ELF files resolve their dependencies, omc reports 1.27.1, and a headless simulation finishes. It passed both on the assembled tree and after extracting the archive.
  • Locally: system-install extraction, OMEdit startup with Qt WebEngine sandboxing enabled, and an offline simulation.

On the earlier per-package layout, with the same upstream binaries and runtime:

  • Launched OMEdit on Wayland; the measured application ID OMEdit matches StartupWMClass.
  • Simulated a bouncing-ball model end to end with GCC 15.2 inside the sandbox.
  • Library cache persistence across restarts without network; no ~/.openmodelica created on the host.

Testing covered x86_64. Advanced workflows such as FMI import/export, debugging, and visualization were not exercised.

Flathub

No existing Flathub application was found under org.openmodelica.OpenModelica.

Assisted by Codex

Thank you for creating Flatpark.

feat(openmodelica): add OpenModelica, a Modelica simulation environment (org.openmodelica.OpenModelica)

Package the official stable 1.27.1 Trixie binaries from upstream's versioned release archive as extra-data. Include the offline Modelica library cache and the Debian runtime dependencies absent from KDE 6.11.

OpenModelica generates and compiles native simulation code, so use the KDE SDK as the runtime. This keeps the required GCC toolchain inside the sandbox instead of depending on host commands.
@jing2uo

jing2uo commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Hi @rhgKc2yp, thanks for the PR, and sorry for leaving it without a reply for a few days.

The delay came from base: io.qt.qtwebengine.BaseApp. Everything else in the package is extra-data, but a base app is copied into /app at build time, so the whole Qt WebEngine lands in our ref. That is about 490 MB installed and 230 MB compressed, nearly all of which would go into our R2 repo for this one app; nothing else in the catalog uses this BaseApp, so nothing shares it. Every Qt/Chromium patch release of the BaseApp would then push another rebuild of the 209 MB libQt6WebEngineCore through CI and R2. Dropping it isn't an option either: /usr/bin/OMEdit links libQt6WebEngineCore.so.6 and libQt6WebEngineWidgets.so.6 directly.

What I'd suggest instead is a release repository, e.g. OMEdit-release, under your own account. It would build a tarball that runs as downloaded, and the FlatPark package would then be a single extra-data download and unpack:

  • Release repo (GitHub Actions): fetch the upstream Trixie debs and the Debian libraries KDE 6.11 lacks, checked against their Packages SHA256. Take the Qt WebEngine files OMEdit needs (libraries, QtWebEngineProcess, resources, a few locales) from a pinned io.qt.qtwebengine.BaseApp//6.11. Lay the tree out the way the app expects (the omc paths, the blas/lapack links) and publish one versioned .tar.gz/.tar.zst. A SOURCES file listing each component's URL and hash keeps it traceable to upstream.
  • Check before publishing: inside org.kde.Sdk//6.11, run ldd over every ELF (no not found), omc --version, and a headless simulation. A new dependency in a future upstream release then fails the release build rather than shipping an OMEdit that won't start.
  • FlatPark side: one extra-data pin, an apply_extra that just extracts it, the wrappers, and a resolve-update.sh that reads your latest release. A new BaseApp commit or Debian security update can trigger a new release on your side, with no manual tracking here.

References for this setup:

The package stays on org.kde.Sdk//6.11 as the runtime, so simulations keep the toolchain inside the sandbox. Upstream also has arm64 Trixie debs, so aarch64 could come later from the same workflow.

Happy to help once the release repo is up. Ping here and I'll review the workflow and the reworked manifest.

Replace the build-time Qt WebEngine BaseApp with a single versioned
OMEdit release bundle containing the official OpenModelica binaries,
runtime dependencies, and Qt WebEngine.

Keep simulations on KDE SDK 6.11 and track dependency rebuilds through
the release resolver. Reduce the stored Flatpak tree to approximately
172 KiB.

Verified all 99 ELF dependencies, offline simulation, system-install
extraction, and GUI startup with WebEngine sandboxing enabled
@rhgKc2yp
rhgKc2yp force-pushed the add/org.openmodelica.OpenModelica branch from 2f2afac to e417a79 Compare October 24, 2026 20:11
@rhgKc2yp

Copy link
Copy Markdown
Contributor Author

Hi @jing2uo , thanks for your reply and the explanation.

I’ve released the release repository workflow and reworked the FlatPark package to use one extra-data archive, keeping org.kde.Sdk//6.11 as the runtime.

The workflow verifies the Debian package hashes, pins the BaseApp commit, and includes source provenance. Local tests passed for all 99 shipped ELF files, an offline simulation, system-install extraction, and OMEdit startup with WebEngine sandboxing enabled. The stored Flatpak tree is now about 172 KiB.

Please let me know if i've misunderstood anything. Thanks again for your guidance.

The previous pin named v1.27.1-rd726246728a1dab8, a locally built archive
that was never published (404). v1.27.1-rf73b8a535a8ca199 is the bundle the
release workflow built and published from OMEdit-release 920ff27.
The bundle ships OMEdit, OMC and OMSimulator but not OMNotebook, and the
desktop entry starts OMEdit, which can't open .onb notebooks.
@jing2uo

jing2uo commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Thanks for building the release repo, @rhgKc2yp. I reviewed rhgKc2yp/OMEdit-release at 920ff27 and the reworked package. Its approach is what I had in mind, and the published bundle checks out byte for byte (details below).

Fixed on your branch

To save you another round, I made the remaining changes myself:

  • b0aa3e8: the manifest pinned v1.27.1-rd726246728a1dab8, an archive that was never published (404). It looks like it came from a local build. This commit re-pins to v1.27.1-rf73b8a535a8ca199, the bundle your workflow built and published (run 40130837168), and updates the metainfo <release> to match.
  • e6da0a9: drops MimeType=text/x-onb;application/x-omnotebook;. Those types belong to OMNotebook, which the bundle doesn't ship, and the desktop entry starts OMEdit.
  • Rewrote the PR description, which still described the old 16-pin/BaseApp layout. It now covers the release-bundle design, and the Tested section separates what you reported for the new bundle from what was tested on the earlier layout. Please correct it if I misstated anything.

Suggestion for the release repo (not blocking)

resolve.py puts the SDK and BaseApp commits into the fingerprint. Every KDE SDK 6.11 update therefore creates a new tag, and each new tag makes every user download 228 MB again, even when not a byte of the bundle changed. The SDK is only used to verify the bundle and to choose which libraries to leave out. Consider publishing only when the assembled tree's content hash differs from the latest release, e.g. by comparing against QT-FILES.sha256 plus a hash of usr/.

Review table

# Check Verdict Evidence
0 Static only ✅ Nothing executed. Artifacts downloaded as bytes into an isolated directory.
1.1 Scope ✅ New app registry/org.openmodelica.OpenModelica/ (8 files)
1.2 High-scrutiny surface ✅ No .github/, scripts/ or config/ changes. The resolver is in a brand-new app dir.
2.1 Submitter ⚠️ Account created 2026-10-22. Its only activity is three FlatPark PRs (#808, #835, #836).
2.2 Source repo ✅ Upstream OpenModelica/OpenModelica is long-established. The release repo was created on maintainer request.
2.3 Commit identity ✅ GitHub noreply address. The branch has merge-from-main commits; squash on merge.
2.5 Trust tier unknown-plausible
2.6 Provenance tier 1 The bundle is assembled by a public recipe from official debs and a Flathub BaseApp commit, and every byte was verified (5.4). Not tier 3.
3.1 Source types ✅ One extra-data entry with sha256 and size. Re-pinned to the CI release in b0aa3e8; the old pin was 404.
3.1b Nothing remote in /app ✅ Only wrapper, desktop, metainfo and icon are installed. No BaseApp.
3.2 finish-args ✅ ipc, network, wayland, fallback-x11, dri, --persist=.openmodelica. No filesystem grant.
3.3 policy: ✅ proprietary: false is accurate. No dangerous permissions.
3.4 build-commands ✅ install only
3.4b packaging: ✅ Nothing injected. Wrapper env and clang→gcc shims are external adaptation.
3.5/3.8 Download host ✅ Release repo requested by the maintainer. Its inputs are build.openmodelica.org, deb.debian.org and dl.flathub.org.
3.6 app-id ✅ org.openmodelica.OpenModelica, the upstream domain
3.7 update.command ✅ ./resolve-update.sh
3.9 Optional permissions ✅ None pre-granted
3.10 Testing record ✅ PR description rewritten for the bundle design. Testing record separates the new bundle from the earlier layout.
4.1 Runtime fetch-and-exec ✅ None. OMC compiles generated simulation code with the SDK's GCC, which is the app's core function.
4.2 Resolver as code ✅ One GitHub API call. Version regex ^\d+\.\d+\.\d+-r[0-9a-f]{16}$, exact asset-name match, outputs JSON. Nothing is evaluated.
4.3 Network endpoints ✅ Library downloads and docs. No broad filesystem grant.
5.1 sha256 == pin ✅ After b0aa3e8: 33c6ad1f60d0…0350, size 228676801 == the re-fetched asset == GitHub's digest
5.2 Archive inspection ✅ 913 entries under a single omedit/ root. No setuid/setgid, no absolute or .. paths, no symlink leaves the tree.
5.4 Bytes == official sources ✅ Release assets were uploaded by github-actions[bot] from run 40130837168 at recipe 920ff27. All 21 debs match the lock and today's upstream indexes (OM's versioned 1.27.1 archive and Debian trixie). All 658 files under usr/ are byte-identical to the debs' contents. bin/* and libexec/environment are identical to the repo. All 23 qt/ files are byte-identical to Flathub io.qt.qtwebengine.BaseApp//6.11 commit 7e78be2b…8952, the genuine current commit.
5.5 Bundled runtimes ✅ Qt WebEngine verified against Flathub (above).
5.6 IOC ✅ Nothing beyond official binaries, the recipe's launchers and provenance files.
6.1 Purpose ✅ Modelica simulation IDE, GPL-3.0
7.1 Verdict PASS Pin, MimeType and description fixed by the maintainer (b0aa3e8, e6da0a9)
7.2 Hard fails None remaining

read-descriptor and audit-descriptor pass locally. CI hasn't run on this PR yet; it needs workflow approval.

Not covered: running the app. I relied on your testing record for that.

@jing2uo
jing2uo merged commit 1bb33b9 into flatpark:main Oct 25, 2026
@rhgKc2yp
rhgKc2yp deleted the add/org.openmodelica.OpenModelica branch October 25, 2026 15:23
@rhgKc2yp

Copy link
Copy Markdown
Contributor Author

Thanks so much, @jing2uo . I'll follow your suggestion. Sorry for leaving it without a reply for a few days. I’ve been busy over the last few days testing the newly released software and fixing a few bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants