diff -Nru rust-version-sync-0.9.5/debian/changelog rust-version-sync-0.9.5/debian/changelog --- rust-version-sync-0.9.5/debian/changelog 2023-10-16 20:25:04.000000000 +0000 +++ rust-version-sync-0.9.5/debian/changelog 2024-01-23 16:15:06.000000000 +0000 @@ -1,3 +1,14 @@ +rust-version-sync (0.9.5-3) unstable; urgency=medium + + * drop patch 2001, obsoleted by Debian package changes + * add patch 1001 to accept newer branch of toml; + relax (build-)dependency for crate toml; + closes: bug#1061374, thanks to Peter Green + * update dh-cargo fork + * update copyright info: update coverage + + -- Jonas Smedegaard Tue, 23 Jan 2024 17:15:06 +0100 + rust-version-sync (0.9.5-2) unstable; urgency=medium * fix: bump (build-)dependency for crate toml diff -Nru rust-version-sync-0.9.5/debian/control rust-version-sync-0.9.5/debian/control --- rust-version-sync-0.9.5/debian/control 2023-10-16 20:24:34.000000000 +0000 +++ rust-version-sync-0.9.5/debian/control 2024-01-23 16:11:24.000000000 +0000 @@ -13,7 +13,7 @@ librust-syn-2+parsing-dev , librust-syn-2+printing-dev , librust-tempfile-3+default-dev , - librust-toml-0.7+default-dev , + librust-toml-dev (<< 0.9) , librust-url-2+default-dev , libstring-shellquote-perl, Maintainer: Jonas Smedegaard @@ -35,7 +35,7 @@ librust-syn-2+full-dev, librust-syn-2+parsing-dev, librust-syn-2+printing-dev, - librust-toml-0.7+default-dev, + librust-toml-dev (<< 0.9), librust-url-2+default-dev, ${misc:Depends}, Provides: diff -Nru rust-version-sync-0.9.5/debian/copyright rust-version-sync-0.9.5/debian/copyright --- rust-version-sync-0.9.5/debian/copyright 2023-10-16 16:27:30.000000000 +0000 +++ rust-version-sync-0.9.5/debian/copyright 2024-01-23 16:14:25.000000000 +0000 @@ -17,7 +17,7 @@ Files: debian/* Copyright: - 2022-2023 Jonas Smedegaard + 2022-2024 Jonas Smedegaard License-Grant: This packaging is free software: you can redistribute it and/or modify it diff -Nru rust-version-sync-0.9.5/debian/copyright_hints rust-version-sync-0.9.5/debian/copyright_hints --- rust-version-sync-0.9.5/debian/copyright_hints 2023-10-16 16:35:08.000000000 +0000 +++ rust-version-sync-0.9.5/debian/copyright_hints 2024-01-23 16:14:33.000000000 +0000 @@ -9,7 +9,7 @@ debian/copyright-check debian/dh-cargo/README.md debian/gbp.conf - debian/patches/2001_toml.patch + debian/patches/1001_toml.patch debian/patches/README debian/patches/series debian/rules diff -Nru rust-version-sync-0.9.5/debian/dh-cargo/README.md rust-version-sync-0.9.5/debian/dh-cargo/README.md --- rust-version-sync-0.9.5/debian/dh-cargo/README.md 2023-09-21 13:43:46.000000000 +0000 +++ rust-version-sync-0.9.5/debian/dh-cargo/README.md 2023-12-30 15:45:34.000000000 +0000 @@ -1,14 +1,14 @@ # dh-cargo fork This is a fork of the debhelper script [dh-cargo], -based on git commit e07347b -(included with version 30 released 2022-11-25), +based on git commit e0317c5 +(included with version 31 released 2023-12-22), with these functional changes: * support workspace (i.e. multi-crate project), * resolve crate name and version from Cargo.toml, using X-Cargo-Crates hint or library package name only as key - * support debhelper option --sourcedirectory + * support debhelper options --sourcedirectory --builddirectory * support debhelper option --no-package * validate package names against Cargo.toml entries, failing early (not after test) on crate vs. package mismatch @@ -26,7 +26,7 @@ Also included is a slight fork of related [cargo] wrapper script, based on git commit bac0ad2d -(expected to be included with the version succeeding 0.66.0+ds1-1), +(included with version 0.66.0+ds2-1 released 2023-12-03), with these functional changes: * support CARGO_MANIFEST_DIR=${debhelper_sourcedirectory} @@ -36,6 +36,7 @@ * support cargo option --path * fix only inject path for "cargo install" when not passed as option * support DEB_BUILD_OPTIONS=terse + * warn when cargo wrapper bails due to mismatching CARGO_HOME * enable optimization flags by default also for tests, and support DEB_BUILD_OPTIONS=noopt @@ -63,4 +64,4 @@ ``` - -- Jonas Smedegaard Sun, 17 Sep 2023 07:36:27 +0200 + -- Jonas Smedegaard Sat, 30 Dec 2023 16:19:18 +0100 diff -Nru rust-version-sync-0.9.5/debian/dh-cargo/bin/cargo rust-version-sync-0.9.5/debian/dh-cargo/bin/cargo --- rust-version-sync-0.9.5/debian/dh-cargo/bin/cargo 2023-09-21 13:43:46.000000000 +0000 +++ rust-version-sync-0.9.5/debian/dh-cargo/bin/cargo 2023-12-30 15:45:34.000000000 +0000 @@ -139,13 +139,14 @@ def install(destdir, cratespec, host_rust_type, crate_in_registry, install_prefix, *args): crate, version = cratespec.rsplit("_", 1) + builddir = os.getenv("DEB_BUILDDIR", "target") log("installing into destdir '%s' prefix '%s'" % (destdir, install_prefix)) install_target = destdir + install_prefix path_args = [] if "--path" in args else ["--path", sourcepath()] logrun(["env", "RUST_BACKTRACE=1", # set CARGO_TARGET_DIR so build products are saved in target/ # normally `cargo install` deletes them when it exits - "CARGO_TARGET_DIR=" + sourcepath("target"), + "CARGO_TARGET_DIR=" + sourcepath(builddir), "/usr/bin/cargo"] + list(args) + ([crate, "--vers", version] if crate_in_registry else path_args) + ["--root", install_target], check=True) @@ -154,8 +155,8 @@ # if there was a custom build output, symlink it to debian/cargo_out_dir # hopefully cargo will provide a better solution in future https://github.com/rust-lang/cargo/issues/5457 - r = logrun('''ls -td "target/%s/release/build/%s"-*/out 2>/dev/null | head -n1''' - % (host_rust_type, crate), shell=True, stdout=subprocess.PIPE).stdout + r = logrun('''ls -td "%s/%s/release/build/%s"-*/out 2>/dev/null | head -n1''' + % (builddir, host_rust_type, crate), shell=True, stdout=subprocess.PIPE).stdout r = r.decode("utf-8").rstrip() if r: logrun(["ln", "-sfT", "../%s" % r, "debian/cargo_out_dir"], check=True) @@ -164,6 +165,7 @@ def main(*args): cargo_home = os.getenv("CARGO_HOME", "") if not cargo_home.endswith("debian/cargo_home"): + log(f"WARNING: falling back to simply calling upstream cargo, because CARGO_HOME does not end with debian/cargo_home: ", cargo_home) os.execv("/usr/bin/cargo", ["cargo"] + list(args)) if any(f not in os.environ for f in FLAGS.split()): diff -Nru rust-version-sync-0.9.5/debian/dh-cargo/bin/dh-cargo-built-using rust-version-sync-0.9.5/debian/dh-cargo/bin/dh-cargo-built-using --- rust-version-sync-0.9.5/debian/dh-cargo/bin/dh-cargo-built-using 2023-09-21 13:43:46.000000000 +0000 +++ rust-version-sync-0.9.5/debian/dh-cargo/bin/dh-cargo-built-using 2023-12-30 14:58:00.000000000 +0000 @@ -9,14 +9,14 @@ set -e -CARGO_MANIFEST_DIR="${CARGO_MANIFEST_DIR:-.}" +DEB_BUILDDIR="${DEB_BUILD_DIR:-target}" DEB_HOST_RUST_TYPE="${DEB_HOST_RUST_TYPE:-$(printf "include /usr/share/rustc/architecture.mk\nall:\n\techo \$(DEB_HOST_RUST_TYPE)\n" | make --no-print-directory -sf -)}" CARGO_REGISTRY="${CARGO_REGISTRY:-debian/cargo_registry}" CARGO_CHANNEL="${CARGO_CHANNEL:-release}" # useful for testing: # CARGO_REGISTRY="$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823" DEB_HOST_RUST_TYPE="." CARGO_CHANNEL=debug -CARGO_TARGET_DIR="$CARGO_MANIFEST_DIR/target/$DEB_HOST_RUST_TYPE/$CARGO_CHANNEL" +CARGO_TARGET_DIR="$DEB_BUILDDIR/$DEB_HOST_RUST_TYPE/$CARGO_CHANNEL" CARGO_TARGET_DIR_ABS="$(readlink -f "$CARGO_TARGET_DIR")" CPRIGHT_FORMAT="https://www.debian.org/doc/packaging-manuals/copyright-format/1.0" @@ -169,6 +169,7 @@ done echo "cargo:Built-Using=${built_using%, }" >> "debian/$binpkg.substvars" echo "cargo:X-Cargo-Built-Using=${built_using_x%, }" >> "debian/$binpkg.substvars" + echo "cargo:Static-Built-Using=${built_using_x%, }" >> "debian/$binpkg.substvars" fi } diff -Nru rust-version-sync-0.9.5/debian/dh-cargo/lib/Debian/Debhelper/Buildsystem/cargo.pm rust-version-sync-0.9.5/debian/dh-cargo/lib/Debian/Debhelper/Buildsystem/cargo.pm --- rust-version-sync-0.9.5/debian/dh-cargo/lib/Debian/Debhelper/Buildsystem/cargo.pm 2023-09-21 13:43:46.000000000 +0000 +++ rust-version-sync-0.9.5/debian/dh-cargo/lib/Debian/Debhelper/Buildsystem/cargo.pm 2023-12-30 15:45:34.000000000 +0000 @@ -44,6 +44,10 @@ "Rust Cargo" } +sub DEFAULT_BUILD_DIRECTORY { + "target" +} + sub cargo_crates { my ( $root, $src, $default ) = @_; open(F, "cargo metadata --manifest-path $src --no-deps --format-version 1 |"); @@ -287,11 +291,13 @@ # which might fail if e.g. the package # requires non-rust system dependencies and the maintainer didn't provide # this additional information to debcargo. - $this->doit_in_sourcedir($this->{cargo_command}, "test", @_); + $this->doit_in_sourcedir("env", + "DEB_BUILDDIR=" . $this->get_builddir(), + $this->{cargo_command}, "test", @_); # test generating Built-Using fields my $channel = get_buildoption("noopt") ? 'debug' : 'release'; doit("env", - "CARGO_MANIFEST_DIR=" . $this->get_sourcedir(), + "DEB_BUILDDIR=" . $this->get_builddir(), "CARGO_CHANNEL=$channel", "debian/dh-cargo/bin/dh-cargo-built-using"); } @@ -323,7 +329,7 @@ # force to favor this crate over a dependency pulled from system complex_doit( qw(ln --symbolic --force --relative --target-directory=debian/cargo_registry), $target ); - } + } foreach my $featurepkg (@{$this->{featurepkg}}) { my $target = tmpdir( $featurepkg->{name} ) . "/usr/share/doc"; install_dir($target); @@ -333,11 +339,14 @@ # Do the install my $destdir = $ENV{'DESTDIR'} || tmpdir( $crate->{binpkg}{name} ); my @path_opts = $crate->{sourcepath} ne '.' ? ('--path', $crate->{sourcepath}) : (); - $this->doit_in_sourcedir("env", "DESTDIR=$destdir", "DEB_CARGO_CRATE=$crate->{cratespec}", - $this->{cargo_command}, "install", @path_opts, @_); + $this->doit_in_sourcedir("env", + "DEB_CARGO_CRATE=$crate->{cratespec}", + "DEB_BUILDDIR=" . $this->get_builddir(), + "DESTDIR=$destdir", + $this->{cargo_command}, "install", @path_opts, @_); # generate Built-Using fields doit("env", - "CARGO_MANIFEST_DIR=" . $this->get_sourcedir(), + "DEB_BUILDDIR=" . $this->get_builddir(), "debian/dh-cargo/bin/dh-cargo-built-using", $crate->{binpkg}{name}); } } @@ -345,7 +354,9 @@ sub clean { my $this=shift; doit("touch", "--no-create", "-d@" . $ENV{SOURCE_DATE_EPOCH}, ".cargo_vcs_info.json"); - $this->doit_in_sourcedir($this->{cargo_command}, "clean", @_); + $this->doit_in_sourcedir("env", + "DEB_BUILDDIR=" . $this->get_builddir(), + $this->{cargo_command}, "clean", @_); doit("rm", "-rf", "debian/cargo_registry"); } diff -Nru rust-version-sync-0.9.5/debian/patches/1001_toml.patch rust-version-sync-0.9.5/debian/patches/1001_toml.patch --- rust-version-sync-0.9.5/debian/patches/1001_toml.patch 1970-01-01 00:00:00.000000000 +0000 +++ rust-version-sync-0.9.5/debian/patches/1001_toml.patch 2024-01-23 16:10:53.000000000 +0000 @@ -0,0 +1,18 @@ +Description: accept newer branch of toml +Author: Jonas Smedegaard +Bug-Debian: https://bugs.debian.org/1061374 +Forwarded: not-needed +Last-Update: 2024-01-23 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -23,7 +23,7 @@ + regex = { version = "1.5.4", default-features = false, features = ["std", "unicode"], optional = true } + semver = { version = "1.0.5", optional = true } + syn = { version = "2.0.15", default-features = false, features = ["parsing", "printing", "full"], optional = true } +-toml = { version = "0.7.8", optional = true } ++toml = { version = ">= 0.7.8, <= 0.8", optional = true } + url = { version = "2.2.2", optional = true } + + [dev-dependencies] diff -Nru rust-version-sync-0.9.5/debian/patches/2001_toml.patch rust-version-sync-0.9.5/debian/patches/2001_toml.patch --- rust-version-sync-0.9.5/debian/patches/2001_toml.patch 2023-10-16 16:32:33.000000000 +0000 +++ rust-version-sync-0.9.5/debian/patches/2001_toml.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Description: relax dependency to match older releases of crate toml -Author: Jonas Smedegaard -Bug-Debian: https://bugs.debian.org/1053955 -Forwarded: not-needed -Last-Update: 2023-10-16 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -23,7 +23,7 @@ - regex = { version = "1.5.4", default-features = false, features = ["std", "unicode"], optional = true } - semver = { version = "1.0.5", optional = true } - syn = { version = "2.0.15", default-features = false, features = ["parsing", "printing", "full"], optional = true } --toml = { version = "0.7.8", optional = true } -+toml = { version = "0.7.6", optional = true } - url = { version = "2.2.2", optional = true } - - [dev-dependencies] diff -Nru rust-version-sync-0.9.5/debian/patches/series rust-version-sync-0.9.5/debian/patches/series --- rust-version-sync-0.9.5/debian/patches/series 2023-10-16 16:30:41.000000000 +0000 +++ rust-version-sync-0.9.5/debian/patches/series 2024-01-23 16:08:59.000000000 +0000 @@ -1 +1 @@ -2001_toml.patch +1001_toml.patch