chiark / gitweb /
README.md: Sort out docs for new cargo publish support
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 18 Jun 2021 15:36:15 +0000 (16:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 18 Jun 2021 15:36:15 +0000 (16:36 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README.md
nailing-cargo

index dcdea6ee9e54f4845c82bd46d37f66b45ad211a6..81d94e7caab01b81e1d7f14b7986196de6a84823 100644 (file)
--- a/README.md
+++ b/README.md
@@ -371,6 +371,7 @@ WASM="wasm32-unknown-unknown"
     * `!target`: cargo would reject `--target=<arch>`; in this case nailing-cargo's `-T` option is ineffective.
     * `!target-dir`: cargo would reject `--target-dir`, so don't pass it.  (Usually we pass `--target-dir=target` when we pass `--manifest-path`, since cargo's default is `target` in the same directory as `Cargo.toml`.)
     * `linkfarm-shallow`: Make the default be `--linkfarm=shallow`.  This is the default for `miri` and can also be used for other subcommands which do not understandg `--manifest-path` properly.
+    * `linkfarm-gitclean`: Make the defaults be `--linkfarm=git` and `--preclean-build=src`.
 
     There are also some properties which should not be needed, but are
     provided for completeness.  Do not use these to solve the problem
@@ -397,7 +398,8 @@ WASM="wasm32-unknown-unknown"
       nailing-cargo thinks cargo is going to update `Cargo.lock`.
 
     * `git`: Make a deep linkfarm, with subdirectories.  Symlink
-      those objects tracked by git.
+      those objects tracked by git.  This is the default for
+      `cargo publish`.
 
     * `full`: Make a deep linkfarm and symlink every nondirectory found
       in the source tree.  This will including all sorts of junk,
@@ -435,6 +437,13 @@ WASM="wasm32-unknown-unknown"
     lockfile update, controls whether the linkfarm is kept afterwards.
     Overrides the `oot.clean` config option.  (Default: keep.)
 
+  * `--[no-]preclean-build[=no|src|full]`: When doing an out-of-tree
+    build, controls whether the build directory is purged of leftover
+    contents *before* the build is run.  The usual default is `no`.
+    For `cargo publish`, the default is `src`, which deletes
+    everything except the directory `target`.  `full` means to clean
+    out that too.
+
   * `--leave-nailed`: At the end, leave all the `Cargo.toml` files in
     their edited state, rather than (trying to) clean them up.  To
     clean this up later, run `nailing-cargo` again without this option.
index cbbc4cc246326fae53b0db7e5a0be15701292da4..32fcaf2ab49dd85648b12e943a2fcb1648ebf853 100755 (executable)
@@ -110,7 +110,7 @@ our %subcmd_props = (
  fetch             =>[qw(                     online   !target-dir       )],
  fmt               =>[qw( !locked     !target !offline !target-dir edits )],
  miri              =>[qw( !locked             !offline  linkfarm-shallow )],
- publish           =>[qw(                     !offline  linkfarm-pristine )],
+ publish           =>[qw(                     !offline  linkfarm-gitclean )],
  upgrades          =>[qw( !locked                      !target-dir       )],
                    );
 
@@ -575,7 +575,7 @@ sub addargs () {
   $online //= 1 if subcmd_p('online');
   $online //= 0;
 
-  if (subcmd_p('linkfarm-pristine')) {
+  if (subcmd_p('linkfarm-gitclean')) {
     $linkfarm_depth //= 'git';
     $oot_preclean //= 'src';
   }
@@ -1048,9 +1048,9 @@ sub parse_args () {
       $do_nail = $do_cargo_lock = $do_lock = 0;
     } elsif (m{^--(clean|keep)-linkfarm$}) {
       $oot_clean = $1 eq 'clean';
-    } elsif (m{^--(no-)?preclean-linkfarm$}) {
+    } elsif (m{^--(no-)?preclean-build$}) {
       $oot_preclean = $1 ? 'no' : 'src';
-    } elsif (m{^--preclean-linkfarm=(no|src|full)$}) {
+    } elsif (m{^--preclean-build=(no|src|full)$}) {
       $oot_preclean = $1;
     } elsif (m{^--(no-)?nail$}) {
       $do_nail = !$1;