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

Make and Distribute Debian Package #36

Open
Miserlou opened this issue Sep 19, 2018 · 12 comments
Open

Make and Distribute Debian Package #36

Miserlou opened this issue Sep 19, 2018 · 12 comments

Comments

@Miserlou
Copy link
Owner

Miserlou commented Sep 19, 2018

I want loop to be in Debian and Ubuntu! Let's make that happen!

Required first:

@dawidd6
Copy link

dawidd6 commented Sep 20, 2018

First it would be nice to make a git tag.

Here are resources on packaging rust programs for debian: https://wiki.debian.org/Teams/RustPackaging/Policy

One need to also package dependencies if there are not already in unstable repository.

Once program gets to debian, it should be automatically synced to ubuntu and available in next release.

@Miserlou
Copy link
Owner Author

Yep, I think having a stable version would be required first (so getting #16 implemented), but I just wanted to get the ball rolling as I figured this would be a fairly long and involved process. Our Rust dependencies aren't huge, but enough that there might be some work there (or we could vendor them since they're really small and single-use.) I'll reach out to the Rust team soon.

@infinity0
Copy link

There's not much spare capacity in the team atm to package other programs but you're welcome to do your own package, clone https://salsa.debian.org/rust-team/debcargo-conf/ and follow the instructions in the README.

It's much simpler than other Debian packages, we've automated away most of the process you'll read from the usual Debian Maintainers' Guide.

@kpcyrd
Copy link
Contributor

kpcyrd commented Sep 21, 2018

This is the current state of master (cargo-debstatus output):

loop-rs v0.3.5
├── humantime v1.1.1 (in debian)
├── isatty v0.1.9 (outdated)
│   ├── cfg-if v0.1.5 (in debian)
│   ├── libc v0.2.43 (in debian)
│   ├── redox_syscall v0.1.40 (in debian)
│   └── winapi v0.3.6 (in debian)
├── regex v1.0.5 (in debian)
├── structopt v0.2.10 (in debian)
├── subprocess v0.1.14
│   ├── crossbeam v0.2.12 (outdated)
│   ├── kernel32-sys v0.2.2
│   │   ├── winapi v0.2.8 (outdated)
│   │   └── winapi-build v0.1.1 (in debian)
│   ├── libc v0.2.43 (in debian)
│   └── winapi v0.2.8 (outdated)
└── tempfile v3.0.4 (in debian)

In other words, you would need to help port subprocess to winapi 0.3 (this makes kernel32-sys obsolete) and bump their crossbeam dependency. You also need to update your isatty dependency.

@Miserlou
Copy link
Owner Author

That's actually a lot better than I was anticipating! Nice!

Thanks for doing that! Do you want to send a PR with those updated deps?

@kpcyrd
Copy link
Contributor

kpcyrd commented Sep 21, 2018

@Miserlou I usually don't do this to avoid an expectation that the debian rust team is taking care of things like this, but I filed #37 since it's a simple change. I haven't looked into subprocess yet, you can't fix this from inside loop but you would need to get the subprocess crate to fix this and release an update.

@Miserlou
Copy link
Owner Author

Cool, I've submitted an upstream PR.

However, this is only for winapi anyway - we don't need that on Debian anyway! Can we use something like [target.'cfg(windows)'.dependencies] to avoid this while building the deb package?

@Miserlou
Copy link
Owner Author

Okay, subprocess is updated!

@kpcyrd
Copy link
Contributor

kpcyrd commented Sep 22, 2018

@Miserlou there are some instructions over here how you would setup a packaging environment: https://salsa.debian.org/rust-team/debcargo-conf. The instructions might appear slightly scary, but are actually really nice to work with and you can basically follow them top to bottom. You probably want to join oftc/#debian-rust in case you run into any issues.

You would run ./new-package.sh subprocess, fix the todos in src/subprocess/debian that is created afterwards and run ./release.sh subprocess. After that, cd build; ./build.sh subprocess. That's going to build the package and run a lintian test. If that works (ignore warnings for now), push the repo somewhere we can pull from.

The debian-rust team is really small so we're trying to get more people involved and usually follow the "if you want something in debian, package it yourself" rule. :) That's how I joined the team as well (still working on my dependencies though).

@Miserlou
Copy link
Owner Author

Miserlou commented Sep 22, 2018 via email

@infinity0
Copy link

However, this is only for winapi anyway - we don't need that on Debian anyway! Can we use something like [target.'cfg(windows)'.dependencies] to avoid this while building the deb package?

This unfortunately is not possible due to rust-lang/cargo#5896, Cargo requires the presence of winapi even on non-windows platforms.

However it might work to write a trivial Debian-specific patch to have subprocess instead declare a depends on winapi 0.3 rather than 0.2. This would break if you actually try it, but we never do on that in Debian. Note that [target.'cfg(windows)'.dependencies] is still necessary in this case.

@ItzSwirlz
Copy link

Hey everyone. I do plan to package this, however the dependencies are out of date.

I am sadly new to rust and can't deal with things this complicated, but the main issue I see is with humantime in the code with parse_duration.

Anyways, the new dependency versions should be:
structopt 0.3.20
humantime 2.0.0
subprocess 0.2.4

I have packaging ready, but debcargo/dependency chains wont work until these are fixed.

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

5 participants