]> git.proxmox.com Git - dh-cargo.git/commitdiff
Set CARGO_TARGET_DIR so build products are saved
authorXimin Luo <infinity0@debian.org>
Sat, 4 Aug 2018 18:34:36 +0000 (11:34 -0700)
committerXimin Luo <infinity0@debian.org>
Sat, 4 Aug 2018 18:34:36 +0000 (11:34 -0700)
cargo.pm
debian/changelog

index 7d340fae48bd551700c1c500c4f5fb1f34a37eb1..b98733687f0cd062c5ceb9e6deec436cc65ccb4a 100644 (file)
--- a/cargo.pm
+++ b/cargo.pm
@@ -190,6 +190,9 @@ sub install {
     }
     if ($this->{binpkg}) {
         my $target = $this->get_sourcepath("debian/" . $this->{binpkg} . "/usr");
+        # set CARGO_TARGET_DIR so build products are saved in target/
+        # normally `cargo install` deletes them when it exits
+        $ENV{'CARGO_TARGET_DIR'} = Cwd::abs_path($this->get_sourcepath("target"));
         doit("cargo", "install", "--verbose", "--verbose", @{$this->{j}},
             "--target", deb_host_rust_type,
             $this->{crate},
index cf4f702d72e6cba9966cf58075c0c41bd62eb2c9..1ebd1d49fbb55ae77f196ef38bcad0c517dd2876 100644 (file)
@@ -2,6 +2,7 @@ dh-cargo (7) UNRELEASED; urgency=medium
 
   * Be more verbose, as recommended by Policy.
   * Update to latest Standards-Version.
+  * Set CARGO_TARGET_DIR so build products are saved.
 
  -- Ximin Luo <infinity0@debian.org>  Sat, 04 Aug 2018 11:33:36 -0700