Repository navigation
feat(com.visualstudio.code): add Visual Studio Code (com.visualstudio.code) - #922
Conversation
jing2uo
left a comment
There was a problem hiding this comment.
Thanks for this! VS Code fits here: the Flathub package is third-party (not verified) and sits at 1.139.1 while upstream is at 1.144.0, so it qualifies under apps already on Flathub. The extras (code-flags.conf, gpg-agent, TMPDIR, NixOS shells) are welcome too.
The manifest is still shaped for Flathub, though, and FlatPark works differently in a few places. These need to change before we can merge:
1. No source builds. FlatPark is extra-data only: nothing gets compiled into /app (limits). That rules out the kerberos and host-spawn modules and the golang SDK extension.
host-spawn: pin upstream's release binaries (x86_64/aarch64) as a second extra-data source, as the Flathub manifest does already (it pins them astype: file).krb5: our Chromium-based packages (com.google.Chrome,com.brave.Origin) ship without it and say so in a manifest comment. If Kerberos/Negotiate SSO matters to you, it would go throughflatpark/prebuilt, not into this manifest.
2. flatpark.yml and resolve-update.sh are missing. Our CI ignores x-checker-data. A resolver tells it the latest version, then it re-pins the .deb and adds the metainfo release on its own (descriptor, updates). With that in place, the metainfo only needs the current release, not the history copied from Flathub.
3. Declare the high-risk permissions. --filesystem=host, --device=all and especially --talk-name=org.freedesktop.Flatpak (host-spawn's sandbox escape) all go under policy.dangerous_permissions with a short reason (how). registry/ai.z.zcode/flatpark.yml is a close example. Since code.sh changes how the app runs (extra flags, TMPDIR, the /etc/shells links), please declare that as well (changes to how the app runs).
4. Unpack the .deb with bsdtar. The Platform has no ar, which is why the manifest copies ar, libbfd and libsframe out of the SDK. bsdtar reads the ar container directly, so all three can go. See registry/ai.cumora.Cumora/apply_extra.sh:
bsdtar -xOf code.deb 'data.tar*' | bsdtar --no-same-owner -xf - -C stage--no-same-owner matters for system-wide installs, where apply_extra runs as root with every capability dropped.
5. Point the texts at FlatPark, not Flathub.
- metainfo
help→ this repo's issues (or a README of yours), not flathub/com.visualstudio.code; flatpak-warning.txtmentions flathub.org andflatpak install flathub …; the SDK extensions really do come from Flathub, but say which remote that is rather than presenting this as the Flathub build;- the description should say how this package differs from Flathub's (rule linked above). Your PR description is basically that text already.
Finally, please run the local checks from submitting (read-descriptor, audit-descriptor, check-apply-extra.sh, publish.sh --verify). CI hasn't run on this branch yet, and those checks will catch most of the above.
|
@jing2uo Thanks for your review! I applied the requested changes, please let me know if anything else is missing. I did review it myself and it looks clean, but also used Claude Code to make some of these changes. This also means switching the runtime to Platform instead of SDK. This has some traits off, like no python/node. Please let me know if SDK is allowed (or should be used instead). |
|
Thanks, the rest looks good now. Yes, the SDK is allowed, and I'd go back to it. Runtimes come from Flathub and don't count against FlatPark's storage, and the Flathub package uses the SDK too. Please switch back to
(For the record: Platform does have Please add a one-line comment in the manifest on why it's the SDK (git and compilers in the sandbox, SDK extensions), then revert the related lines in |
|
Done: back on |
jing2uo
left a comment
There was a problem hiding this comment.
Thanks for working through all of this so quickly. Approving. Here's the full review for the record:
Why it's listed: the Flathub package is third-party (not verified) and lags upstream by about a month (1.139.1 there, 1.144.0 here), so it qualifies under apps already on Flathub. The metainfo lists how this package differs.
What I checked:
- Extra-data only: nothing is built from source. Microsoft's
.deband host-spawn's upstream static binaries are both extra-data,apply_extra.shunpacks the.debwithbsdtar --no-same-ownerand checks the layout it relies on, and dropping krb5 is noted in the manifest. - Updates:
resolve-update.shresolves Microsoft's commit-addressed, versioned.debURLs from the update API and checks that x64 and arm64 agree on the version. host-spawn sits outside the managed block and is pinned by hand, as its comment says. - Permissions: each finish-arg has a reason.
--filesystem=host,--device=alland--talk-name=org.freedesktop.Flatpakare declared inpolicy.dangerous_permissions, andpackaging:declareshost-commandandseeded-config.read-descriptorpasses, andaudit-descriptorpasses with only the expected warnings for the declared sandbox-escape permissions. - Runtime: the Sdk is the right choice here. It provides git, the compilers, the
org.freedesktop.Sdk.Extensionmount point and thelibtinfo.sothat the.so.5link points to. Runtimes come from Flathub, so it costs FlatPark nothing. - Texts: help, the first-run note and the metainfo point at FlatPark, and say that SDK extensions and
com.visualstudio.code.tool.*come from Flathub.
Nit, not blocking: flatpak-warning.txt still says ls /app/bin (bundled with this flatpak), but host-spawn now lives in /app/extra/bin. Fix it whenever convenient.
This is my fork of the frequently out-of-date flathub/com.visualstudio.code on Flathub:
code-flags.confis read at startup.The runtime stays
org.freedesktop.Sdkinstead of the Platform. Only the Sdk declares theorg.freedesktop.Sdk.Extensionmount point (flatpak info -m org.freedesktop.Platform//26.08has no such entry), so on the Platform no SDK extension (golang, dotnet, podman, …) mounts andFLATPAK_ENABLE_SDK_EXTdoes nothing. Nothing is built against it; the app is still extra-data only.