Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dev.zed.Zed #5253

Draft
wants to merge 7 commits into
base: new-pr
Choose a base branch
from
Draft

Add dev.zed.Zed #5253

wants to merge 7 commits into from

Conversation

ShobuPrime
Copy link

Please confirm your submission meets all the criteria

  • Please describe your application briefly.
  • Builds and deploys the new Zed code editor from source with no modifications to binary.
  • I have read the App Requirements and App Maintenance pages.
  • My pull request follows the instructions at App Submission.
  • I have built and tested the submission locally.
  • Builds and tests have been performed locally with the included Makefile
  • I am using only the minimal set of permissions. (If not, please explain each non-standard permission.)
  • All assets referenced in the manifest are redistributable by any party. If not, the unredistributable parts are using an extra-data source type.
  • I am an author/developer/upstream contributor of the project. If not, I contacted upstream developers about submitting their software to Flathub. Link: Linux Roadmap zed-industries/zed#7015
  • I have not contacted the developers yet because the topic is closed. I've made a discussion here
  • The domain used for the application ID is controlled by the application developers either directly or through the code hosting (e.g. GitHub, GitLab, SourceForge, etc.). The application id guidelines are followed.
  • Any additional patches or files have been submitted to the upstream projects concerned. (If not, explain why.)

@ShobuPrime ShobuPrime changed the title Dev.zed.zed Zed Code Editor as Flatpak! May 16, 2024
@ShobuPrime
Copy link
Author

Zed doesn't have an official Linux distribution yet, requiring users to help build from source -- so I decided to help make one

@hfiguiere hfiguiere changed the title Zed Code Editor as Flatpak! Add dev.zed.Zed May 17, 2024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should be sumbitted upstream

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev.zed.Zed.yaml Outdated Show resolved Hide resolved
dev.zed.Zed.yaml Outdated Show resolved Hide resolved
dev.zed.Zed.yaml Outdated Show resolved Hide resolved
dev.zed.Zed.yaml Outdated Show resolved Hide resolved
dev.zed.Zed.yaml Outdated Show resolved Hide resolved
dev.zed.Zed.yaml Outdated Show resolved Hide resolved
dev.zed.Zed.yaml Outdated Show resolved Hide resolved
dev.zed.Zed.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this icon should be submitted upstream too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,6 @@
{
"only-arches": [
"x86_64"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHY?

Comment on lines +4 to +5
],
"automerge-flathubbot-prs": true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
],
"automerge-flathubbot-prs": true
]

dev.zed.Zed.yaml Outdated Show resolved Hide resolved
dev.zed.Zed.yaml Outdated Show resolved Hide resolved
dev.zed.Zed.yaml Outdated Show resolved Hide resolved
@bbhtt bbhtt added the awaiting-changes Pull request waiting for changes from author label May 17, 2024
Comment on lines +55 to +57
<project_group>
<group>Zed</group>
</project_group>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<project_group>
<group>Zed</group>
</project_group>
<project_group>Zed</project_group>

<category>Utility</category>
</categories>
<developer_name>Zed Developers</developer_name>
<update_contact>@ZedSupport</update_contact>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like valid, should be the email.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-update_contact

The <update_contact/> tag is an optional tag which can be added to provide an email address

<component type="desktop-application">
<id>dev.zed.Zed</id>
<name>Zed</name>
<summary>High-performance, multiplayer code editor from the creators of Atom and Tree-sitter.</summary>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<summary>High-performance, multiplayer code editor from the creators of Atom and Tree-sitter.</summary>
<summary>High-performance, multiplayer code editor from the creators of Atom and Tree-sitter</summary>

Comment on lines +37 to +44
<videos>
<video>
<source>https://customer-snccc0j9v3kfzkif.cloudflarestream.com/b66a1a0a8b375d13c19afe4b37f92562/downloads/default.mp4</source>
</video>
<video>
<source>https://customer-snccc0j9v3kfzkif.cloudflarestream.com/99f0ed130711eb6f47fca1777efa57ef/downloads/default.mp4</source>
</video>
</videos>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<videos>
<video>
<source>https://customer-snccc0j9v3kfzkif.cloudflarestream.com/b66a1a0a8b375d13c19afe4b37f92562/downloads/default.mp4</source>
</video>
<video>
<source>https://customer-snccc0j9v3kfzkif.cloudflarestream.com/99f0ed130711eb6f47fca1777efa57ef/downloads/default.mp4</source>
</video>
</videos>

Not a valid tag and website doesn't support videos.

</categories>
<developer_name>Zed Developers</developer_name>
<update_contact>@ZedSupport</update_contact>
<url type="homepage">https://www.zed.dev/</url>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<url type="homepage">https://www.zed.dev/</url>
<url type="homepage">https://zed.dev/</url>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.zed.dev/ is not reachable, zed.dev is the domain.

<developer_name>Zed Developers</developer_name>
<update_contact>@ZedSupport</update_contact>
<url type="homepage">https://www.zed.dev/</url>
<url type="bugtracker">https://github.com/zed/zed/issues</url>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<url type="bugtracker">https://github.com/zed/zed/issues</url>
<url type="bugtracker">https://github.com/zed-industries/zed/issues</url>

<update_contact>@ZedSupport</update_contact>
<url type="homepage">https://www.zed.dev/</url>
<url type="bugtracker">https://github.com/zed/zed/issues</url>
<url type="help">https://www.zed.dev/support</url>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<url type="help">https://www.zed.dev/support</url>
<url type="help">https://zed.dev/support</url>

<id>dev.zed.Zed</id>
<name>Zed</name>
<summary>High-performance, multiplayer code editor from the creators of Atom and Tree-sitter.</summary>
<description>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post corrections this file should be submitted upstream

@ConradIrwin
Copy link

👋 Thanks for doing this! There is a parallel effort here too: zed-industries/zed#11949.

When built under flatpak does the integrated terminal work, and language server support for rust/ruby/python/etc.etc.?

I may be misunderstanding exactly how the sandbox works, but I think it's likely to result in a pretty broken zed install as is. (Not saying you shouldn't bundle it as a flatpak, but that it would be good to understand and document the limitations).

@ShobuPrime
Copy link
Author

Hey @ConradIrwin , thanks for the feedback! I wasn't aware of zed-industries/zed#11949 so I'll give that a look.

I may be misunderstanding exactly how the sandbox works, but I think it's likely to result in a pretty broken zed install as is. (Not saying you shouldn't bundle it as a flatpak, but that it would be good to understand and document the limitations).

Definitely a good thing to keep in mind. Someone else addressed a similar concern in the discussion I've made here: zed-industries/zed#discussion=11945 and I've mentioned the solution could simply involve bundling more languages into the manifest, or just using the host shell since that's how the VSCode Flatpak handles this with its integrated terminal

@ShobuPrime ShobuPrime marked this pull request as draft May 18, 2024 02:16
@ShobuPrime
Copy link
Author

Converted PR to draft as I fundamentally change the build process from online to --offline based on @hfiguiere's feedback

I found the flatpak-cargo-generator so I can convert Zed's Cargo.toml

Some initial progress on the offline conversion has proven a bit challenging since I'm coming across build errors such as:

error: failed to get `blade-graphics` as a dependency of package `gpui v0.1.0 (/run/build/zed/crates/gpui)`

Caused by:
  failed to load source for dependency `blade-graphics`

Caused by:
  Unable to update https://github.com/kvark/blade?rev=f5766863de9dcc092e90fdbbc5e0007a99e7f9bf#f5766863

Caused by:
  can't checkout from 'https://github.com/kvark/blade': you are in the offline mode (--offline)
Error: module zed: Child process exited with code 101
make: *** [Makefile:9: build] Error 1
make build  12.78s user 11.33s system 64% cpu 37.616 total

While testing and building locally with the network build arguments worked with no issues -- if it is not up to Flathub's standards I will make sure the manifest/repo is updated accordingly.

@ShobuPrime
Copy link
Author

Tagging @someone13574 for visibility

@bbhtt
Copy link
Contributor

bbhtt commented May 18, 2024

git dependencies won't work, you have patch them (See examples 1, 2 ) or use vendored tarballs.

could simply involve bundling more languages into the manifest

You likely want to integrate with ide-flatpak-wrapper like VScode/vscodium does https://github.com/flathub-infra/ide-flatpak-wrapper This will enable using the language SDK extensions published on Flathub and also display first run warnings/messages etc.

or just using the host shell since

Yes this likely needs flatpak-spawn access --talk-name=org.freedesktop.Flatpak. You have to ask for an exception for that https://docs.flathub.org/docs/for-app-authors/linter#finish-args-flatpak-spawn-access

@bbhtt bbhtt added the work-in-progress Draft PRs label May 18, 2024
- cargo fetch --manifest-path Cargo.toml --offline --verbose

# Build Zed with parallel jobs
- cargo build --release --locked --all-features --jobs $(nproc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- cargo build --release --locked --all-features --jobs $(nproc)
- cargo build --release --locked --all-features

don't use nproc. If you really want to add it (cargo does it by itself) use $FLATPAK_BUILDER_N_JOBS which honour the flatpak-builder --jobs argument.

# Install Zed
- install -Dm 755 target/release/Zed --target-directory ${FLATPAK_DEST}/bin/

# Install Desktop, MetaInfo, and MIME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any MIME file.

Comment on lines +58 to +59
env:
- CARGO_HOME=/run/build/zed/cargo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
env:
- CARGO_HOME=/run/build/zed/cargo
env:
CARGO_HOME: /run/build/zed/cargo

path: patches/Cargo.toml.diff

# Cargo Dependencies (Generated with: https://github.com/flatpak/flatpak-builder-tools/blob/master/cargo/flatpak-cargo-generator.py)
- type: dir
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use type: dir.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't even see why you need it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, thre is an icon in the upstream repository, use it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there a .desktop file upstream? Then it should be used.

@someone13574
Copy link

Fairly certain that git blame integration will be broken in addition to the terminal+tasks and any language servers which don't have an sdk extension. Also dev-extensions and the cli.

</releases>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MIT</project_license>
<content_rating type="oars-1.1"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Zed has audio and chat functionality, this needs to reflect that:

<content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="social-audio">intense</content_attribute>

</description>
<screenshots>
<screenshot type="default">
<image>https://zed.dev/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fhero-1.bb06921e.png&amp;w=2048&amp;q=75</image>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ConradIrwin
Copy link

@ShobuPrime @someone13574 is there a way to coordinate here? We’d love to have Zed just work through flatpak, but we’re not heading in that direction right now.

@ShobuPrime It makes me very unhappy to think that we’d ship a partially non-functional zed on flathub, so before you merge this I’d like to make sure you’re incorporating @someone13574’s fixes from zed-industries/zed#12006.

@someone13574 On the flip side, if we need to have the recipe for building the flatpak here, I don’t think we need to have a different one in the zed repo too.

Re:LSPs, relying on flatpak packaged ones is probably a non-starter for a functional IDE. The versions of the binaries you need are often per project, rather than per workstation.

@ConradIrwin
Copy link

If it’d be helpful to talk through this in more detail, we can meet up in the Zed Discord at some point next week. https://discord.gg/8GubhShZ3a

@bbhtt
Copy link
Contributor

bbhtt commented May 19, 2024

so before you merge this

It won't be merged until everyone is confident with the final package.

@ShobuPrime
Copy link
Author

@ShobuPrime @someone13574 is there a way to coordinate here? We’d love to have Zed just work through flatpak, but we’re not heading in that direction right now.

@ConradIrwin I'd be happy to coordinate! I'm traveling foe business this week so I most likely won't be able to add any more work until next week (5/28). I saw you posted the Discord and I'll be happy to join there.

@ShobuPrime It makes me very unhappy to think that we’d ship a partially non-functional zed on flathub, so before you merge this I’d like to make sure you’re incorporating @someone13574’s fixes from zed-industries/zed#12006.

Nothing to worry about here and there's certainly no rush -- as mentioned by @bbhtt it we won't need to merge it until everyone is happy and functionality is in as much parity with the native install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-changes Pull request waiting for changes from author work-in-progress Draft PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants