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

Helix 25.01 build fails on Ubuntu 24.04 LTS and older due to Rust Compiler version requirement #14

Open
maveonair opened this issue Jan 4, 2025 · 18 comments
Labels
wontfix This will not be worked on

Comments

@maveonair
Copy link
Owner

maveonair commented Jan 4, 2025

The build fails on Ubuntu 24.04 LTS (Noble) with the following error message:

error: package `helix-core v25.1.0 (/<<PKGBUILDDIR>>/helix-core)` cannot be built because it requires rustc 1.76 or newer, while the currently active rustc version is 1.75.0

Ubuntu 24.04 LTS provides rustc version 1.75.0, which does not meet the minimum requirement for building helix-core. However, the new version can be successfully built on Ubuntu 24.10, as it includes a newer version of rustc.

Source: https://launchpadlibrarian.net/768468469/buildlog_ubuntu-noble-amd64.helix_25.01-1~ubuntu24.04~ppa1_BUILDING.txt.gz

@maveonair maveonair changed the title Build Fails on Ubuntu 24.04 LTS and lower ue to Rust Version Requirement Build Fails on Ubuntu 24.04 LTS and lower due to Rust Version Requirement Jan 4, 2025
@maveonair maveonair changed the title Build Fails on Ubuntu 24.04 LTS and lower due to Rust Version Requirement Helix 25.01 build fails on Ubuntu 24.04 LTS and lower due to Rust Compiler version requirement Jan 4, 2025
@maveonair maveonair added the wontfix This will not be worked on label Jan 4, 2025
Repository owner deleted a comment from stappersg Jan 4, 2025
@maveonair maveonair changed the title Helix 25.01 build fails on Ubuntu 24.04 LTS and lower due to Rust Compiler version requirement Helix 25.01 build fails on Ubuntu 24.04 LTS and older due to Rust Compiler version requirement Jan 4, 2025
@maveonair
Copy link
Owner Author

I have submitted the Helix 25.01 package for Ubuntu 24.10 and it should be available via my PPA in the next few hours.

@janos-r
Copy link

janos-r commented Jan 5, 2025

I see 25.01 online on launchpad now.
I use Mint 21.3 (jammy). Would it be possible for you to publish 25.01 also on the jammy branch?
Tried switching the branch to Oracular manually on my end but it still kept back the 25.01 and in general this is not good practice on my side I think.

@maveonair
Copy link
Owner Author

I see 25.01 online on launchpad now. I use Mint 21.3 (jammy). Would it be possible for you to publish 25.01 also on the jammy branch? Tried switching the branch to Oracular manually on my end but it still kept back the 25.01 and in general this is not good practice on my side I think.

Jammy is Ubuntu 22.04, which also have the older Rust compilers and therefore do not work.

@WannesMalfait
Copy link

Is it not possible to install a newer version of the rust compiler in the build script? I'm also asking because I'm running on Pop!Os which is still on 22.04 (jammy).

In any case, thank you for maintaining this PPA, I understand it completely if maintaining too many versions is too much of a hassle.

@janos-r
Copy link

janos-r commented Jan 6, 2025

I never built a .deb before, but I looked into it just a little now... Shouldn't it be possible since rustc is only a build-dependency? If it is present on the local machine that builds it. Not sure if the path has to be reexported to the debian/rules file to find it.

@janos-r
Copy link

janos-r commented Jan 7, 2025

Or this could be a good option!
https://github.com/kornelski/cargo-deb
The assets section would just need to move the runtime and executable into /usr/lib/helix,
and put that custom

#!/usr/bin/env sh
HELIX_RUNTIME=/usr/lib/helix/runtime exec /usr/lib/helix/hx "$@"

into /usr/bin just as it's now. That was well done I think.
I didn't test it yet myself, but maybe I will get around to it. But seams almost too easy to be true 🤔️

@maveonair
Copy link
Owner Author

maveonair commented Jan 7, 2025

@janos-r The PPA relies on the Launchpad CI/CD infrastructure to build and provide the Debian package for every Ubuntu version. During this process, it installs dependencies from the control file. However, older Ubuntu versions (before 24.10) have an incompatible Rust compiler version with Helix 25.01.

Building the package manually is possible, but I can’t provide it via the PPA as outlined.

@janos-r
Copy link

janos-r commented Jan 8, 2025

I proposed a PR for generating a .deb to the helix repo.
If it gets approved, cargo-deb and the generation command could be added to the CI workflow.
That way the .deb could be available automatically on every release 🚀️
helix-editor/helix#12453

It is not as nice as a PPA, but as you said, PPAs are built directly on Launchpad, I had no idea. That makes PPAs for Helix almost useless with that high rustc version.

@maveonair
Copy link
Owner Author

I proposed a PR for generating a .deb to the helix repo. If it gets approved, cargo-deb and the generation command could be added to the CI workflow. That way the .deb could be available automatically on every release 🚀️ helix-editor/helix#12453

It is not as nice as a PPA, but as you said, PPAs are built directly on Launchpad, I had no idea. That makes PPAs for Helix almost useless with that high rustc version.

Thanks so much for this awesome contribution to Helix!!

I just wanted to share my thoughts on the PPA. I don’t think it’s useless since most users probably aren’t interested in building the package themselves. The PPA gives them an easy way to install the latest Helix version for their Ubuntu version without much hassle.

This is similar to what we see with other tools like Neovim. Not every distro gets the latest version due to missing dependencies, but having a PPA makes it easier for users to stay up to date.

For example, while Helix 25.01 isn’t available for Ubuntu 24.04, it is for 24.10, and I plan to keep providing packages for newer Ubuntu releases.

Thanks again for your work - it really helps make Helix better for everyone!

@janos-r
Copy link

janos-r commented Jan 10, 2025

If helix continues to use the rust-version flag, it will always be too new for LTS distros. And I would guess that those are the far majority of PPA users. This flag forces the compiler to use the exact version and so it should remain a relatively recent one, to not have a too old compiler as well. It is very unfortunate but I guess there is not a better way how to set a minimal compiler version currently, or at least I don't know.

With this PPA, currently at least the latest interim ubuntu release and debian sid are covered. But I don't think many people are using those. Non the less you deserve all the respect for maintaining this ppa up till now and into the future!

Of course nobody wants to download a deb manually every release. But there is otherwise currently no package for the far majority of debian/ubuntu based distros. At least helix doesn't release very often.
We can only hope some better solution will come in the future. Eventually helix could maintain their own repo somewhere to source from.

@maveonair
Copy link
Owner Author

maveonair commented Jan 10, 2025

If helix continues to use the rust-version flag, it will always be too new for LTS distros. And I would guess that those are the far majority of PPA users. This flag forces the compiler to use the exact version and so it should remain a relatively recent one, to not have a too old compiler as well. It is very unfortunate but I guess there is not a better way how to set a minimal compiler version currently, or at least I don't know.

With this PPA, currently at least the latest interim ubuntu release and debian sid are covered. But I don't think many people are using those. Non the less you deserve all the respect for maintaining this ppa up till now and into the future!

Of course nobody wants to download a deb manually every release. But there is otherwise currently no package for the far majority of debian/ubuntu based distros. At least helix doesn't release very often. We can only hope some better solution will come in the future. Eventually helix could maintain their own repo somewhere to source from.

Helix does indeed always use the Rust version flag, and since starting this PPA, this is only the second time that a newer version couldn’t be built on an older LTS version. That said, most of last year’s releases were successfully built across a variety of Ubuntu versions.

If every new Helix version starts requiring a newer Rust compiler version, then you’re absolutely right - the PPA might lose its usefulness. However, I’d prefer to cross that bridge when we get there rather than abandon it prematurely.

And yes, it would be great if the Helix team could provide the Debian package with its own repository :)! Maybe something we could propose with your newest contribution to build the Debian package?

@janos-r
Copy link

janos-r commented Jan 10, 2025

An hour ago I finished the PR with an updated workflow and fixed an old bug that prevented workflows triggered from PRs to finish. I hope it gets accepted soon ^^

@gzmorell
Copy link

gzmorell commented Jan 29, 2025

Hi, rustc-1.76 to rustc-1.80 and cargo-1.76 to cargo-1.80 are available in noble-updates repo. I do not know if these can be used to build the PPA package.
The binaries are named as rustc-1.76 and cargo-1.76.

@maveonair
Copy link
Owner Author

Hi, rustc-1.76 to rustc-1.80 and cargo-1.76 to cargo-1.80 are available in noble-updates repo. I do not know if these can be used to build the PPA package. The binaries are named as rustc-1.76 and cargo-1.76.

Are you sure? I still get version 1.75.0 after an apt update

