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

cargo supposedly not installed while being installed #11

Closed
Artim96 opened this issue Jun 3, 2024 · 10 comments
Closed

cargo supposedly not installed while being installed #11

Artim96 opened this issue Jun 3, 2024 · 10 comments

Comments

@Artim96
Copy link

Artim96 commented Jun 3, 2024

I've installed the rust toolchain 1.78 with rustup. But gdb buildpackage for some reason refuses to find cargo:

gbp:info: Extracting 'vaultwarden_1.30.5.orig.tar.gz' to '/opt/vaultwarden-deb/vaultwarden-tmp'
gbp:info: Exporting 'HEAD' to '/opt/vaultwarden-deb/vaultwarden-tmp'
gbp:info: Moving '/opt/vaultwarden-deb/vaultwarden-tmp' to '/opt/vaultwarden-deb/vaultwarden-1.30.5'
gbp:info: Performing the build
 dpkg-buildpackage -us -uc -ui -i -I
dpkg-buildpackage: Information: Source package vaultwarden
dpkg-buildpackage: Information: Source version 1.30.5-1
dpkg-buildpackage: Information: source distribution unstable
dpkg-buildpackage: Information: Source changed by dionysius <[email protected]>
 dpkg-source -i -I --before-build .
dpkg-buildpackage: Information: host architecture amd64
dpkg-source: Information: Options from vaultwarden-1.30.5/debian/source/options are used: --extend-diff-ignore=(^|/)(.github|LICENSE|README|signing-key)
dpkg-checkbuilddeps: Error: Unfulfilled build dependencies: cargo
dpkg-buildpackage: Warning: Build dependencies/conflicts not fulfilled; abort
dpkg-buildpackage: Warning: (Use -d to override.)
debuild: fatal error at line 1184:
dpkg-buildpackage -us -uc -ui -i -I failed
gbp:error: 'debuild -i -I' failed: it exited with 29

But

cargo -V
cargo 1.78.0 (54d8815d0 2024-03-26)
which cargo
/usr/bin/cargo

So what exactly is it complaining about?

@dionysius
Copy link
Owner

dionysius commented Jun 3, 2024

Unfortunately https://github.com/dionysius/vaultwarden-deb/blob/main/debian/control#L4 looks for a cargo package installed. e.g. dpkg -l | grep cargo should list it. I haven't figured out a way to make this optional as there is no rustup package in debian.

You have 3 options:

  • use gbp buildpackage -d ... to ignore build-depends
  • install cargo from your apt sources but still use rustup toolchain install <version> as described in the readme. It should pick your rustup version when building
  • remove cargo from build-depends in said file and make a temporary git commit before building

dionysius added a commit that referenced this issue Jun 3, 2024
…e buildpackage option -d to ignore all build-depends #11
@dionysius
Copy link
Owner

Updated and explained the first option (using -d) in the readme

@dionysius
Copy link
Owner

After that you will run into #12. Just tested the building locally

@Artim96
Copy link
Author

Artim96 commented Jun 3, 2024

Unfortunately https://github.com/dionysius/vaultwarden-deb/blob/main/debian/control#L4 looks for a cargo package installed. e.g. dpkg -l | grep cargo should list it. I haven't figured out a way to make this optional as there is no rustup package in debian.

You have 3 options:

  • use gbp buildpackage -d ... to ignore build-depends
  • install cargo from your apt sources but still use rustup toolchain install <version> as described in the readme. It should pick your rustup version when building
  • remove cargo from build-depends in said file and make a temporary git commit before building

I'll try that. But actually, rustup has been introduced to Debian, although it's only to be included in Trixie. That's how I installed it, as the first time I tried to run it, it complained that some dependency needs rustc 1.64, while stable only has 1.63 without any backports. On Testing it then claimed another dependency needed rustc 1.78, so I installed rustup there and tried again with that, running into this issue.

@Artim96
Copy link
Author

Artim96 commented Jun 3, 2024

After that you will run into #12. Just tested the building locally

true

@dionysius
Copy link
Owner

dionysius commented Jun 3, 2024

You are right, it's currently in testing: https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=rustup. So I will have options in the future to make this a bit smarter once it hits stable.

For now, this issue is solved and the package works as intended. The important bits have been documented in the readme. Lets head over to #12, I'll look into it.

@Artim96
Copy link
Author

Artim96 commented Jun 3, 2024

Actually, installing cargo won't be an option anymore in Testing/Trixie once it hits stable. cargo has a fixed dependency on rustc, which in turn will mark rustup to be removed:

Error: Conflict: -> cargo:amd64=1.74.1+dfsg1-1 but rustup:amd64 -> rustup:amd64=1.26.0-6 -> not cargo:amd64=1.74.1+dfsg1-1

Just as a FYI.

@dionysius
Copy link
Owner

Thank you, will keep in mind. Will be fun when ubuntu and debian are out of sync again package wise. I can use the or operator | in build-depends which might suffice. For now i this source package must run for debian stable or ubuntu lts at least.

@dionysius
Copy link
Owner

dionysius commented Jun 3, 2024

Yep as hoped and expected Build-Depends: rustup | cargo works like a charm. Now you don't need -d anymore in buildpackage. Tested on trixie and booworm. See/use branch main or tag debian/1.30.5-3

@Artim96
Copy link
Author

Artim96 commented Jun 3, 2024

Yes, that does help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants