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

Merged
merged 17 commits into from
Jan 16, 2025
Merged

Generate a .deb file #12453

merged 17 commits into from
Jan 16, 2025

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.

Update:
Part of this PR is the integration into the CI to generate the .deb with every build (commit 2)
And fixing the workflow to complete runs initiated by PRs like this one (commit 3)

@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?:

Warning: 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.

@janos-r janos-r force-pushed the cargo-deb branch 2 times, most recently from 649dca9 to 57f6279 Compare January 10, 2025 06:05
@janos-r
Copy link
Contributor Author

janos-r commented Jan 10, 2025

Today's commit adds the Deb build step to the CI workflow and it successfully produces the file at the end of the release!
I use the default target/release/ directory to copy in (from x86_64-unknown-linux-gnu) and source the hx binary. But that shouldn't be an issue. That way I don't have to change the pretty standard config for cargo-deb in the manifest.

I still think the optimizations in the opt profile are good and should be used in the release profile, but that is a separate issue.

The publish step doesn't complete here because $GITHUB_REF_NAME looks like 12453/merge instead of a version tag. All pull request triggered publish steps fail when telling tar about the directory 12453.../ that doesn't exist. I might look into solving that too if I find time.

@jrvidal
Copy link
Contributor

jrvidal commented Jan 10, 2025

One thing to note is that the CI-generated .deb is not widely compatible out of the box. Instead, it might not work on older Debian-based distros (due to older versions of glibc, etc.). Just a caveat to keep in mind (that already applies to the published AppImage).

@janos-r
Copy link
Contributor Author

janos-r commented Jan 10, 2025

due to older versions

The highest generated dependencies for this Deb are: libc6 (>= 2.4) and libstdc++6 (>= 5.2)
I hope that covers some of the too-old distros.

@debajyoti1990
Copy link

due to older versions

The highest generated dependencies for this Deb are: libc6 (>= 2.4) and libstdc++6 (>= 5.2) I hope that covers some of the too-old distros.

Thanks a lot. I was about to ask about glibc dependencies 😃

This broke the publish step for all pull request started workflows.
Because this tag is used for both creating a directory and creating a
tar file.
@David-Else
Copy link
Contributor

David-Else commented Jan 10, 2025

The highest generated dependencies for this Deb are: libc6 (>= 2.4) and libstdc++6 (>= 5.2) I hope that covers some of the too-old distros.

I am not sure the dependencies will be met on Debian 12:

$ ldd --version                  
ldd (Debian GLIBC 2.36-9+deb12u9) 2.36

I think the libstdc++6 is OK, but I am not sure this is the right test:

$ /sbin/ldconfig -p | grep stdc++
libstdc++.so.6 (libc6,x86-64) => /lib/x86_64-linux-gnu/libstdc++.so.6

Debian 12 is not an old distribution, Debian 13 is not out until this summer.

EDIT: See this relevant discussion AppImage : no one works on debian 12

@janos-r
Copy link
Contributor Author

janos-r commented Jan 10, 2025

@David-Else You are right, that is weird... here on LinuxMint 21.3 (which is on the Jammy base), that has ldd 2.35, but the .deb installed just fine. The full line of the dependency (partially seen in the scrnshot) says:

Depends:
libc6 (>= 2.14),
libc6 (>= 2.2.5),
libc6 (>= 2.3),
libc6 (>= 2.3.4),
libc6 (>= 2.34),
libc6 (>= 2.4),
libstdc++6 (>= 5),
libstdc++6 (>= 5.2)

I am not sure how that works. I assumed all have to pass, that's why I shared the 2.4 previously. But as I said, it installs just fine on Jammy and I would assume it does on Debian 12 as well.

@janos-r
Copy link
Contributor Author

janos-r commented Jan 10, 2025

In the 3rd commit I fixed the workflow publish step for pull requests. So it (and future PRs) can pass if correct.
The .deb can be found in the linux folder https://github.com/helix-editor/helix/actions/runs/12707195657/artifacts/2412123752

@janos-r janos-r requested a review from stappersg January 10, 2025 10:57
@debajyoti1990
Copy link

I am getting glibc error in Debian 12. I disabled my brew version of helix and tried the .deb installer.

Screenshot from 2025-01-10 17-32-56

@janos-r
Copy link
Contributor Author

janos-r commented Jan 10, 2025

Ok, when I run cargo deb on local Jammy, I get libc6 (>= 2.34),
but when I run it on the CI workflow on github with ubuntu-latest, I get libc6 (>= 2.39)
That is unfortunate...

Ok, I didn't want to do this, but I will set the dependencies manually to libc6 (>= 2.34) and libstdc++6 (>= 5.2). Build it again in the helix workflow and test again on my VM. If that doesn't work, we will have to wait till helix downgrades the ubuntu image for releases. A PR is already out for that #12464

@janos-r
Copy link
Contributor Author

janos-r commented Jan 10, 2025

So I was able to install the deb with the manually setup dependencies, but it wouldn't work

hx --version
/usr/lib/helix/hx: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /usr/lib/helix/hx)
/usr/lib/helix/hx: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /usr/lib/helix/hx)

The good news is, that the cargo-deb automatic dependency resolution works really really well as I can see.
I reverted that last commit, I will keep the dependency resolution automatic and we will simply have to wait for the maintainers to accept the above linked PR and not build everything with the latest ubuntu. The appimage had a similar issue and doesn't run anymore.
In the meantime, anyone can run cargo deb on their own locally and generate the .deb themselves.
And after the ubuntu image downgrade, I am confident the CI will spit out compatible .deb files.

@stappersg
Copy link

stappersg commented Jan 10, 2025

<screenshot>
stappers@juli:/usr/src/rust/helix
$ git remote show janos-r
* remote janos-r
  Fetch URL: https://github.com/janos-r/helix.git
  Push  URL: https://github.com/janos-r/helix.git
  HEAD branch: master
  Remote branches:
    cargo-deb tracked
    gh-pages  tracked
    master    tracked
  Local branch configured for 'git pull':
    cargo-deb merges with remote cargo-deb
  Local refs configured for 'git push':
    cargo-deb pushes to cargo-deb (up to date)
    master    pushes to master    (fast-forwardable)
stappers@juli:/usr/src/rust/helix
$ git branch -v
* cargo-deb 917e03f1 Remove / from tag names
  master    9721144e language support: CodeQL (#12470)
stappers@juli:/usr/src/rust/helix
$ cargo deb
cargo-deb: This is a workspace with multiple packages, and there is no single package at the root. Please specify package name with -p. Available packages are: helix-core, helix-dap, helix-event, helix-loader, helix-lsp, helix-lsp-types, helix-parsec, helix-stdx, helix-term, helix-tui, helix-vcs, helix-view, xtask
stappers@juli:/usr/src/rust/helix
$ ls
base16_theme.toml  default.nix   helix-dap        helix-stdx      LICENSE         rustfmt.toml
book               docs          helix-event      helix-term      logo_dark.svg   rust-toolchain.toml
Cargo.lock         flake.lock    helix-loader     helix-tui       logo_light.svg  screenshot.png
Cargo.toml         flake.nix     helix-lsp        helix-vcs       logo.svg        shell.nix
CHANGELOG.md       grammars.nix  helix-lsp-types  helix-view      README.md       theme.toml
contrib            helix-core    helix-parsec     languages.toml  runtime         xtask
stappers@juli:/usr/src/rust/helix
$
</screenshot>

Please elaborate in on "and then just ran cargo deb in the Helix source folder"

Update:

cargo install --locked cargo-deb
...
    Finished `release` profile [optimized] target(s) in 1m 44s
   Replacing /home/stappers/.cargo/bin/cargo-deb
    Replaced package `cargo-deb v2.1.0` with `cargo-deb v2.10.0` (executable `cargo-deb`
$

Update 2:

stappers@juli:/usr/src/rust/helix
$ git diff master | grep ^+++
+++ b/.github/workflows/release.yml
+++ b/book/src/generated/lang-support.md
+++ b/contrib/hx
+++ b/helix-term/Cargo.toml
+++ b/helix-term/src/commands.rs
+++ b/helix-term/tests/test/commands.rs
+++ b/helix-view/src/document.rs
+++ b/languages.toml
+++ /dev/null
+++ /dev/null
stappers@juli:/usr/src/rust/helix
$    
stappers@juli:/usr/src/rust/helix
$ cd helix-term
stappers@juli:/usr/src/rust/helix/helix-term
$ cargo deb
   Compiling helix-term v25.1.0 (/usr/src/rust/helix/helix-term)
    Building [=======================> ] 328/331: helix-term(build)         

Plan: sleep first and further follow-up later, the follow-up might be deleting this comment.

@janos-r
Copy link
Contributor Author

janos-r commented Jan 10, 2025

Please elaborate in on "and then just ran cargo deb in the Helix source folder"

You don't even have to go to the helix-term, you can run it directly from the root helix folder workspace, because helix-term is defined as the default-members. So...

  • cargo install cargo-deb
  • git clone <my helix>
  • cd helix
  • switch to cargo-deb branch

And either a)

  • cargo deb -- --locked

or b) equivalent

  • cargo build --release --locked
  • cargo deb --no-build

or c) for the most optimal binary (I really hope they update their release mode)

  • cargo build --profile opt --locked
  • mkdir -p target/release
  • mv target/opt/hx target/release/
  • cargo deb --no-build

And run the resulted .deb from the target/debian/

book/src/building-from-source.md Outdated Show resolved Hide resolved
book/src/building-from-source.md Outdated Show resolved Hide resolved
Copy link
Contributor

@David-Else David-Else left a comment

Choose a reason for hiding this comment

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

I have made some changes to hopefully improve the wording and clarity of the documentation. I hope I didn't change any of the meaning of what you wrote, please give it a good look as I don't know much about packaging and the rust build system.

book/src/building-from-source.md Outdated Show resolved Hide resolved
book/src/building-from-source.md Outdated Show resolved Hide resolved
book/src/building-from-source.md Outdated Show resolved Hide resolved
book/src/package-managers.md Outdated Show resolved Hide resolved
book/src/package-managers.md Outdated Show resolved Hide resolved
book/src/building-from-source.md Show resolved Hide resolved
book/src/package-managers.md Outdated Show resolved Hide resolved
@janos-r
Copy link
Contributor Author

janos-r commented Jan 16, 2025

@the-mikedavis I guess it will take a while to get a hold of @archseer right?

@archseer
Copy link
Member

strip wasn't supported as an option on all platforms at the time so we conditionally enabled it on Linux, so this is a good change now.

I'm OK with the extra metadata in Cargo.toml, but I'd personally prefer we didn't build custom releases for a couple blessed platforms. I was hoping we'd have official packages available but the work is currently still ongoing (kudos to @jonassmedegaard for the effort!)

So my stance is, we can support .deb releases until they're available on distributions, at which point we'll remove them. We've done something similar with Homebrew where we maintained a tap until it was adopted by the package index.

Cargo.toml Outdated
Comment on lines 23 to 27
[profile.release]
lto = "thin"
# debug = true

[profile.opt]
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to keep two profiles: --release is intended for quick builds of develop, and is what anyone running from develop is using. These users will be the first to encounter bugs so we deliberately keep the backtraces on so we get usable bug reports. I also often use --release several times per day/when testing because debug builds are much less performant.

Release builds should use --opt to build the smallest and most performant binary, at the expense of lengthy compile times.

Copy link
Contributor Author

@janos-r janos-r Jan 16, 2025

Choose a reason for hiding this comment

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

Ok, so from the current PR, I will rename release to opt in both the manifest and the release CI.
I will keep a release profile in the manifest as it was before, with just thin lto and without strip. I hope I understood you correctly there. I am glad that the release CI will use an optimized build from now on. Even though it will not be called "release".

we can support .deb releases until they're available on distributions, at which point we'll remove them

Why remove them? If Helix makes it to the Debian and Ubuntu repositories and you remove .deb from the releases, the users would have to stay on an old repository version without enjoying any of the updates.

Copy link
Member

@archseer archseer Jan 16, 2025

Choose a reason for hiding this comment

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

Ah right, that's actually a good catch, the release CI was definitely intended to use --profile opt, must have been oversight.

Why remove them?

I prefer to hand off packaging to distributions if we can because it's just another maintenance burden. e.g. if cargo deb becomes out of date or unmaintained. We've already had issues with cross compilation before because the cargo-cross images we were using were a couple years out of date with no upstream updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cargo-deb is a dependency, that's true. Non the less I hope you can keep shipping these DEBs as long as possible. It is the best way how to install software of this kind on Debian, Ubuntu, Mint, etc.

I made the profile name changes as you wished. I still think release should be final and the current release profile feels more like "testing", but whatever. I am happy that Helix now ships an even more performant binary 🚀️ and a well integrated Deb ❤️

I tested this latest build on Mint21 and it seams fine 👍️
If you are ok with it, merge away ^^

Choose a reason for hiding this comment

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

It looks like once Debian adds Helix, we might find ourselves back at square one for getting the latest version through Homebrew. Oh well! 🙄

Copy link
Contributor Author

@janos-r janos-r Jan 16, 2025

Choose a reason for hiding this comment

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

It looks like once Debian adds Helix, we might find ourselves back at square one for getting the latest version through Homebrew. Oh well! 🙄

I never used homebrew on linux and I don't plan on starting!
I really hope archseer keeps this DEB around while cargo-deb still works.
There is also the PPA maintained by Maveonair. It's just that Helix set a rust-version (in manifest) that is newer than LTS Ubuntu and so it can't be built anymore on launchepad. That was actually the cause that pushed me to make this DEB build. If Helix keeps a relatively old rust-version in the manifest, we could still get the package through the PPA.

Based on the suggestion from archseer, the release build will use opt.
The release profile will be separate for testing purposes.
@janos-r janos-r requested a review from archseer January 16, 2025 08:40
@the-mikedavis the-mikedavis added this to the 25.01.1 milestone Jan 16, 2025
@the-mikedavis the-mikedavis merged commit d4ee22b into helix-editor:master Jan 16, 2025
13 checks passed
@janos-r janos-r deleted the cargo-deb branch January 17, 2025 00:41
mmibbetson pushed a commit to mmibbetson/helix that referenced this pull request Jan 18, 2025
@Rudxain
Copy link
Contributor

Rudxain commented Jan 20, 2025

This issue might be relevant

rmburg pushed a commit to rmburg/helix that referenced this pull request Jan 20, 2025
nik-rev pushed a commit to nik-rev/helix that referenced this pull request Jan 24, 2025
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.

8 participants