Cargo: Lockfile ends up with 2 duplicate entries

Created on 16 Apr 2018  路  2Comments  路  Source: rust-lang/cargo

I am reporting this on behalf of IRC user metsu, who isn't on github.

Logs: https://botbot.me/mozilla/cargo/2018-04-16/?msg=99024994&page=1

metsu: Hello, I'd like to report a bug in cargo where the lockfile ends up with two duplicate entries. I've written a bash script that reproduces this bug using the latest release: https://paste.ubuntu.com/p/2fnHR6ccrC/

Paste content duplicated here just in case:

set -e

cd /tmp
DIR="$(mktemp -d)"
cd "$DIR"
cargo new --lib common
cargo new --lib a
cargo new --lib b

cd a
ln -s ../common/ common
cd ..

cd b
ln -s ../common/ common
cd ..

printf "common = {path=\"common\"}\n" >> a/Cargo.toml 
printf "common = {path=\"common\"}\n" >> b/Cargo.toml 
printf "a = {path=\"../a\"}\n" >> b/Cargo.toml 

cd b
# first run succeeds because no lockfile
cargo test 
# second run fails
if cargo test; then
    echo "** bug fixed"
else
    echo "** bug still present. Check Cargo.lock file for duplicate entries of 'common'"
fi

This is all the context I have. Please contact metsu in #cargo on moz IRC with followup questions; I'm unsubscribing from this issue.

C-bug

All 2 comments

More or less the as #5267 I guess?!

Yep! Thanks @lucaskolstad for noticing a duplicate, metsu for creating a super-helpful reproduction script and @carols10cents for reporting the issue!

closing as a duplicate.

Was this page helpful?
0 / 5 - 0 ratings