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

detected conflict: '"share/doc/rust/LICENSE-MIT"' #1668

Closed
SimonSapin opened this issue Feb 21, 2019 · 21 comments
Closed

detected conflict: '"share/doc/rust/LICENSE-MIT"' #1668

SimonSapin opened this issue Feb 21, 2019 · 21 comments
Labels

Comments

@SimonSapin
Copy link
Contributor

Problem

Updating to today’s Nightly fails.

Steps

$ rustc +nightly -V    
rustc 1.34.0-nightly (8ae730a44 2019-02-04)
$ rustup update nightly
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2019-02-21, rust version 1.34.0-nightly (f66e4697a 2019-02-20)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: downloading component 'rust-analysis'
info: downloading component 'rls'
info: downloading component 'rustfmt'
info: downloading component 'rust-src'
info: removing component 'rustc'
info: removing component 'rust-std'
info: removing component 'cargo'
info: removing component 'rust-docs'
info: removing component 'rust-analysis'
info: removing component 'rls'
info: removing component 'rustfmt'
info: removing component 'rust-src'
info: installing component 'rustc'
info: rolling back changes
error: failed to install component: 'rustc-x86_64-unknown-linux-gnu', detected conflict: '"share/doc/rust/LICENSE-MIT"'

Notes

Running rustup uninstall nightly first works around the issue.

@SimonSapin SimonSapin added the bug label Feb 21, 2019
@dwijnand
Copy link
Member

What's changed in the nightly build to cause this?

I'm wondering whether this a bug in Rustup and how it should be solved?

@SimonSapin
Copy link
Contributor Author

Maybe the contents of $RUSTUP_HOME/toolchains should be considered “owned” by rustup.rs, and it should overwrite any existing file there rather than error on conflicts?

@dwijnand
Copy link
Member

FWIW I couldn't reproduce it. Any ideas why you got a conflict on share/doc/rust/LICENSE-MIT?

@SimonSapin
Copy link
Contributor Author

I don’t know. I tried to manually downgrade by installing nightly-2019-02-05 and copying the files into those for nightly, but then updating succeeded after that and I couldn’t reproduce the issue.

@kinnison
Copy link
Contributor

I think this was likely to be a bogon in the nightly components, especially if you can't reproduce it. I'll close this for now.

@nikomatsakis
Copy link

FWIW, I am encountering this same problem on my windows machine. Perhaps I can help provide some debugging information?

@kinnison
Copy link
Contributor

Normally I'd guess that this means more than one of the components had that path in it, but if the failure is as the OP had it where only one component was being unpacked at the time, then it implies that something more insidious is going on. I guess we should start with:

  1. Is your current nightly toolchain sanely installed -- i.e. is there the conflicting file present, and is it listed in exactly one of the manifest-componentname files in .rustup/toolchains/$TOOLCHAIN/lib/rustlib/
  2. If so, could you make a tarball of the toolchain in question and then put that tarball and a copy of the associated .rustup/update-hashes/$TOOLCHAIN file somewhere I can get them so I can take a deeper look?
    2b. If not (1) then how does it differ from what I asked?

If you don't have time to diagnose then just do 2a. and let me know where I can get the content from to take a look.

@nikomatsakis
Copy link

> rustup update stable
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2019-04-25, rust version 1.34.1 (fc50f328b 2019-04-24)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: downloading component 'rustfmt'
info: removing component 'rustc'
warning: during uninstall component rustc was not found
info: removing component 'rust-std'
warning: during uninstall component rust-std was not found
info: removing component 'cargo'
warning: during uninstall component cargo was not found
info: removing component 'rust-docs'
warning: during uninstall component rust-docs was not found
info: removing component 'rustfmt'
warning: during uninstall component rustfmt was not found
info: installing component 'rustc'
 85.4 MiB /  85.4 MiB (100 %)   9.7 MiB/s ETA:   0 s
info: rolling back changes
error: failed to install component: 'rustc-x86_64-unknown-linux-gnu', detected conflict: '"share/doc/rust/LICENSE-MIT"'
> find ~/.rustup/ -name LICENSE-MIT
/home/nmatsakis/.rustup/tmp/xwjl7jwvgkbtxn7l_dir/LICENSE-MIT
/home/nmatsakis/.rustup/tmp/xwjl7jwvgkbtxn7l_dir/rustc/share/doc/rust/LICENSE-MIT
/home/nmatsakis/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc/cargo/LICENSE-MIT
/home/nmatsakis/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc/rust/LICENSE-MIT
/home/nmatsakis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/LICENSE-MIT

@kinnison
Copy link
Contributor

kinnison commented May 2, 2019

OK, that is fascinating -- where it's fun is the warning: during uninstall component rustc was not found

Could you please provide:

$ ls ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-*

For example, I get:

$ ls ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-*
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-cargo-x86_64-unknown-linux-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-clippy-preview-x86_64-unknown-linux-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-llvm-tools-preview-x86_64-unknown-linux-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rls-preview-x86_64-unknown-linux-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-analysis-x86_64-unknown-linux-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rustc-x86_64-unknown-linux-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-docs-x86_64-unknown-linux-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rustfmt-preview-x86_64-unknown-linux-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-src
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-std-armv7-unknown-linux-gnueabihf
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-std-thumbv6m-none-eabi
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-std-x86_64-apple-darwin
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-std-x86_64-pc-windows-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-std-x86_64-pc-windows-msvc
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu
/home/danielsilverstone/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-musl

@nikomatsakis
Copy link

> ls ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-*
ls: cannot access '/home/nmatsakis/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/manifest-*': No such file or directory

@nikomatsakis
Copy link

I sort of dimly recall that I may have tried to delete some stuff in an effort to make this go away =)

@kinnison
Copy link
Contributor

kinnison commented May 2, 2019

Eep!

Are there any *.toml files in that directory (...lib/rustlib/)

@nikomatsakis
Copy link

> ls ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/
components  etc  multirust-channel-manifest.toml  multirust-config.toml  rust-installer-version  x86_64-unknown-linux-gnu

@kinnison
Copy link
Contributor

kinnison commented May 2, 2019

If you deleted the manifest files then rustup will be entirely unable to uninstall/update that channel because it won't know which files came from what component.

You can remove the entire toolchain directory and ask rustup to reinstall the channel but that's about your best bet at this point 😞

@nikomatsakis
Copy link

I think what I did was to run rustup uninstall stable or something. If you do want the tarball, it's here

http://smallcultfollowing.com/rustup-issue-1668.tgz

at least for a while :)

@nikomatsakis
Copy link

for now I will just kill rustup and reinstall I guess

@kinnison
Copy link
Contributor

kinnison commented May 2, 2019

Thanks, I've downloaded that now, so you can remove the tarball if you want. I guess that for now that will be your best bet. I think longer-term we ought to detect this kind of issue and offer a way to nuke-from-orbit from within rustup, though you must have gone behind its back at which point UB is your reward anyway :D

@prophet1906
Copy link

Also happens when I interrupt rustup component add rustfmt before completion & try to run rustup component remove rustfmt. Some issue in rustup component removal.

Failed to install component: 'rustfmt-preview-x86_64-unknown-linux-gnu', detected conflict: '"share/doc/rustfmt/LICENSE-MIT"'

@kinnison
Copy link
Contributor

If you cancel the installation of a component while it's unpacking then it is quite possible it will end up in an inconsistent state.

@rbtcollins
Copy link
Contributor

interrupting rustup should be safe due to the transaction system, but I am sure there are non-transactional non-automatic-recovery things in there that can break indeed.

@kinnison did you get anywhere analysing the downloaded tarball?

@rbtcollins
Copy link
Contributor

This is another instance of missing/corrupt manifest data. Without knowledge of the installed file, rustup cannot remove it prior to installing the updated version, and then hits a conflict due to the file already existing, and you get the error.

We've got a bunch of these bugs scattered all over the place, I'm closing them all to bring order. See #2417.

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

No branches or pull requests

6 participants