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

Generate a .deb file #12453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Generate a .deb file #12453

wants to merge 1 commit into from

Conversation

janos-r
Copy link
Contributor

@janos-r janos-r commented Jan 8, 2025

This PR makes it possible to generate a fully working .deb file with a one line command, thanks to cargo-deb which is a prerequisite for running it.

The .deb integrates well into a debian/ubuntu based system

  • system wide through a script that calls the binary together with the env runtime path
  • completions for bash, fish, zsh
  • .desktop file
  • icon (Though I didn't see that one used. Cinnamon has its own preferred theme icons)

Tested installing in a VM on Mint21.3 and all looks well!

If the maintainers agree, a cargo-deb could be added to the release workflow to generate the .deb.

@janos-r
Copy link
Contributor Author

janos-r commented Jan 8, 2025

image

@David-Else
Copy link
Contributor

David-Else commented Jan 8, 2025

Brilliant! I tried it on Debian Trixie and it worked perfectly, desktop and bash completion work great.

I used a fresh VM that had not had Rust or Helix on it, installed Rust and cargo-deb, and then just ran cargo deb in the Helix source folder.

The only problem seems to be the error messages regarding the grammars. They all seem to be working/present and correct inside /lib/helix/runtime/grammars, any idea what these error messages mean or how to get rid of them?:

arning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gas.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/passwd.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/prql.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/llvm.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/pem.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/log.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/lpf.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/pest.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gherkin.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/blade.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/make.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/cue.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/git-commit.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/markdoc.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/blueprint.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/cylc.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/git-config.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../contrib/hx
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/ada.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/git-rebase.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gitattributes.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/adl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/scheme.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gitignore.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gleam.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/c.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/cairo.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/capnp.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/amber.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/query.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/slint.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/cel.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/dbml.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/quint.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/circom.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/devicetree.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/clojure.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/r.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/dhall.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/glsl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/regex.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/diff.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/pkl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gn.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/rego.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/po.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/go.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/mermaid.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/smithy.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/meson.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/comment.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/cpon.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/dot.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/dtd.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/robot.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gomod.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gotmpl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/move.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gowork.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/nasm.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/gpr.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/graphql.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/edoc.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/nginx.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/groovy.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/solidity.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/eex.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/elisp.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/bass.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/spade.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/elixir.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/spicedb.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/prisma.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/proto.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/json5.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/sshclientconfig.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/strace.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/nix.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/hurl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/bibtex.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/nu.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/elvish.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/hyprlang.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/erlang.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/embedded-template.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/iex.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/esdl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/ini.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/fidl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/inko.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/heex.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/just.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/hocon.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/kdl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/latex.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/java.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/ld.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/forth.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/ldif.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/jjdescription.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/jq.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/hosts.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/jsdoc.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/jinja2.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/opencl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/json.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/openscad.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/thrift.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/todotxt.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/toml.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/ledger.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/llvm-mir.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/textproto.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/verilog.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/pascal.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/tact.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/uxntal.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/vhdl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/twig.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/task.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/vala.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/vhs.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/typespec.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/wit.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/wat.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/xit.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/wgsl.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/xml.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/xtc.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/ungrammar.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/yuck.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/zig.so
warning: Failed to find dependency specification.
         No $auto deps for /home/david/source/helix/helix-term/../runtime/grammars/wast.so

PS Debian is built for Trixie officially and just waiting in the new queue before it passes into testing:

https://salsa.debian.org/debian/hx
https://ftp-master.debian.org/new/hx_24.07+20241227-1.html

@janos-r
Copy link
Contributor Author

janos-r commented Jan 8, 2025

error messages

Yeah, this only LOOKS scary. It would be suppressed by adding depends = "" but then there would really be no package dependencies generated, which is not ideal. And I think it's definitely better to have them generated than written manual. Also, you can notice that the amount of grammars that didn't return any dependency (the number of warnings here) is much smaller than the actual number of grammars. In other words, a good number of grammars did add to the dependencies, just not all.

It is late for me here, but if I have some time tomorrow, I will make another commit to the workflow to really have the .deb generated during the release process.

@janos-r
Copy link
Contributor Author

janos-r commented Jan 8, 2025

and then just ran cargo deb in the Helix source folder

Well, the recommended way is to cargo build --profile opt --locked, and then the cargo deb --no-build. The locked is kinda important, and the opt is recommended in the docs and should make an even slightly better binary, which is then picked up by the --no-build.

But for some reason, maybe some maintainer can explain here to me, in the official release workflow

run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }}

helix doesn't use this --profile opt, I wonder why. Is it not recommended anymore? If not, it should be taken out of the manifest and the building-from-source.md

@the-mikedavis the-mikedavis added the A-packaging Area: Packaging and bundling label Jan 8, 2025
Copy link

@stappersg stappersg left a comment

Choose a reason for hiding this comment

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

Nice addition to what all ready exists.

Thanks for making cargo deb possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-packaging Area: Packaging and bundling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants