Repo with minimal example to debug Trunk issue Dependency conflicts with Trunk 0.7.0+. (And related Cargo issue, see below.)
In git-bash
on Windows:
cd app
cargo metadata --manifest-path='\\?\D:\repos\trunk-debug-deps\app\Cargo.toml'
(Note: Modify path as you need; only format is important (\\?..
))
or indirectly through Trunk 0.7.2:
/d/repos/trunk-debug-deps/app (master)
$ trunk serve
Error during execution of `cargo metadata`: error: package collision in the lockfile: packages dummy_dep v0.1.0 (D:\repos\trunk-debug-deps\app\../dummy_dep) and dummy_dep v0.1.0 (D:\repos\trunk-debug-deps\dummy_dep) are different, but only one can be written to lockfile unambiguously
server running at http://127.0.0.1:8080/
trunk | error
Related Cargo issue: "Package collision in lockfile" using UNC/root local device/etc paths
- Note: We often can't use workaround with path separator
\\
(instead of/
) because then some libraries, that use only hardcoded/
separators, fail (e.g. proc-macro-hack). - Tested with
rustc 1.47.0 (18bf6b4f0 2020-10-07)
onWindows 10
.
-
fs::write(format!("{}/index.html", self.cfg.dist.display()), output_html.as_bytes())
changed tofs::write(self.cfg.dist.join("index.html"), output_html.as_bytes())
. -
cmd.manifest_path(manifest);
changed tocmd.manifest_path(dunce::simplified(manifest));
.- dunce
manifest
is aPath
returned fromfs::canonicalize()
. Alternatively we can usedunce::canonicalize
instead allfs::canonicalize
calls and then removedunce::simplified
call.