sorccu / r2d2-redis

MIT License
101 stars 42 forks source link

Trouble releasing 0.11 #28

Closed sorccu closed 5 years ago

sorccu commented 5 years ago

@badboy I tried releasing a new minor version after merging the latest pull requests, but keep getting the following error:

% cargo release minor
Release version r2d2_redis 0.11.0? [y/N]
y
Update r2d2_redis to version 0.11.0
Calling pre-release hook: ["scripts/update-versions.sh"]
[master 49704e4] (cargo-release) version 0.11.0
 3 files changed, 6 insertions(+), 6 deletions(-)
Running cargo publish on r2d2_redis
    Updating crates.io index
error: 1 files in the working directory contain changes that were not yet committed into git:

Cargo.lock

to proceed despite this and include the uncommited changes, pass the `--allow-dirty` flag

This doesn't make sense to me as:

  1. Cargo.lock is in included in .gitignore
  2. git status --ignored confirms that Cargo.lock is ignored
  3. I can't find anyone else having this same issue

I also tried rustup run stable cargo release minor but it had the same behavior.

I checked cargo-release's source code and there doesn't seem to be any way to pass --allow-dirty to cargo publish.

An easy way to quickly check if the issue is still there is to run cargo package:

% cargo package
error: 1 files in the working directory contain changes that were not yet committed into git:

Cargo.lock

to proceed despite this and include the uncommited changes, pass the `--allow-dirty` flag

In the end, the issue seems to boil down to:

https://github.com/rust-lang/cargo/blob/49fbf52fd517906a2229ca83d468971c1113b015/src/cargo/core/package.rs#L226-L228

Essentially, since we include examples (which are binaries), it seems that we should perhaps NOT ignore our Cargo.lock.

How were you able to release earlier?

sorccu commented 5 years ago

Hmm, I suppose this only happens on cargo 1.37.0 and later:

https://github.com/rust-lang/cargo/commit/34307c6122eb1b9368c70f3b3ca3900ef08ad6b8

sorccu commented 5 years ago

I've decided to not fight cargo even though this is just a library and therefore should not include Cargo.lock.