maveonair@ubuntu:~$ apt info rustc
Package: rustc
Version: 1.75.0+dfsg0ubuntu1-0ubuntu7.1

@gzmorell
Copy link

gzmorell commented Jan 30, 2025

Hi, rustc-1.76 to rustc-1.80 and cargo-1.76 to cargo-1.80 are available in noble-updates repo. I do not know if these can be used to build the PPA package. The binaries are named as rustc-1.76 and cargo-1.76.

Are you sure? I still get version 1.75.0 after an apt update

maveonair@ubuntu:~$ apt info rustc
Package: rustc
Version: 1.75.0+dfsg0ubuntu1-0ubuntu7.1

I have enabled "noble-updates", "noble-backports" and "noble-security" in sources.list
I can see this

`
~ apt search rustc-

rustc-1.76/noble-updates,noble-security,now 1.76.0+dfsg0ubuntu1-0ubuntu0.24.04 amd64 [installed]
Rust systems programming language
rustc-1.77/noble-updates,noble-security 1.77.2+dfsg1ubuntu1-0ubuntu0.24.04 amd64
Rust systems programming language
rustc-1.78/noble-updates,noble-security 1.78.0+dfsg1ubuntu1-0ubuntu0.24.04 amd64
Rust systems programming language
rustc-1.79/noble-updates,noble-security 1.79.0+dfsg1ubuntu1-0ubuntu0.24.04 amd64
Rust systems programming language
rustc-1.80/noble-updates,noble-security 1.80.1+dfsg0ubuntu1-0ubuntu0.24.04 amd64
Rust systems programming language
`

Here is the link to the rustc 1.76 package for noble
rustc 1.76

@maveonair
Copy link
Owner Author

It seems like this might not work as expected. If you install rustc-1.76, the binary will be located at /usr/bin/rustc-1.76. However, cargo expects the binary to be at /usr/bin/rustc. This should also work for newer Ubuntu versions.

@gzmorell
Copy link

gzmorell commented Jan 31, 2025

Hi I have managed to build your package for helix version 25.01.1 in ubuntu noble.
For this to happen I have installed cargo-1.76 and rustc-1.76 and applied the next patch to your repo files:

diff --git a/build.py b/build.py
index a43602a..6e716b3 100755
--- a/build.py
+++ b/build.py
@@ -75,7 +75,7 @@ def create_cargo_vendor_archive(
 ) -> None:
     with chdir(source_directory_path):
         print("-> Run cargo vendor...")
-        subprocess.check_call(["cargo", "vendor"])
+        subprocess.check_call(["cargo-1.76", "vendor"])

         tar_file_path = os.path.join(destination_directory_path, "vendor.tar.xz")
         print(f"-> Create {tar_file_path}...")
diff --git a/debian/control b/debian/control
index 0fca14a..9be6c67 100644
--- a/debian/control
+++ b/debian/control
@@ -3,11 +3,11 @@ Section: editors
 Priority: optional
 Maintainer: Fabian Mettler <[email protected]>
 Build-Depends:
- cargo,
+ cargo-1.76,
  debhelper (>= 12),
  g++,
  git,
- rustc,
+ rustc-1.76,
 Standards-Version: 4.5.1
 Homepage: https://github.com/helix-editor/helix

diff --git a/debian/rules b/debian/rules
index b53fbf9..7f05ea1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,7 +4,7 @@
        dh $@

 override_dh_auto_clean:
-       cargo clean
+       cargo-1.76 clean
        rm -rf .cargo vendor

 override_dh_auto_build:
@@ -12,7 +12,7 @@ override_dh_auto_build:
        cp debian/cargo.config .cargo/config.toml
        tar xJf debian/vendor.tar.xz
        export HELIX_DEFAULT_RUNTIME=/usr/lib/helix/runtime
-       cargo build --locked --offline --profile opt
+       cargo-1.76 build --locked --offline --profile opt

 #cleanup grammar sources
        rm -rf ./runtime/grammars/sources

As I understand this is not a good solution, as this way your files depends on cargo-1.76 and rustc-1.76 which can not be available in other ubuntu releases.
I have no idea if this can be of any help.
Thanks

@maveonair
Copy link
Owner Author

Thanks for trying out. This is what I meant about the special “workaround” for Ubuntu 24.04 Noble. Although, we could try adding a shell script that detects the Cargo version needed during the build phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants