Giter Site home page Giter Site logo

cargo-makedocs's People

Contributors

bunogi avatar frozendroid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

frozendroid

cargo-makedocs's Issues

Cargo makedocs fails to get the correct version when there's a mismatch

The following cargo.toml and cargo.lock causes cargo-makedocs to not be able to pick the correct version.

[dependencies]
log        = "0.4.0"
env_logger = "0.5.13"
actix      = "0.7.5"
actix-web  = "0.7.13"
listenfd   = "0.3.3"
diesel     = { version = "1.0.0", features = ["postgres"] }
dotenv = "0.9.0"
[[package]]
name = "diesel"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
 "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
 "diesel_derives 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "pq-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]

Workspace support?

Inlining the repro.sh I have in my MRE repo for this issue:


cargo-makedocs looks like an interesting tool, but it doesn't seem to work with Cargo workspaces yet.

Steps to reproduce:

  1. Create a new workspace with a single member -- for the sake of example, let's call this binary and make it a new Cargo binary.
dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)"
cd "$dir"
NEW_WORKSPACE_NAME="new-workspace"
NEW_MEMBER_NAME="binary"
if [ -e "$NEW_WORKSPACE_NAME" ]; then
	rm -rf "$NEW_WORKSPACE_NAME" || exit $?
fi
cargo new "$NEW_WORKSPACE_NAME" || exit $?
cd "$NEW_WORKSPACE_NAME" || exit $?
rm -rf *
cat > Cargo.toml <<-EOF || exit $?
	[workspace]
	members = ['$NEW_MEMBER_NAME']
EOF
cargo new --bin $NEW_MEMBER_NAME || exit $?
  1. Build the workspace. This shouldn't fail.
cargo build || exit $?
  1. Sanity check: run cargo makedocs on workspace root, expecting it to fail because a concrete workspace member should be used to generate docs.
TEMP_CARGO_INSTALL_ROOT="$dir/cargo-install-root"
if [ -e "$TEMP_CARGO_INSTALL_ROOT" ]; then
	rm -rf "$TEMP_CARGO_INSTALL_ROOT" || exit $?
fi
mkdir "$TEMP_CARGO_INSTALL_ROOT" || exit $?
export PATH="$PATH:$TEMP_CARGO_INSTALL_ROOT/bin"
cargo install --root "$TEMP_CARGO_INSTALL_ROOT" cargo-makedocs || exit $?
cargo makedocs && { echo "expected \`cargo makedocs\` to fail at workspace root!"; exit 1; }
echo "^ This failure is expected -- it's the workspace root. :)"
  1. Change directory into the newly built binary workspace member. Let's try to use makedocs on it, expecting this to work.
cd "$NEW_MEMBER_NAME"
cargo makedocs || exit $?

Unfortunately, the above invocation fails, complaining that Cargo.lock couldn't be found. Cargo.lock DOES exist, but at the workspace root and not this working directory. This seems to indicate that makedocs simply isn't aware of workspaces yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.