This question may off-topic, I found a lot of project has some sort of "Symbolic Links" files, usually for Licenses or README.md, the file just with a relative path in it, for example:
../README.md
And I have even seen some project use this to "link" source code outside the crate (usually from another crate of the same workspace).
I wondered is this a feature of cargo or some other tools, is there any documentation for this?
P.S. For example, this or this, serde use this to include source codes
P.P.P.S: If I publish a crate to crate.io, what happens to a symlinks? Does the cargo copy the real file(since there's no workspace in crate.io, just crates.)?,
If you clone it your local machine, then you aren't going to get a file with those contents, but instead you will get a real symlink. The ../README.md string is just how GitHub displays a symlink.
I tried on a Mac, and yes it turns to a real symbol, So it is just a UNIX-Like symbolic links, no magics here? But if it is a normal symbol link, it shouldn't be readable (not even as strings) on Windows...
I ask here because I got further questions, if I publish a crate to crate.io, what happens to a symlinks? Does the cargo copy the real file(since there's no workspace in crate.io, just crates.)? I checked some imported crates, it seems that it does copy the real files, but I'm not sure how it is done (not sure if it is done automatically, or manually be someone who upload his crate).
If you want to publish from Windows then IMO it's better to fight Windows a bit (enable Developer's Mode, reinstall Git with symlinks support, change git repos to ensure core.symlinks is set to true in your crate) rather than hope that cargo would scan your project and turn file copies back into symlinks.