Closed dankamongmen closed 3 years ago
This ought be a good bit easier now that we've accepted a multistage build (since moving Python out of the CMake run). We ought just be able to do standard packaging, along with some CFLAGS
and LFLAGS
.
I've got the package building now in debcargo-conf
. I need to file an ITP bug about packaging these up.
DBTS 972542 filed for the ITP. debian/changelog
updated with appropriate Closes:
entry.
It looks like we might need package up a dependency or two:
[schwarzgerat](0) $ sudo ../build.sh libnotcurses-sys
Updating crates.io index
Downloaded libnotcurses-sys v2.0.1
Downloaded 1 crate (23.2 KB) in 0.21s
dpkg-checkbuilddeps: error: Unmet build dependencies: librust-cstr-core-0.2+default-dev (>= 0.2.1-~~) librust-cty-0.2+default-dev (>= 0.2.1-~~) librust-libc-0.2-dev (>= 0.2.76-~~) librust-libc-print-0.1+default-dev (>= 0.1.13-~~)
../build.sh: abort: Missing build-dependencies, but maybe try '{apt,cargo} update'
[schwarzgerat](1) $
cstr-core
cty
i'm not sure exactly what's up with the libc
bit. @joseluis , do you have any insight into this? no worries if not!
Crates libc
and libc-print
are used in libnotcurses-sys. The latter is merely used to print out the notcurses version without resorting to the standard library, so that thre crate can be no_std
. But if the dependencies turns out to be a PITA for packaging we may rethink it.
These are the only usages ATM (probably more when I get to finish the bindings):
src/cells.rs
261: unsafe { libc::strdup(nc::cell_extended_gcluster(plane, cell)) } as i32 as u32,
src/lib.rs
45: use libc_print::*;
59: libc_println!("rust-bound notcurses v{}", r_str);
66: let _ = libc::setlocale(libc::LC_ALL, CString::new("").unwrap().as_ptr());
86: let _ = libc::setlocale(libc::LC_ALL, CString::new("").unwrap().as_ptr());
The actual technical part of packaging up the dependencies isn't that much of a PITA, but the social component of getting them through Debian can be. With that said, the Debian Rust team seems a good bunch of people. Let me see what I can do; keep using your preferred technical solution for now. =]
OK, this week I think I'm gonna try to get the rust deps packaged up and submitted. Do you know off the top of your head if any of these four are dependent on any others within the set?
libc & cty don't depend on anything libc-print depends on libc cstr_core depends on cty and memchr...
here you can see the dependencies of specific crates, e.g.: https://crates.io/crates/cstr_core
BTW take a look at this: https://packages.debian.org/buster/librust-memchr+libc-dev depends on missing librust-libc-0.2-dev instead of https://packages.debian.org/buster/librust-libc-dev which and I don't know why your packages also reference the former name which includes the version...
In theory only librust-libc-print-dev, librust-cty-dev, and librust-cstr-core-dev should be needed, since it seems you can create packages without providing packages for its dependencies?
https://packages.debian.org/buster/librust-memchr+libc-dev depends on missing librust-libc-0.2-dev instead of https://packages.debian.org/buster/librust-libc-dev which and I don't know why your packages also reference the former name which includes the version...
librust-libc-0.2-dev
is a virtual package Provided by librust-libc-dev
:
[schwarzgerat](0) $ apt show librust-libc-0.2-dev
Package: librust-libc-0.2-dev
State: not a real package (virtual)
N: Can't select candidate version from package librust-libc-0.2-dev as it has no candidate
N: Can't select versions from package 'librust-libc-0.2-dev' as it is purely virtual
N: No packages found
[schwarzgerat](0) $ aptitude
[schwarzgerat](0) $ apt show librust-libc-dev
Package: librust-libc-dev
Version: 0.2.73-1
Priority: optional
Section: rust
Source: rust-libc
Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Installed-Size: 2,873 kB
Provides: librust-libc+align-dev (= 0.2.73-1), librust-libc+const-extern-fn-dev (= 0.2.73-1), librust-libc+default-dev (= 0.2.73-1), librust-libc+extra-traits-dev (= 0.2.73-1), librust-libc+std-dev (= 0.2.73-1), librust-libc+use-std-dev (= 0.2.73-1), librust-libc-0+align-dev (= 0.2.73-1), librust-libc-0+const-extern-fn-dev (= 0.2.73-1), librust-libc-0+default-dev (= 0.2.73-1), librust-libc-0+extra-traits-dev (= 0.2.73-1), librust-libc-0+std-dev (= 0.2.73-1), librust-libc-0+use-std-dev (= 0.2.73-1), librust-libc-0-dev (= 0.2.73-1), librust-libc-0.2+align-dev (= 0.2.73-1), librust-libc-0.2+const-extern-fn-dev (= 0.2.73-1), librust-libc-0.2+default-dev (= 0.2.73-1), librust-libc-0.2+extra-traits-dev (= 0.2.73-1), librust-libc-0.2+std-dev (= 0.2.73-1), librust-libc-0.2+use-std-dev (= 0.2.73-1), librust-libc-0.2-dev (= 0.2.73-1), librust-libc-0.2.73+align-dev (= 0.2.73-1), librust-libc-0.2.73+const-extern-fn-dev (= 0.2.73-1), librust-libc-0.2.73+default-dev (= 0.2.73-1), librust-libc-0.2.73+extra-traits-dev (= 0.2.73-1), librust-libc-0.2.73+std-dev (= 0.2.73-1), librust-libc-0.2.73+use-std-dev (= 0.2.73-1), librust-libc-0.2.73-dev (= 0.2.73-1)
Suggests: librust-libc+rustc-dep-of-std-dev (= 0.2.73-1), librust-libc+rustc-std-workspace-core-dev (= 0.2.73-1)
Homepage: https://github.com/rust-lang/libc
Download-Size: 199 kB
APT-Manual-Installed: yes
APT-Sources: http://ftp.us.debian.org/debian unstable/main amd64 Packages
Description: Rust bindings to libc - Rust source code
This package contains the source for the Rust libc crate, packaged by debcargo
for use with cargo and dh-cargo.
[schwarzgerat](0) $
I'm filing an ITP on rust-libc-print
now, and have a package ready to go.
See #1119 -- we no longer need libc_print
nor cstr_core
. So I think only cty
remains?
Well, libc_print
has finally been merged anyway, heh. =]
So we're just looking for cty
? If so, I'll move on packaging that ASAP. It would be great to have our rust package in the next Debian release, but that requires it to be done this year.
binary:librust-libc-print-dev is NEW.
binary:librust-libc-print-dev is NEW.
source:rust-libc-print is NEW.
Your package has been put into the NEW queue, which requires manual action
from the ftpteam to process. The upload was otherwise valid (it had a good
OpenPGP signature and file hashes are valid), so please be patient.
Packages are routinely processed through to the archive, and do feel
free to browse the NEW queue[1].
If there is an issue with the upload, you will receive an email from a
member of the ftpteam.
If you have any questions, you may reply to this email.
Yeah, I don't like to depend on it just fot the C type aliases for use with bindgen but it seems it has to be that way. It seems it doesn't work as a build-dependency like bindgen, so it must be a normal dependency.
There are plans to include it as part of libc in the future, but for now it is how it is.
The whole library is very tiny, we could also embed it.
I'd rather not have to track changes upstream, and Debian/Fedora would also throw a fit (this is called "vendoring", and very strongly frowned upon). It isn't too difficult to add another rust package to Debian now that I've done one, and Fedora is working on a whole rust scheme that is not yet settled AFAICT.
btw, i'm gonna be completely straight up here: i doubt that i'll be in a position to package up the rust bindings for all the distros where i manage notcurses packages, simply because rust is being handled wildly differently by different distros, and i'm not of the mood to learn FooBarQuxx Super Awesome Penguin Linux's rust techniques. the general trend seems to be towards simply submitting a crate, and having automatic packaging generated from it -- those i can obviously handle. i volunteered to package alacritty for Fedora, and had to abandon the effort, due to the difficulty of getting rust packaged up there right now. :/
To be honest I wouldn't worry very much about packaging the rust bindings... The most important thing is to package the C library...
Correct me if I'm wrong but I believe having the packages would only be useful for redistributing binaries built with Rust that have a dynamic dependency on libnotcurses-sys? So Rust programs statically linked wouldn't be affected?... Rust statically links everything (except glibc) by default....
Correct me if I'm wrong but I believe having the packages would only be useful for redistributing binaries built with Rust that have a dynamic dependency on libnotcurses-sys? So Rust programs statically linked wouldn't be affected?... Rust statically links everything (except glibc) by default....
it is necessary for including anything using libnotcurses-sys into distros like Fedora and Debian, where you are neither allowed to vendor dependencies into your source package, nor to download things at buildtime. yes, this works very much against the workflow of recent languages like Go and Rust.
Very interesting info. Then maybe supporting Debian and Fedora may be enough for now.
We're now at:
dpkg-source --after-build .
dpkg-buildpackage: info: full upload (original source is included)
dpkg-checkbuilddeps: error: Unmet build dependencies: librust-bindgen+default-dev (>= 0.56-~~) librust-cty-0.2+default-dev (>= 0.2.1-~~) librust-pkg-config-0.3+default-dev (>= 0.3.19-~~)
./build.sh: abort: Missing build-dependencies, but maybe try '{apt,cargo} update'
[schwarzgerat](1) $
looks like Debian has pkg-config 3.18; I'll submit an update. likewise, they have bindgen at 0.55. update time. and i need to get that cty
package in, hopefully easy. if i can get this done this month, we'll be in debian 11.
https://salsa.debian.org/rust-team/debcargo-conf/-/merge_requests/147
cty
has been added to debian =]
Hey @joseluis , we're getting some pushback on the upgrade of bindgen and pkg-config. Do you know for sure that we need the absolute newest versions? Debian ships 0.55.1 bindgen and 0.3.18 pkg-config.
We can use the previous ones for sure. Sorry, I'm used to upgrading to the latest versions as a reflex but I didn't take packaging into account. It is Ok to downgrade them.
We can use the previous ones for sure. Sorry, I'm used to upgrading to the latest versions as a reflex but I didn't take packaging into account. It is Ok to downgrade them.
no problem, sweet! we might very well find ourselves a debian rust package very soon, and i suspect that will be a strong positioning for the future.
I'm gonna try to complete the unit tests because there are several things that aren't working for me from rust, or maybe I don't understand them well yet... I'll probably have to ask you for some more of your knowledge in the next few days.
Thanks for the quick change, @joseluis . I think we'll be able to package these up with 2.0.9/2.1.0.
rust-cty passed FTPMaster approval and entered Debian Unstable yesterday evening. I'm going to test packaging of rust-notcurses 2.0.9, which i suspect will work. at that point, we can submit rust-notcurses to NEW.
@joseluis i know you've done a ton of work on rust recently. would you like me to hold off to 2.0.1x/2.1.0 before submitting?
I'm seeing one failure and a number of warnings. The failure arises from a missing build/stdout.c
. I indeed do not see a .c file in the temporary build directory, but that could be arising from the debian tools. There's also a bunch of warnings from the actual bindgen run. @joseluis , if this looks like a debian thing, let me know and I'll circle around on it.
With #101 complete and #320 hot on the docket, we'll soon want to be building Debian crates. Once more into the big shitty breach! hax0rs ahoy