3 # nailing-cargo: wrapper to use unpublished local crates
5 # Copyright (C) 2019-2020 Ian Jackson
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # ../nailing-cargo/nailing-cargo make
22 # ../nailing-cargo/nailing-cargo cargo build
24 # Why do we need this ?
26 # https://github.com/rust-lang/cargo/issues/6713
27 # https://stackoverflow.com/questions/33025887/how-to-use-a-local-unpublished-crate
28 # https://github.com/rust-lang/cargo/issues/1481
31 # -v Increase verbosity. Default is 1.
32 # -q Set verbosity ot 0.
33 # -D Increase amount of debugging dump.
35 # -n "No action": stop after writing Cargo.toml.nailing~
36 # everywhere, and do not run any build command.
38 # -T<arch> --target=<arch>
39 # Specify target architecture. If <arch> starts with a
40 # capital ascii letter, is an alias for some other arch
41 # looked up in Cargo.nail and then in the builtin list:
42 # RPI arm-unknown-linux-gnueabihf
43 # Translates to a --target= option to the ultimate command,
44 # unless that is a cargo subcommand which would reject it.
46 # -u | --cargo-lock-update
47 # -U | --no-cargo-lock-update
48 # Arranges to do a dance to allow Cargo.lock (or
49 # alternative) to be updated in the source directory.
51 # The Cargo.lock and Cargo.toml are copied to the build
52 # directory along with a skeleton just big enough to fool
53 # cargo. After cargo has run, the resulting Cargo.lock is
54 # copied back to the source tree.
56 # Makes no sense with in-tree builds.
58 # Default is no update unless the ultimate command is a
59 # cargo subcommand which we know needs it.
61 # -m | --cargo-manifest-args
62 # -M | --no-cargo-manifest-args
63 # Controls whether we add cargo command line options
64 # relating to finding Cargo.toml, to the command to
67 # Default is true if we are doing an out-of- tree build,
68 # unless we are updating the Cargo.lock (in which case the
69 # only relevant files are to be found in the build directory).
72 # --manifest-path=<path/to/Cargo.toml>
76 # -T | --no-cargo-target-arg
77 # -t | --cargo-target-arg
78 # Suppress --target (or un-suppress it). Only useful with -m.
79 # Done automatically when nailing-cargo sees that the cargo
80 # subcommand is one which needs it, eg `fetch'.
82 # --online | --offline
83 # Whether to allow cargo to make network access.
84 # (nailing-cargo always passes --offline to cargo, unless
85 # --online is in force). The default is offline,
86 # unless the cargo subcommand is one which implies
87 # online (currently, `fetch').
91 # # Adds each <subdir> to the list of directories whose
92 # # Cargo.toml is to be nailed, and also arranges to use
93 # # the package found there for other directories if
94 # # no other source of that package is evident in Cargo.nail.
105 # # Adds <subdir> to the list of directories whose Cargo.toml
106 # # is to be nailed, and overrides any other nailing for <package>
108 # <package> = <subdir>
109 # <package> = { <subdir> = ... }
111 # To control use of alternative Cargo.lock filename:
114 # file = true # equivalent to "Cargo.lock.example"
115 # file = false # disables this feature
116 # file = "<some leafname>"
118 # force = false # default, uses alt file only if it already exists
119 # force = true # always uses alt file; creation would make Cargo.lock
121 # (you can also specify just alt_cargo_lock instead of alt_cargo_lock.file)
123 # To enable out of tree builds:
125 # dir = "<build-directory>" # default is Build, if use is specified
128 # user = "<someuser>"
131 # user = "<user>@host" # NB must still share a filesystem!
133 # use = "command_args"
134 # command = ["<command>", "<which works like>", "nice"]
137 # command = ["<command>", "<which work like>", "sh -c"]
143 # online = true # forces default to be --online
144 # online = false # forces default to be --offline
148 # Always dirties everyone's Cargo.toml, but tries to put them
149 # back (if not, running it again should fix it). Cannnot be
150 # fixed without changes to cargo.
152 # Out of tree builds require a unified filesystem view: eg,
153 # different users on the same host, NFS, or something. This
156 # Alternative Cargo.lock file must currently be a leafname.
157 # I think this just involves review to check other values work.
159 # Alternative Cargo.lock file must be on smae filesystem.
160 # This is not so easy; we would want the existing algorithm but
161 # a fallback for this case.
163 # Cargo.nail unconditionally looked for in ..
164 # Ideally should be configurable, and also perhaps be able
165 # to combine multiple Cargo.nail files ?
167 # Env vars we pass to the command:
168 # NAILINGCARGO_WORKSPHERE absolute path of invocation ..
169 # NAILINGCARGO_MANIFEST_DIR absolute path of invocation .
170 # NAILINGCARGO_BUILDSPHERE only if out of tree: abs parent of build dir
171 # NAILINGCARGO_BUILD_DIR absolute path of build dir (even if = src)
178 use Types::Serialiser;
181 RPI => 'arm-unknown-linux-gnueabihf',
185 $self = $0; $self =~ s{^.*/(?=.)}{};
187 while ($deref =~ m{^/}) {
188 my $link = readlink $deref;
189 if (!defined $link) {
191 or die "$self: checking our script location $deref: $!\n";
192 $deref =~ s{/[^/]+$}{}
193 or die "$self: unexpected script path: $deref\n";
194 unshift @INC, $deref."/TOML-Tiny/lib";
197 last if $link !~ m{^/};
202 use Fcntl qw(LOCK_EX);
204 use TOML::Tiny::Faithful;
206 our $src_absdir = getcwd() // die "$self: getcwd failed: $!\n";
208 our $worksphere = $src_absdir;
209 $worksphere =~ s{/([^/]+)$}{}
210 or die "$self: cwd \`$worksphere' unsupported!\n";
211 our $subdir = $1; # leafname
213 our $lockfile = "../.nailing-cargo.lock";
215 our $cargo_lock_update;
216 our $cargo_manifest_args;
217 our $cargo_target_arg=1;
226 sub read_or_enoent ($) {
228 if (!open R, '<', $fn) {
229 return undef if $!==ENOENT;
230 die "$self: open $fn: $!\n";
233 my ($r) = <R> // die "$self: read $fn: $!\n";
237 sub stat_exists ($$) {
238 my ($fn, $what) = @_;
239 if (stat $fn) { return 1; }
240 $!==ENOENT or die "$self: stat $what: $fn: $!\n";
244 sub toml_or_enoent ($$) {
246 my $toml = read_or_enoent($f) // return;
247 my ($v,$e) = from_toml($toml);
250 die "$self: parse TOML: $what: $f: $e\n";
252 die "$e ?" if length $e;
256 sub load1config ($) {
258 my $toml = toml_or_enoent($f, "config file");
259 push @configs, $toml if defined $toml;
263 my $cfgleaf = ".nailing-cargo-cfg.toml";
264 load1config("/etc/nailing-cargo/cfg.toml");
265 load1config("$worksphere/$cfgleaf");
266 load1config("$ENV{HOME}/$cfgleaf") if defined $ENV{HOME};
271 foreach my $cfg (@configs) {
273 return $v if defined $v;
278 sub unlink_or_enoent ($) { unlink $_[0] or $!==ENOENT; }
282 "@$x[0..5]" eq "@$y[0..5]";
287 open LOCK, ">", $lockfile or die "$self: open/create $lockfile: $!\n";
288 flock LOCK, LOCK_EX or die "$self: lock $lockfile: $!\n";
289 my @fstat = stat LOCK or die "$self: fstat: $!\n";
290 my @stat = stat $lockfile;
292 next if $! == ENOENT;
293 die "$self: stat $lockfile: $!\n";
295 last if same_file(\@fstat,\@stat);
299 unlink $lockfile or die "$self: removing lockfile: $!\n";
307 die "$self: config key \`@_': $m\n";
313 last unless defined $v;
314 ref($v) eq 'HASH' or badcfg @_, "parent key \`$k' is not a hash";
323 my $got = ref($v) || 'scalar';
324 return $v if !defined($v) || $got eq $exp;
325 badcfg @_, "found \L$got\E, expected \L$exp\E";
326 # ^ toml doesn't make refs to scalars, so this is unambiguous
331 (cfge $exp, @_) // badcfg @_, "missing";
334 sub cfgs { cfge 'scalar', @_ }
335 sub cfgsn { cfgn 'scalar', @_ }
339 return $v if !defined($v) || Types::Serialiser::is_bool $v;
340 badcfg @_, "expected boolean";
344 my $l = cfge 'ARRAY', @_;
345 foreach my $x (@$l) {
346 !ref $x or badcfg @_, "list contains non-scalar element";
352 my $nailfile = "../Cargo.nail";
353 open N, '<', $nailfile or die "$self: open $nailfile: $!\n";
355 my $toml = <N> // die "$self: read $nailfile: $!";
357 if ($toml !~ m{^\s*\[/}m &&
358 $toml !~ m{^[^\n\#]*\=}m &&
359 # old non-toml syntax
360 $toml =~ s{^[ \t]*([-_0-9a-z]+)[ \t]+(\S+)[ \t]*$}{$1 = \"$2\"}mig) {
361 $toml =~ s{^}{[packages\]\n};
363 $toml =~ s{^[ \t]*\-[ \t]*\=[ \t]*(\"[-_0-9a-z]+\"\n?)$}{
366 $toml = "subdirs = [\n".(join '', map { "$_\n" } @sd)."]\n".$toml;
370 ($nail,$e) = from_toml($toml);
371 if (!defined $nail) {
374 print STDERR "$self: $nailfile transformed into TOML:\n$toml\n";
377 die "$self: parse $nailfile: $e\n";
379 die "$e ?" if length $e;
381 $nail->{subdirs} //= [ ];
383 if (!ref $nail->{subdirs}) {
386 map { s/^\s+//; s/\s+$//; $_; }
393 our @alt_cargo_lock_stat;
395 sub consider_alt_cargo_lock () {
396 my @ck = qw(alt_cargo_lock);
397 # User should *either* have Cargo.lock in .gitignore,
398 # or expect to commit Cargo.lock.example ($alt_cargo_lock)
400 $alt_cargo_lock = (cfg_uc @ck);
403 if (defined($alt_cargo_lock) && ref($alt_cargo_lock) eq 'HASH') {
404 $force = cfg_bool qw(alt_cargo_lock force);
405 my @ck = qw(alt_cargo_lock file);
406 $alt_cargo_lock = cfg_uc @ck;
408 $alt_cargo_lock //= Types::Serialiser::true;
410 if (Types::Serialiser::is_bool $alt_cargo_lock) {
411 if (!$alt_cargo_lock) { $alt_cargo_lock = undef; return; }
412 $alt_cargo_lock = 'Cargo.lock.example';
415 if (ref($alt_cargo_lock) || $alt_cargo_lock =~ m{/}) {
416 badcfg @ck, "expected boolean, or leafname";
419 if (!stat_exists $alt_cargo_lock, "alt_cargo_lock") {
420 $alt_cargo_lock = undef unless $force;
424 @alt_cargo_lock_stat = stat _;
427 our $oot_dir; # oot.dir or "Build"
429 sub consider_oot () {
430 $oot_dir = cfgs qw(oot dir);
431 my $use = cfgs qw(oot use);
432 unless (defined($oot_dir) || defined($use)) {
433 die "$self: specified --cargo-lock-update but not out-of-tree build!\n"
434 if $cargo_lock_update;
435 $cargo_lock_update=0;
438 $oot_dir //= 'Build';
444 sub read_manifest ($) {
446 my $manifest = "../$subdir/Cargo.toml";
447 print STDERR "$self: reading $manifest...\n" if $verbose>=4;
448 if (defined $manifests{$manifest}) {
450 "$self: warning: $subdir: specified more than once!\n";
453 foreach my $try ("$manifest.unnailed", "$manifest") {
454 my $toml = toml_or_enoent($try, "package manifest") // next;
455 my $p = $toml->{package}{name};
458 "$self: warning: $subdir: missing package.name in $try, ignoring\n";
461 $manifests{$manifest} = $toml;
468 foreach my $p (keys %{ $nail->{packages} }) {
469 my $v = $nail->{packages}{$p};
470 my $subdir = ref($v) ? $v->{subdir} : $v;
471 my $gotpackage = read_manifest($subdir) // '<nothing!>';
472 if ($gotpackage ne $p) {
474 "$self: warning: honouring Cargo.nail packages.$subdir=$p even though $subdir contains package $gotpackage!\n";
476 die if defined $packagemap{$p};
477 $packagemap{$p} = $subdir;
479 foreach my $subdir (@{ $nail->{subdirs} }) {
480 my $gotpackage = read_manifest($subdir);
481 if (!defined $gotpackage) {
483 "$self: warning: ignoring subdir $subdir which has no Cargo.toml\n";
486 $packagemap{$gotpackage} //= $subdir;
491 foreach my $p (sort keys %packagemap) {
492 print STDERR "$self: package $p in $packagemap{$p}\n" if $verbose>=2;
494 foreach my $mf (keys %manifests) {
495 my $toml = $manifests{$mf};
496 foreach my $k (qw(dependencies build-dependencies dev-dependencies)) {
497 my $deps = $toml->{$k};
499 foreach my $p (keys %packagemap) {
500 my $info = $deps->{$p};
501 next unless defined $info;
502 $deps->{$p} = $info = { } unless ref $info;
503 delete $info->{version};
504 $info->{path} = $worksphere.'/'.$packagemap{$p};
507 my $nailing = "$mf.nailing~";
508 unlink_or_enoent $nailing or die "$self: remove old $nailing: $!\n";
509 open N, '>', $nailing or die "$self: create new $nailing: $!\n";
510 print N to_toml($toml) or die "$self: write new $nailing: $!\n";
511 close N or die "$self: close new $nailing: $!\n";
516 $online //= cfg_bool qw(misc online);
519 $ARGV[0] =~ m{\bcargo\b}) {
520 if ($ARGV[1] =~ m/^(?:generate-lockfile|update)$/) {
521 $cargo_lock_update //= 1;
524 if ($ARGV[1] =~ m/^(?:fetch)$/) {
529 $cargo_lock_update //= 0;
530 $cargo_manifest_args //=
531 (defined $oot_dir) && !$cargo_lock_update;
535 if ($cargo_manifest_args) {
536 push @ARGV, "--manifest-path=${src_absdir}/Cargo.toml",
538 push @ARGV, qw(--target-dir=target) if $cargo_target_arg;
541 if (defined $target) {
542 if ($target =~ m{^[A-Z]}) {
543 $target = (cfgs 'arch', $target) // $archmap{$target}
544 // die "$self: --target=$target alias specified; not in cfg or map\n";
546 push @ARGV, "--target=$target";
549 push @ARGV, "--offline" unless $online;
553 our $build_absdir; # .../Build/<subdir>
555 sub oot_massage_cmdline () {
556 return unless defined $oot_dir;
558 my $use = cfgs qw(oot use);
559 $oot_absdir = ($oot_dir !~ m{^/} ? "$worksphere/" : ""). $oot_dir;
560 $build_absdir = "$oot_absdir/$subdir";
564 if (!$cargo_lock_update) {
565 push @xargs, $build_absdir;
566 ($pre, $post) = ('cd "$1"; shift; ', '');
568 push @xargs, $oot_absdir, $subdir, $src_absdir;
571 mkdir -p -- "$1"; cd "$1"; shift;
572 cp -- "$1"/Cargo.toml
574 $pre .= <<'ENDLK' if stat_exists 'Cargo.lock', 'working cargo lockfile';
582 mkdir -p src; >src/lib.rs; >build.rs
585 rm -r src Cargo.toml build.rs;
588 my $addpath = (cfg_uc qw(oot path_add)) //
589 $use eq 'really' ? Types::Serialiser::true : Types::Serialiser::false;
591 !Types::Serialiser::is_bool $addpath ? $addpath :
592 $addpath ? '$HOME/.cargo/bin' :
594 if (defined $addpath) {
596 PATH=$addpath:\${PATH-/usr/local/bin:/bin:/usr/bin};
600 $pre =~ s/^\s+//mg; $pre =~ s/\s+/ /g;
601 $post =~ s/^\s+//mg; $post =~ s/\s+/ /g;
603 my $getuser = sub { cfgsn qw(oot user) };
605 my $xe = $verbose >= 2 ? 'xe' : 'e';
608 @command = (@_, 'sh',"-${xe}c",$pre.'exec "$@"','--',@xargs);
610 @command = (@_, 'sh',"-${xe}c",$pre.'"$@"; '.$post,'--',@xargs);
612 push @command, @ARGV;
614 my $command_sh = sub {
615 my $quoted = join ' ', map {
620 @command = @_, "set -${xe}; $pre $quoted; $post";
622 print STDERR "$self: out-of-tree, building in: \`$build_absdir'\n"
624 if ($use eq 'really') {
625 my $user = $getuser->();
626 my @pw = getpwnam $user or die "$self: oot.user \`$user' lookup failed\n";
627 my $homedir = $pw[7];
628 $sh_ec->('really','-u',$user,'env',"HOME=$homedir");
629 print STDERR "$self: using really to run as user \`$user'\n" if $verbose;
630 } elsif ($use eq 'ssh') {
631 my $user = $getuser->();
632 $user .= '@localhost' unless $user =~ m/\@/;
633 $command_sh->('ssh',$user);
634 print STDERR "$self: using ssh to run as \`$user'\n" if $verbose;
635 } elsif ($use eq 'command_args') {
636 my @c = cfgn_list qw(oot command);
638 print STDERR "$self: out-of-tree, adverbial command: @c\n" if $verbose;
639 } elsif ($use eq 'command_sh') {
640 my @c = cfgn_list qw(oot command);
642 print STDERR "$self: out-of-tree, ssh'ish command: @c\n" if $verbose;
643 } elsif ($use eq 'null') {
646 die "$self: oot.use mode $use not recognised\n";
653 $ENV{NAILINGCARGO_WORKSPHERE} = $worksphere;
654 $ENV{NAILINGCARGO_MANIFEST_DIR} = $src_absdir;
655 $ENV{NAILINGCARGO_BUILDSPHERE} = $oot_absdir;
656 delete $ENV{NAILINGCARGO_BUILDSPHERE} unless $oot_absdir;
657 $ENV{NAILINGCARGO_BUILD_DIR} = $build_absdir // $src_absdir;
663 if ($want_uninstall) {
665 foreach my $mf (keys %manifests) {
666 eval { uninstall1($mf,1); 1; } or warn "$@";
668 eval { unaltcargolock(1); 1; } or warn "$@";
672 our $cleanup_cargo_lock;
674 foreach my $mf (keys %manifests) {
675 link "$mf", "$mf.unnailed" or $!==EEXIST
676 or die "$self: make backup link $mf.unnailed: $!\n";
679 if (defined($alt_cargo_lock)) {
680 if (@alt_cargo_lock_stat) {
681 print STDERR "$self: using alt_cargo_lock `$alt_cargo_lock'..."
683 if (link $alt_cargo_lock, 'Cargo.lock') {
684 print STDERR " linked\n" if $verbose>=3;
685 } elsif ($! != EEXIST) {
686 print STDERR "\n" if $verbose>=3;
687 die "$self: make \`Cargo.lock' available as \`$alt_cargo_lock': $!\n";
689 print STDERR "checking quality." if $verbose>=3;
690 my @lock_stat = stat 'Cargo.lock'
691 or die "$self: stat Cargo.lock (for alt check: $!\n";
692 same_file(\@alt_cargo_lock_stat, \@lock_stat)
694 "$self: \`Cargo.lock' and alt file \`$alt_cargo_lock' both exist and are not the same file!\n";
696 $cleanup_cargo_lock = 1;
698 $cleanup_cargo_lock = 1;
699 # If Cargo.lock exists and alt doesn't, that means either
700 # that a previous run was interrupted, or that the user has
708 my $nailed = "$mf.nailed~"; $nailed =~ s{/([^/]+)$}{/.$1} or die;
713 my @our_unfound_stab = stat_exists('Cargo.toml', 'local Cargo.toml')
715 foreach my $mf (keys %manifests) {
716 if (@our_unfound_stab) {
717 if (stat_exists $mf, "manifest in to-be-nailed directory") {
718 my @mf_stab = stat _ ;
719 if ("@mf_stab[0..1]" eq "@our_unfound_stab[0..1]") {
720 @our_unfound_stab = ();
725 my $nailing = "$mf.nailing~";
726 my $nailed = nailed($mf);
729 if (open NN, '<', $nailed) {
730 $diff = compare($nailing, \*NN);
731 die "$self: compare $nailing and $nailed: $!" if $diff<0;
733 $!==ENOENT or die "$self: check previous $nailed: $!\n";
743 rename $use, $mf or die "$self: install nailed $use: $!\n";
744 unlink_or_enoent $rm or die "$self: remove old $rm: $!\n";
745 print STDERR "$self: nailed $mf\n" if $verbose>=3;
748 if (@our_unfound_stab) {
750 "$self: *WARNING* cwd is not in Cargo.nail thbough it has Cargo.toml!\n";
755 my $r = system @ARGV;
759 print STDERR "$self: could not execute $ARGV[0]: $!\n";
761 } elsif ($r & 0xff00) {
762 print STDERR "$self: $ARGV[0] failed (exit status $r)\n";
765 print STDERR "$self: $ARGV[0] died due to signal! (wait status $r)\n";
770 sub cargo_lock_update_after () {
771 if ($cargo_lock_update) {
772 # avoids importing File::Copy and the error handling is about as good
774 my $r= system qw(cp --), "$build_absdir/Cargo.lock", "Cargo.lock";
775 die "$self: run cp: $! $?" if $r<0 || $r & 0xff;
776 die "$self: failed to update local Cargo.lock (wait status $r)\n" if $r;
780 sub uninstall1 ($$) {
781 my ($mf, $enoentok) = @_;
782 my $unnailed = "$mf.unnailed";
783 rename $unnailed, $mf or ($enoentok && $!==ENOENT)
784 or die "$self: failed to restore: rename $unnailed back to $mf: $!\n";
787 sub unaltcargolock ($) {
789 return unless $cleanup_cargo_lock;
790 die 'internal error!' unless defined $alt_cargo_lock;
792 # we ignore $enoentok because we don't know if one was supposed to
795 rename('Cargo.lock', $alt_cargo_lock) or $!==ENOENT or die
796 "$self: cleanup: rename possibly-updated \`Cargo.lock' to \`$alt_cargo_lock': $!\n";
798 unlink 'Cargo.lock' or $!==ENOENT or die
799 "$self: cleanup: remove \`Cargo.lock' in favour of \`$alt_cargo_lock': $!\n";
800 # ^ this also helps clean up the stupid rename() corner case
804 foreach my $mf (keys %manifests) {
805 my $nailed = nailed($mf);
806 link $mf, $nailed or die "$self: preserve (link) $mf as $nailed: $!\n";
812 while (@ARGV && $ARGV[0] =~ m/^-/) {
819 } elsif (s{^-q}{-}) {
821 } elsif (s{^-n}{-}) {
823 } elsif (s{^-D}{-}) {
825 } elsif (s{^-T(.+)}{-}s) {
827 } elsif (s{^-([uU])}{-}) {
828 $cargo_lock_update= $1=~m/[a-z]/;
829 } elsif (s{^-([mM])}{-}) {
830 $cargo_manifest_args= $1=~m/[a-z]/;
831 } elsif (s{^-([tT])}{-}) {
832 $cargo_target_arg= $1=~m/[a-z]/;
834 die "$self: unknown short option(s) $_\n";
837 } elsif (s{^--target=}{}) {
839 } elsif (m{^--(no-)?cargo-lock-update}) {
840 $cargo_lock_update= !!$1;
841 } elsif (m{^--(no-)?cargo-manifest-args}) {
842 $cargo_manifest_args= !!$1;
843 } elsif (m{^--(no-)?cargo-target-arg}) {
844 $cargo_target_arg= !!$1;
845 } elsif (m{^--(on|off)line$}) {
846 $online = $1 eq 'on';
848 die "$self: unknown long option $_\n";
852 die "$self: need command to run\n" unless @ARGV || $noact;
856 consider_alt_cargo_lock();
861 our @display_cmd = @ARGV;
862 oot_massage_cmdline();
868 print STDERR Dumper(\%manifests) if $dump>=2;
869 print STDERR Dumper(\%packagemap, \@ARGV,
870 { src_absdir => $src_absdir,
871 worksphere => $worksphere,
874 oot_absdir => $oot_absdir,
875 build_absdir => $build_absdir });
885 printf STDERR "$self: nailed (%s manifests, %s packages)%s\n",
886 (scalar keys %manifests), (scalar keys %packagemap),
887 (defined($alt_cargo_lock) and ", using `$alt_cargo_lock'")
890 print STDERR "$self: invoking: @display_cmd\n" if $verbose;
891 my $estatus = invoke();
893 cargo_lock_update_after();
898 print STDERR "$self: unnailed. status $estatus.\n" if $verbose;