Describe the bug
downloadCargoPackageFromGit fails when a git dependency contains a filename that Cargo refuses to package, even if the file is unrelated to the build.
This appears to be caused by #976, which changed git vendoring to call cargo package -l. Cargo rejects package filenames containing characters such as :.
Error:
error: cannot package a filename with a special character `:`: fixtures/US:TN.md
Expected: crane vendors the git dependency successfully.
I suppose the repo should fix this so it doesn't contain any files names that are invalid on windows. Though on the other hand, a regular cargo build by itself doesn't choke on these files.
I've worked around it by running this in downloadCargoPackageFromGit prePatch.
find . -depth -name '*[\\<>:"|?*]*' -print -exec rm -rf {} +
Not sure if this is a good idea to generalize though. If there's no reasonable way to handle this, then maybe documenting it with a manual workaround could be the way to go.
Reproduction
Minimal repro:
https://github.com/simonzkl/crane-download-git-invalid-filename-repro
Run:
nix build github:simonzkl/crane-download-git-invalid-filename-repro#
Describe the bug
downloadCargoPackageFromGitfails when a git dependency contains a filename that Cargo refuses to package, even if the file is unrelated to the build.This appears to be caused by #976, which changed git vendoring to call
cargo package -l. Cargo rejects package filenames containing characters such as:.Error:
Expected: crane vendors the git dependency successfully.
I suppose the repo should fix this so it doesn't contain any files names that are invalid on windows. Though on the other hand, a regular cargo build by itself doesn't choke on these files.
I've worked around it by running this in
downloadCargoPackageFromGitprePatch.Not sure if this is a good idea to generalize though. If there's no reasonable way to handle this, then maybe documenting it with a manual workaround could be the way to go.
Reproduction
Minimal repro:
https://github.com/simonzkl/crane-download-git-invalid-filename-repro
Run: