Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BulletProofs 1.0.4 does not build when used as a dependency #292

Closed
CjS77 opened this issue Aug 2, 2019 · 4 comments
Closed

BulletProofs 1.0.4 does not build when used as a dependency #292

CjS77 opened this issue Aug 2, 2019 · 4 comments

Comments

@CjS77
Copy link

CjS77 commented Aug 2, 2019

The relative doc paths are broken when compiling 1.0.4 as a dependency. This was on a Mac with Rust 1.38.0-nightly (4b65a86eb 2019-07-15), but I assume is a global issue. To reproduce:

cargo new --bin test-bp

Edit Cargo.toml:

[package]
name = "test-bp"
version = "0.1.0"
authors = ["CjS77 <CjS77@users.noreply.github.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bulletproofs = "1.0.4"
$ cargo build

   Updating crates.io index
   Compiling typenum v1.10.0
  ...
   Compiling bulletproofs v1.0.4
error: couldn't read /xxx/.cargo/registry/src/github.51.al-1ecc6299db9ec823/bulletproofs-1.0.4/src/../../docs/range-proof-protocol.md: No such file or directory (os error 2)
 --> /xxx/.cargo/registry/src/github.51.al-1ecc6299db9ec823/bulletproofs-1.0.4/src/range_proof/mod.rs:2:18
  |
2 | #![doc(include = "../../docs/range-proof-protocol.md")]
  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ couldn't read file
  |
  = help: external doc paths are relative to the crate root

error: aborting due to previous error

error: Could not compile `bulletproofs`.

To learn more, run the command again with --verbose.
@CjS77
Copy link
Author

CjS77 commented Aug 2, 2019

After playing around, it's something that changed between nightly-2019-07-31 and nightly-2019-07-08. Updating the toolchain resolves the issue.

@CjS77 CjS77 closed this as completed Aug 2, 2019
@hdevalence
Copy link
Contributor

Yup! Sorry for the breakage, in fact this is why the 1.0.4 version exists: versions 1.0.2 and below work on nightlies with the old doc(include) path format, but are broken on new nightlies, while 1.0.4 and above work on new nightlies but are broken on old nightlies. (1.0.3 effectively doesn't exist, it was supposed to be 1.0.4 but I made a mistake while tagging and publishing it, so it's immediately yanked).

@tronch0
Copy link

tronch0 commented Aug 4, 2019

Hi I got this one too, and I understand from what you suggested that I need to update my nightly version, but I have two questions regarding this matter:

  1. why wasm-pack build cares about docs?
  2. there is a flow or anything that I can make it ignore the docs altogether?

@hdevalence
Copy link
Contributor

Unfortunately, as far as I'm aware, doc(include) annotations add attributes to source items unconditionally, regardless of whether rustc is building docs or not, so adding the annotations makes rustc look for the markdown files regardless of what type of compilation it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants