jamesmunns / postcard

A no_std + serde compatible message library for Rust
Apache License 2.0
929 stars 88 forks source link

Somethings odd with the import path #166

Closed jamesmunns closed 3 months ago

jamesmunns commented 3 months ago

CC @Manishearth, I plan to do a release, but somethings funky with the cargo package and relative path imports to readmes.

I'll take a look at this in a bit.

netlify[bot] commented 3 months ago

Deploy Preview for cute-starship-2d9c9b canceled.

Name Link
Latest commit d89290f9a4c07a135dd22d4199858ea774d6919a
Latest deploy log https://app.netlify.com/sites/cute-starship-2d9c9b/deploys/66c3dccee2a6dc0008222b47
jamesmunns commented 3 months ago

R-A and cargo package complain with either option:

error: couldn't read `src/../../../README.md`: No such file or directory (os error 2)
 --> src/lib.rs:3:33
  |
3 | #![cfg_attr(not(doctest), doc = include_str!("../../../README.md"))]
  |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)
help: there is a file with the same name in a different directory
  |
3 | #![cfg_attr(not(doctest), doc = include_str!("../../../../README.md"))]
  |                                              ~~~~~~~~~~~~~~~~~~~~~~~

error: could not compile `postcard` (lib) due to 1 previous error
error: failed to verify package tarball
Manishearth commented 3 months ago

Yeah in ICU4X we copy the license file around to avoid using relative paths like that. I forget if it was because it was broken-ish, or completely broken, but that might end up being the call. You can also check in a symlink into git (it'll become a regular file on publish, iirc)

Manishearth commented 3 months ago

(however git symlinks are weird on windows. i forgot in what way)

robertbastian commented 3 months ago

Windows needs admin privileges to create symlinks, so by default git creates a copy.

jamesmunns commented 3 months ago

Decided to just copy the file for now, to get this released.