chiark / gitweb /
nailing-cargo.git
2 years agoREADME: document trouble with tricky packages, and submodules main nailing-cargo/1.0.0
Ian Jackson [Tue, 17 Aug 2021 17:07:01 +0000 (18:07 +0100)]
README: document trouble with tricky packages, and submodules

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoREADME: clarify documentation around -E and -EE
Ian Jackson [Tue, 17 Aug 2021 17:06:44 +0000 (18:06 +0100)]
README: clarify documentation around -E and -EE

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoREADME: update copyright date
Ian Jackson [Tue, 17 Aug 2021 17:06:27 +0000 (18:06 +0100)]
README: update copyright date

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoREADME: typo fixes
Ian Jackson [Tue, 17 Aug 2021 17:06:20 +0000 (18:06 +0100)]
README: typo fixes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoREADME: complete and sort the known subcommands list
Ian Jackson [Tue, 17 Aug 2021 17:05:32 +0000 (18:05 +0100)]
README: complete and sort the known subcommands list

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agonailing-argo: sort the command table
Ian Jackson [Tue, 17 Aug 2021 17:05:12 +0000 (18:05 +0100)]
nailing-argo: sort the command table

This will make it easier to maintain and compare with the docs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agonailing-cargo: Properly handle renamed packages
Ian Jackson [Tue, 17 Aug 2021 16:26:41 +0000 (17:26 +0100)]
nailing-cargo: Properly handle renamed packages

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoAdd a comment regarding toml manipulation
Ian Jackson [Fri, 16 Jul 2021 15:38:15 +0000 (16:38 +0100)]
Add a comment regarding toml manipulation

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoadd cargo metadata
Ian Jackson [Thu, 24 Jun 2021 13:18:36 +0000 (14:18 +0100)]
add cargo metadata

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agolinkfarm-depth: Suppress a spurious warning
Ian Jackson [Mon, 21 Jun 2021 12:46:04 +0000 (13:46 +0100)]
linkfarm-depth: Suppress a spurious warning

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoREADME: Document that --linkfarm overrides -E
Ian Jackson [Mon, 21 Jun 2021 11:58:57 +0000 (12:58 +0100)]
README: Document that --linkfarm overrides -E

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoNew --force, and make lack of -E fail by default
Ian Jackson [Mon, 21 Jun 2021 11:58:41 +0000 (12:58 +0100)]
New --force, and make lack of -E fail by default

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoProvide subcmd mode `creates` and specify it for `cargo init`
Ian Jackson [Mon, 21 Jun 2021 11:47:13 +0000 (12:47 +0100)]
Provide subcmd mode `creates` and specify it for `cargo init`

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoImplement -EE (copy-edit-all)
Ian Jackson [Mon, 21 Jun 2021 11:45:23 +0000 (12:45 +0100)]
Implement -EE (copy-edit-all)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoUsage message: Mention --edits-sources
Ian Jackson [Mon, 21 Jun 2021 11:45:52 +0000 (12:45 +0100)]
Usage message: Mention --edits-sources

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoDebug dump: Dump values of more computed command line options
Ian Jackson [Mon, 21 Jun 2021 11:45:29 +0000 (12:45 +0100)]
Debug dump: Dump values of more computed command line options

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoBreak out $edits_sources in command line parser
Ian Jackson [Mon, 21 Jun 2021 11:44:50 +0000 (12:44 +0100)]
Break out $edits_sources in command line parser

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoUsage message: Fix docs for --preclean-build
Ian Jackson [Mon, 21 Jun 2021 11:43:32 +0000 (12:43 +0100)]
Usage message: Fix docs for --preclean-build

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoUsage message: Mention --linkfarm
Ian Jackson [Mon, 21 Jun 2021 11:43:17 +0000 (12:43 +0100)]
Usage message: Mention --linkfarm

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoREADME: Fix docs for `edits`, which is not automatic
Ian Jackson [Mon, 21 Jun 2021 11:42:52 +0000 (12:42 +0100)]
README: Fix docs for `edits`, which is not automatic

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoREADME.md: Sort out docs for new cargo publish support
Ian Jackson [Fri, 18 Jun 2021 15:36:15 +0000 (16:36 +0100)]
README.md: Sort out docs for new cargo publish support

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoREADME.md: Fix doc for --linkfarm=full
Ian Jackson [Fri, 18 Jun 2021 15:35:18 +0000 (16:35 +0100)]
README.md: Fix doc for --linkfarm=full

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoREADME.md: Document subcommand prop linkfarm-shallow
Ian Jackson [Fri, 18 Jun 2021 15:35:05 +0000 (16:35 +0100)]
README.md: Document subcommand prop linkfarm-shallow

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoClean on publish
Ian Jackson [Fri, 18 Jun 2021 15:24:34 +0000 (16:24 +0100)]
Clean on publish

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoActually do preclean
Ian Jackson [Fri, 18 Jun 2021 15:22:34 +0000 (16:22 +0100)]
Actually do preclean

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoDocument preclean
Ian Jackson [Fri, 18 Jun 2021 15:19:55 +0000 (16:19 +0100)]
Document preclean

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoIntroduce oot_preclean
Ian Jackson [Fri, 18 Jun 2021 15:18:42 +0000 (16:18 +0100)]
Introduce oot_preclean

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoFix parsing of --nail, --cargo-lock-manip, --concurrency-lock
Ian Jackson [Fri, 18 Jun 2021 15:06:58 +0000 (16:06 +0100)]
Fix parsing of --nail, --cargo-lock-manip, --concurrency-lock

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodoc: Fix a formatting bug
Ian Jackson [Fri, 16 Apr 2021 13:20:04 +0000 (14:20 +0100)]
doc: Fix a formatting bug

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodoc: Mention `+` as part of <cargo-opts>
Ian Jackson [Fri, 16 Apr 2021 13:18:17 +0000 (14:18 +0100)]
doc: Mention `+` as part of <cargo-opts>

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agohandle rustup +<toolchain> option
Ian Jackson [Thu, 15 Apr 2021 14:55:27 +0000 (15:55 +0100)]
handle rustup +<toolchain> option

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSupport `upgrades` subcommand
Ian Jackson [Thu, 15 Apr 2021 14:47:57 +0000 (15:47 +0100)]
Support `upgrades` subcommand

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDoucment -TWASM
Ian Jackson [Tue, 27 Oct 2020 17:28:13 +0000 (17:28 +0000)]
Doucment -TWASM

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDocs: Reformat known arch alias list
Ian Jackson [Tue, 27 Oct 2020 17:27:18 +0000 (17:27 +0000)]
Docs: Reformat known arch alias list

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDocs: Document that we understand `cargo fmt'
Ian Jackson [Tue, 27 Oct 2020 17:24:08 +0000 (17:24 +0000)]
Docs: Document that we understand `cargo fmt'

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDocs: Reformat known cargo command list
Ian Jackson [Tue, 27 Oct 2020 17:23:39 +0000 (17:23 +0000)]
Docs: Reformat known cargo command list

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDocs: Move "edits" subcommand property before the !... arg options
Ian Jackson [Tue, 27 Oct 2020 17:22:46 +0000 (17:22 +0000)]
Docs: Move "edits" subcommand property before the !... arg options

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDocument linkfarmking options and --edit-sources
Ian Jackson [Mon, 26 Oct 2020 12:32:41 +0000 (12:32 +0000)]
Document linkfarmking options and --edit-sources

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Fix linkfarm_depth setting for --just-linkfarm
Ian Jackson [Mon, 26 Oct 2020 12:32:06 +0000 (12:32 +0000)]
nailing-cargo: Fix linkfarm_depth setting for --just-linkfarm

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agolinkfarm auto for miri, undocumented
Ian Jackson [Sat, 10 Oct 2020 23:26:02 +0000 (00:26 +0100)]
linkfarm auto for miri, undocumented

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoWASM target alias, undocumented
Ian Jackson [Sat, 10 Oct 2020 16:04:37 +0000 (17:04 +0100)]
WASM target alias, undocumented

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoGet options right for "cargo fmt"
Ian Jackson [Sat, 10 Oct 2020 15:50:24 +0000 (16:50 +0100)]
Get options right for "cargo fmt"

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide -E option for edits-sources, still undocumented
Ian Jackson [Sat, 10 Oct 2020 15:50:07 +0000 (16:50 +0100)]
Provide -E option for edits-sources, still undocumented

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoNew --edit[s]-sources mode, still undocumented
Ian Jackson [Sat, 10 Oct 2020 15:40:12 +0000 (16:40 +0100)]
New --edit[s]-sources mode, still undocumented

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agooot_massage_commandline: Catch bad $linkfarm_depth
Ian Jackson [Sat, 10 Oct 2020 15:39:47 +0000 (16:39 +0100)]
oot_massage_commandline: Catch bad $linkfarm_depth

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agooot_massage_commandline: shell runes: capture $bld and $sd
Ian Jackson [Sat, 10 Oct 2020 15:38:47 +0000 (16:38 +0100)]
oot_massage_commandline: shell runes: capture $bld and $sd

