Bug#1014996: [Pkg-rust-maintainers] Bug#1014996: librust-curl-sys-dev: has build loop with librust-curl-dev that causes rebuild delay when building against local debian source

2022-07-20 Thread Daniel Kahn Gillmor
Version: 0.4.49-2

On Mon 2022-07-18 16:49:07 +0200, Fabian Grünbichler wrote:
> On July 18, 2022 4:22 pm, Daniel Kahn Gillmor wrote:
>> On Mon 2022-07-18 14:50:50 +0200, Fabian Grünbichler wrote:
>>> but, we also patch out the println[1]. seems like that fixed version
>>> never got uploaded though - but that would likely fix it.
>> 
>> that would be great.  if i have time to do more work on debcargo in the
>> nearterm, i'll probably start by finalizing the -2 of curl-sys, but if
>> it takes me ~1 week to get to it, i'll just let you go forward with it
>> as part of your cargo/debcargo work.

I've pushed 0.4.49-2 of curl-sys, with the patched out println to avoid
the build loop.  i had to do a bit of fiddling to keep the binary
package names the same to avoid another trip through NEW (due to
#1001251) but hopefully that won't be too painful for the update you're
working on.

thanks for working on this and talking it through with me!

--dkg


signature.asc
Description: PGP signature


Bug#1014996: [Pkg-rust-maintainers] Bug#1014996: librust-curl-sys-dev: has build loop with librust-curl-dev that causes rebuild delay when building against local debian source

2022-07-18 Thread Fabian Grünbichler
On July 18, 2022 4:22 pm, Daniel Kahn Gillmor wrote:
> Hi Fabian--
> 
> On Mon 2022-07-18 14:50:50 +0200, Fabian Grünbichler wrote:
>> note that the rerun line upstream refers to the vendored copy of the 
>> curl library which is contained as a git submodule (and directory, in 
>> the published .crate file) - to pick up any changes made to the 
>> submodule during development.
>>
>> we do (obviously ;)) remove that directory in Debian[0], which then 
>> makes the reference to 'curl' point to the 'curl' crate.
> 
> Thanks for this explanation!  I didn't realize that the string "curl"
> would change its semantics in the context the deletion of the
> submodule/directory, but it makes sense now that you've explained it.

you made me take a closer look - what I wrote above is actually not 
quite true at all. if I replace the rerun-if-changed to point to another 
path that doesn't exist (e.g., 'foobar' instead of 'curl'), the same 
behaviour is obversable. so it's a 'rerun-if-changed' stanza pointing at 
a path that doesn't exist at all that is the problem - if we had 
replaced the curl dir with an empty one instead of replacing it 
altogether it would have worked without the patch ;) and indeed, a 
simple `mkdir /usr/share/cargo/registry/curl-sys-0.4.49/curl` also fixes 
the spurious rebuild.

>> but, we also patch out the println[1]. seems like that fixed version
>> never got uploaded though - but that would likely fix it.
> 
> that would be great.  if i have time to do more work on debcargo in the
> nearterm, i'll probably start by finalizing the -2 of curl-sys, but if
> it takes me ~1 week to get to it, i'll just let you go forward with it
> as part of your cargo/debcargo work.
> 
>> note that I am currently working on upgrading cargo/debcargo which will 
>> also entail updating curl-sys and curl, so if you want to wait for that 
>> (ETA ~1 week) instead of uploading the prepared -2 that should also fix 
>> it in due course, but I am happy to rebase on top of a finalized -2 
>> version as well :)
> 
> ok, thanks for doing this work, i really appreciate it!

it's sorely needed - I've already started hitting crates where our 
outdated cargo version (used by debcargo) makes packaging current 
versions of crates impossible, since their crates.io index entries are 
not understood, falling back to the last 'v1' one:

 https://github.com/rust-lang/crates.io-index/blob/master/li/bg/libgit2-sys

only versions up to 0.13.2+1.4.2 are visible to our cargo/debcargo 
(which is especially fun given that it's in the dep tree of the current 
cargo version ;)).

thankfully this only affects ~400 crates at the moment, of which only 
libgit2-sys, phf and rpassword are packaged in Debian.. but it will 
become more widespread as more upstream devs make use of the new cargo 
features.



Bug#1014996: [Pkg-rust-maintainers] Bug#1014996: librust-curl-sys-dev: has build loop with librust-curl-dev that causes rebuild delay when building against local debian source

2022-07-18 Thread Daniel Kahn Gillmor
Hi Fabian--

On Mon 2022-07-18 14:50:50 +0200, Fabian Grünbichler wrote:
> note that the rerun line upstream refers to the vendored copy of the 
> curl library which is contained as a git submodule (and directory, in 
> the published .crate file) - to pick up any changes made to the 
> submodule during development.
>
> we do (obviously ;)) remove that directory in Debian[0], which then 
> makes the reference to 'curl' point to the 'curl' crate.

Thanks for this explanation!  I didn't realize that the string "curl"
would change its semantics in the context the deletion of the
submodule/directory, but it makes sense now that you've explained it.

> but, we also patch out the println[1]. seems like that fixed version
> never got uploaded though - but that would likely fix it.

that would be great.  if i have time to do more work on debcargo in the
nearterm, i'll probably start by finalizing the -2 of curl-sys, but if
it takes me ~1 week to get to it, i'll just let you go forward with it
as part of your cargo/debcargo work.

> note that I am currently working on upgrading cargo/debcargo which will 
> also entail updating curl-sys and curl, so if you want to wait for that 
> (ETA ~1 week) instead of uploading the prepared -2 that should also fix 
> it in due course, but I am happy to rebase on top of a finalized -2 
> version as well :)

ok, thanks for doing this work, i really appreciate it!

--dkg


signature.asc
Description: PGP signature


Bug#1014996: [Pkg-rust-maintainers] Bug#1014996: librust-curl-sys-dev: has build loop with librust-curl-dev that causes rebuild delay when building against local debian source

2022-07-18 Thread Fabian Grünbichler
On July 15, 2022 10:59 pm, Daniel Kahn Gillmor wrote:
> Package: librust-curl-sys-dev
> Version: 0.4.49-1
> Control: affects -1 src:rust-debcargo librust-curl-dev
> 
> There's a build loop between librust-curl-dev and librust-curl-sys-dev
> in debian: when i "cargo build" anything that depends on the curl crate,
> it causes a rebuild of curl-sys, which in turn causes a rebuild of curl
> on the next build.  So "cargo build" always has to do more building than
> it should.
> 
> [.. reproducing instructions omitted..]
> 
> OTOH, if i remove the .cargo/config.toml (so that it pulls from
> crates.io directly) i do not see the rebuild happening for either curl
> or curl-sys.  subsequent "cargo build" operations just terminate
> cleanly, even if i pin the versions of curl and curl-sys in Cargo.toml.
> 
> This is likely related to "cargo:rerun-if-changed=curl" in build.rs for
> librust-curl-sys-dev (see
> https://github.com/alexcrichton/curl-rust/pull/407) but I don't
> understand it.
> 
> But when i asked on ##rust on libera's IRC service, folks there not
> using debian were unable to reproduce this problem.

note that the rerun line upstream refers to the vendored copy of the 
curl library which is contained as a git submodule (and directory, in 
the published .crate file) - to pick up any changes made to the 
submodule during development.

we do (obviously ;)) remove that directory in Debian[0], which then 
makes the reference to 'curl' point to the 'curl' crate. but, we also 
patch out the println[1]. seems like that fixed version never got 
uploaded though - but that would likely fix it.

note that I am currently working on upgrading cargo/debcargo which will 
also entail updating curl-sys and curl, so if you want to wait for that 
(ETA ~1 week) instead of uploading the prepared -2 that should also fix 
it in due course, but I am happy to rebase on top of a finalized -2 
version as well :)

0: 
https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/curl-sys/debian/debcargo.toml#L3
1: 
https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/curl-sys/debian/patches/avoid-spurious-rebuilds.patch