Your message dated Wed, 20 Jul 2022 14:05:19 -0400
with message-id <[email protected]>
and subject line Re: [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
has caused the Debian Bug report #1014996,
regarding librust-curl-sys-dev: has build loop with librust-curl-dev that 
causes rebuild delay when building against local debian source
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1014996: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1014996
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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.

For a project like debcargo, which depends on curl and curl-sys further
down in the dependency stack, this means that all these crates get
rebuilt each "cargo build":

   curl-sys v0.4.49+curl-7.79.1
   curl v0.4.39
   cargo v0.57.0
   git2-curl v0.14.1
   crates-io

This happens only when I'm building a rust project against the local
debian source packages (if i use crates.io directly, the second rebuild
doesn't happen).  I want to build this way instead of against crates.io
because i want to ensure that things work when built for debian (i ran
into this working on debcargo itself).

I've posted a simple, minimal reproducer at
https://github.com/dkg/rust-curl-cycle if it helps.

In order to use the local debian packages instead of crates.io, it
contains this .cargo/config.toml :


--------
# Use the local debian packages instead of crates.io:
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'

[source.vendored-sources]
directory = '/usr/share/cargo/registry'
--------

Here's Cargo.toml:

------
[package]
name = "curl-cycles"
version = "0.0.1"
authors = [
 "Daniel Kahn Gillmor <[email protected]>",
]
license = "MIT/Apache-2.0"
description = "Testing Curl Cycles."
edition = "2021"

[dependencies]
curl = "0.4.39"
------

and here's src/bin/cycles.rs:

-----
fn main() {
    println!("hello world");
    std::process::exit(0);
}
-----

that's all the source.

Here's my attempt to rebuild twice:

-----
0 dkg@alice:~/src/rust/curl-cycle$ cargo clean
0 dkg@alice:~/src/rust/curl-cycle$ cargo build
   Compiling pkg-config v0.3.21
   Compiling cc v1.0.71
   Compiling autocfg v1.1.0
   Compiling libc v0.2.126
   Compiling curl v0.4.39
   Compiling openssl-probe v0.1.2
   Compiling openssl-sys v0.9.67
   Compiling curl-sys v0.4.49+curl-7.79.1
   Compiling socket2 v0.4.4
   Compiling curl-cycles v0.0.1 (/home/dkg/src/rust/curl-cycle)
    Finished dev [unoptimized + debuginfo] target(s) in 9.64s
0 dkg@alice:~/src/rust/curl-cycle$ cargo build
   Compiling curl-sys v0.4.49+curl-7.79.1
   Compiling curl v0.4.39
   Compiling curl-cycles v0.0.1 (/home/dkg/src/rust/curl-cycle)
    Finished dev [unoptimized + debuginfo] target(s) in 2.45s
0 dkg@alice:~/src/rust/curl-cycle$
-------

You can see that curl-sys and curl both get rebuilt unnecessarily.

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.

      --dkg

PS i'm raising this issue because it consumes over 3 minutes of CPU time
   just to try to rebuild debcargo after making a single change because
   of the dep tree described at the top here.  that makes it very
   difficult to experiment easily.

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
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

Attachment: signature.asc
Description: PGP signature


--- End Message ---

Reply via email to