No functional change yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoAllow for $post to be already set by linkdepth-specific code
Ian Jackson [Sat, 10 Oct 2020 15:38:14 +0000 (16:38 +0100)]
Allow for $post to be already set by linkdepth-specific code

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRevert "For revert: never symlink Cargo.toml"
Ian Jackson [Sat, 10 Oct 2020 12:19:55 +0000 (13:19 +0100)]
Revert "For revert: never symlink Cargo.toml"

This reverts commit 3786ac21ed0d37906256e26f352871679b1d9bf6.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoFor revert: never symlink Cargo.toml
Ian Jackson [Sat, 10 Oct 2020 12:19:22 +0000 (13:19 +0100)]
For revert: never symlink Cargo.toml

The statement in the comment was not true.  The wrong
CARGO_MANIFEST_DIR was coming from our setenvs() function.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDo not set CARGO_MANIFEST_DIR when linkfarming
Ian Jackson [Sat, 10 Oct 2020 12:18:20 +0000 (13:18 +0100)]
Do not set CARGO_MANIFEST_DIR when linkfarming

That just confuses naive tests etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoOptimise linkfarming
Ian Jackson [Sat, 10 Oct 2020 01:49:26 +0000 (02:49 +0100)]
Optimise linkfarming

This saves about 100ms in my project!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agofix oot Cargo.lock
Ian Jackson [Sat, 10 Oct 2020 01:19:00 +0000 (02:19 +0100)]
fix oot Cargo.lock

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agolinkfarm options, not yet documented
Ian Jackson [Sat, 10 Oct 2020 01:03:09 +0000 (02:03 +0100)]
linkfarm options, not yet documented

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide --doc
Ian Jackson [Sun, 13 Sep 2020 23:29:35 +0000 (00:29 +0100)]
Provide --doc

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoFix leftover wrong name in README.md
Ian Jackson [Sun, 13 Sep 2020 23:28:21 +0000 (00:28 +0100)]
Fix leftover wrong name in README.md

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide --just-run
Ian Jackson [Sun, 13 Sep 2020 23:27:32 +0000 (00:27 +0100)]
Provide --just-run

This is safer than asking the uxer to pass --no-nail --no-lock-manip
--no-concurrency-lock.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRename --no-concurrency-lock
Ian Jackson [Sun, 13 Sep 2020 23:20:07 +0000 (00:20 +0100)]
Rename --no-concurrency-lock

The old name --no-lock is confusing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide --no-cargo-lock-manip option
Ian Jackson [Sun, 13 Sep 2020 23:19:05 +0000 (00:19 +0100)]
Provide --no-cargo-lock-manip option

And clarify docs etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide --no-nail option
Ian Jackson [Sat, 12 Sep 2020 11:46:17 +0000 (12:46 +0100)]
Provide --no-nail option

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide --no-lock option
Ian Jackson [Sat, 12 Sep 2020 11:32:18 +0000 (12:32 +0100)]
Provide --no-lock option

This will have a more common sane use case in a moment...

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTake the lock after reading Cargo.nail
Ian Jackson [Sat, 12 Sep 2020 11:02:18 +0000 (12:02 +0100)]
Take the lock after reading Cargo.nail

This ought not to make any difference now but it would make it
possible to have the locking mechanism specified in Cargo.nail, etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agot/writer.t: Add test cases for quoted keys
Ian Jackson [Sun, 2 Aug 2020 21:25:58 +0000 (22:25 +0100)]
t/writer.t: Add test cases for quoted keys

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTokenizer: Fix handling of quoted keys
Ian Jackson [Sun, 2 Aug 2020 21:40:18 +0000 (22:40 +0100)]
Tokenizer: Fix handling of quoted keys

We can't just strip the quotes!  We may need to interpet \-escapes.
We can do this by calling tokenize_string.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoWriter: Fix quoting of table keys
Ian Jackson [Sun, 2 Aug 2020 16:51:46 +0000 (17:51 +0100)]
Writer: Fix quoting of table keys

Looking only at the first character to decide how to quote is clearly
a mistake.  And if we end up using " we must do \-escaping.

So replace this broken code.  Instead, we now prefer ' if there is
no ' in the key.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide --clean-linkfarm and --keep-linkfarm, and document oot.clean
Ian Jackson [Sat, 25 Jul 2020 18:18:57 +0000 (19:18 +0100)]
Provide --clean-linkfarm and --keep-linkfarm, and document oot.clean

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: [oot] clean, facility to clean up linkfarm
Ian Jackson [Sat, 25 Jul 2020 18:11:35 +0000 (19:11 +0100)]
nailing-cargo: [oot] clean, facility to clean up linkfarm

Not documented yet, pending command line.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide --leave-nailed option
Ian Jackson [Sat, 25 Jul 2020 18:07:52 +0000 (19:07 +0100)]
Provide --leave-nailed option

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide --just-linkfarm option
Ian Jackson [Sat, 25 Jul 2020 18:00:24 +0000 (19:00 +0100)]
Provide --just-linkfarm option

Closes #10

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Tolerate lack of build commands with -n
Ian Jackson [Sat, 25 Jul 2020 17:49:57 +0000 (18:49 +0100)]
nailing-cargo: Tolerate lack of build commands with -n

We just use dummy values instead.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoOption --man[ual] to show the manual
Ian Jackson [Sat, 25 Jul 2020 17:43:34 +0000 (18:43 +0100)]
Option --man[ual] to show the manual

Closes #8

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Record $base_path from linking goose-hunting
Ian Jackson [Sat, 25 Jul 2020 17:41:01 +0000 (18:41 +0100)]
nailing-cargo: Record $base_path from linking goose-hunting

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide usage summary, invoked with -h --help
Ian Jackson [Sat, 25 Jul 2020 17:22:56 +0000 (18:22 +0100)]
Provide usage summary, invoked with -h --help

Closes #7

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Chase path dependencies
Ian Jackson [Sat, 25 Jul 2020 17:09:29 +0000 (18:09 +0100)]
nailing-cargo: Chase path dependencies

Closes #9

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Do not adjust paths in the same subdir
Ian Jackson [Sat, 25 Jul 2020 17:04:25 +0000 (18:04 +0100)]
nailing-cargo: Do not adjust paths in the same subdir

This usually means paths in the same workspace.

This does away with the need for
  8dbd084a86a3dff840a215211cf8304ee61a927a
  nailing-cargo: Work around cargo annoyance with workspaces

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: When we set path, delete git and branch
Ian Jackson [Sat, 25 Jul 2020 16:57:09 +0000 (17:57 +0100)]
nailing-cargo: When we set path, delete git and branch

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Print every path change, with many -v
Ian Jackson [Sat, 25 Jul 2020 16:56:51 +0000 (17:56 +0100)]
nailing-cargo: Print every path change, with many -v

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Record $org_subdir in %packagemap and %manifests
Ian Jackson [Sat, 25 Jul 2020 16:56:26 +0000 (17:56 +0100)]
nailing-cargo: Record $org_subdir in %packagemap and %manifests

No functional change yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Process target-specific dependencies too
Ian Jackson [Sat, 25 Jul 2020 16:33:12 +0000 (17:33 +0100)]
nailing-cargo: Process target-specific dependencies too

We don't know which cfg() etc. apply, but that's OK.  We hope.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Refactor target_dependency_tables
Ian Jackson [Sat, 25 Jul 2020 16:26:58 +0000 (17:26 +0100)]
nailing-cargo:  Refactor target_dependency_tables

NFC.  This function needs enhancing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Break out get_dependency_tables
Ian Jackson [Sat, 25 Jul 2020 16:25:47 +0000 (17:25 +0100)]
nailing-cargo: Break out get_dependency_tables

NFC.  This function needs enhancing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Work around cargo annoyance with workspaces
Ian Jackson [Sat, 25 Jul 2020 15:53:46 +0000 (16:53 +0100)]
nailing-cargo: Work around cargo annoyance with workspaces

When the invocation $subdir is a workspace, with -u, cargo complains
that the packages in the linkfarm are different to the ones in the
source area.

Fix this by, in this case, adjusting those path references to point
into the linkfarm.

cargo seems to use realpath on one of these paths, so we must do so
too, or cargo complains that two things are different which are
literally two different paths to the very same symlink.

With this change I am able to build lexpr-rs, both in its own right,
and as a dependency.  Closes #1.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMake a shallow symlink farm
Ian Jackson [Sat, 25 Jul 2020 15:49:36 +0000 (16:49 +0100)]
Make a shallow symlink farm

Fighting Cargo to avoid this has become too much hard work.

In particular, otherwise with workspaces we would have to edit all of
the member paths.  And having done that the sources themselves claim
to be part of a different workspace, so it's all awful.

I have also seen some weird behaviours where cargo didn't work quite
right because the package wasn't convincing enough.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: oot_massage_cmdline: Initialise $pre and $post
Ian Jackson [Sat, 25 Jul 2020 16:15:55 +0000 (17:15 +0100)]
nailing-cargo: oot_massage_cmdline: Initialise $pre and $post

Otherwise if we don't write anything to them, we produce an undef
warning.

No functional change with current code.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Make oot_absdir available earlier
Ian Jackson [Sat, 25 Jul 2020 15:48:46 +0000 (16:48 +0100)]
nailing-cargo: Make oot_absdir available earlier

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Chase down workspace members
Ian Jackson [Sat, 25 Jul 2020 16:04:31 +0000 (17:04 +0100)]
nailing-cargo: Chase down workspace members

When workspaces are in use, we need to look at their members.
This is quite a palaver.

We want to process them after all the stuff in the config, so we must
queue them up when we see them.  And we want to chase recursively,
perhaps.  (We certainly will do when we extend this to path
dependencies.)  So rather than an actual recursive function, we have a
queue.

We use realpath(1) to check that the paths we find don't
escape.  (Strictly, this code might [l]stat or readdir various
pathnames controlled by hostile cargo metadata, but that's all.
Basically, I'm assuming it's OK to pass a hostile path to realpath(1)
and then check what realpath(1) said.)

Now we record a manifest as relevant if it has a [workspace], even if
it didn't have a package.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Change read_manifest return convention
Ian Jackson [Sat, 25 Jul 2020 16:06:23 +0000 (17:06 +0100)]
nailing-cargo: Change read_manifest return convention

Now it returns $ws too, which is going to be workspace information.

Right now it's just undef, so no functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Pass $org_subdir to read_manifest
Ian Jackson [Sat, 25 Jul 2020 15:57:52 +0000 (16:57 +0100)]
nailing-cargo: Pass $org_subdir to read_manifest

Currently this is just $subdir.  But we are going to recursively chase
down workspaces and path dependencies, and we want to know where they
came from so we can check the paths for sanity.

No functional change yet

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.

3 years agonailing-cargo: Print $why in error messages
Ian Jackson [Sat, 25 Jul 2020 10:42:54 +0000 (11:42 +0100)]
nailing-cargo: Print $why in error messages

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Pass $why to read_manifest
Ian Jackson [Sat, 25 Jul 2020 10:36:53 +0000 (11:36 +0100)]
nailing-cargo: Pass $why to read_manifest

This will help with error messages.

Not used yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Make ignored-subdir message more accurate
Ian Jackson [Sat, 25 Jul 2020 00:25:36 +0000 (01:25 +0100)]
nailing-cargo: Make ignored-subdir message more accurate

Maybe there was a Cargo.toml but we didn't like it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agonailing-cargo: Print a better error about missing update mode
Ian Jackson [Sat, 25 Jul 2020 00:12:07 +0000 (01:12 +0100)]
nailing-cargo: Print a better error about missing update mode

If the user forgot generate-lockfile, we would fail with a confusing
ENOENT error from the command script.  Instead, spot this situation.

This also gives us a place to do decide to mkdir -p or something.

Related to #5, but does not fix it completely.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoREADME.md: Try to fix salsa formatting
Ian Jackson [Mon, 22 Jun 2020 18:31:18 +0000 (19:31 +0100)]
README.md: Try to fix salsa formatting

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoREADME.md: Fix link (actually)
Ian Jackson [Mon, 22 Jun 2020 18:30:11 +0000 (19:30 +0100)]
README.md: Fix link (actually)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoREADME.md: Fix link
Ian Jackson [Mon, 22 Jun 2020 18:29:06 +0000 (19:29 +0100)]
README.md: Fix link

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoREADME.md: Fix link
Ian Jackson [Mon, 22 Jun 2020 18:26:27 +0000 (19:26 +0100)]
README.md: Fix link

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoREADME.md: Improve grammar
Ian Jackson [Mon, 22 Jun 2020 18:25:25 +0000 (19:25 +0100)]
README.md: Improve grammar

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoREADME.md: Fix grammar
Ian Jackson [Mon, 22 Jun 2020 18:22:54 +0000 (19:22 +0100)]
README.md: Fix grammar

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoREADME.md: Fix typo
Ian Jackson [Mon, 22 Jun 2020 18:22:24 +0000 (19:22 +0100)]
README.md: Fix typo

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoREADME.md: Fix busted link
Ian Jackson [Mon, 22 Jun 2020 18:20:04 +0000 (19:20 +0100)]
README.md: Fix busted link

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoREADME.md: Discussion of the scope of the local crate feature
Ian Jackson [Sun, 21 Jun 2020 19:46:38 +0000 (20:46 +0100)]
README.md: Discussion of the scope of the local crate feature

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>