Skip to content

rustup update fails because of missing directory #1167

Closed

Description

@lesichkovm

Same issue as: #938

$ rustup update stable
info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: downloading component 'rustc'
37.8 MiB / 37.8 MiB (100 %) 10.2 MiB/s ETA: 0 s
info: downloading component 'rust-std'
53.8 MiB / 53.8 MiB (100 %) 10.2 MiB/s ETA: 0 s
info: downloading component 'cargo'
3.6 MiB / 3.6 MiB (100 %) 799.6 KiB/s ETA: 0 s
info: downloading component 'rust-docs'
11.4 MiB / 11.4 MiB (100 %) 11.1 MiB/s ETA: 0 s
info: downloading component 'rust-src'
31.9 MiB / 31.9 MiB (100 %) 10.5 MiB/s ETA: 0 s
info: rolling back changes
error: failure removing component 'rust-src', directory does not exist: '"lib/rustlib/src/rust/src/llvm/test/tools/llvm-objdump/X86/Inputs/internal.exe.coff-x86_64"'

Activity

  1. lesichkovm commented on Jun 15, 2017

    @lesichkovm
    Author

    $ rustc --version
    rustc 1.17.0-nightly (b1e31766d 2017-03-03)

  2. hbobenicio commented on Feb 20, 2018

    @hbobenicio

    Same issue here:

    $ rustup update
    info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
    info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
    270.6 KiB / 270.6 KiB (100 %) 101.8 KiB/s ETA:   0 s                
    info: latest update on 2018-02-19, rust version 1.25.0-nightly (27a046e93 2018-02-18)
    info: downloading component 'rustc'
    info: downloading component 'rust-std'
    info: downloading component 'cargo'
    info: downloading component 'rust-docs'
    info: downloading component 'rls-preview'
    info: downloading component 'rust-src'
    info: downloading component 'rust-analysis'
    info: removing component 'rustc'
    info: rolling back changes
    error: failure removing component 'rustc-x86_64-unknown-linux-gnu', directory does not exist: '"share/doc/rust/COPYRIGHT"'
    info: checking for self-updates
    
           stable-x86_64-unknown-linux-gnu unchanged - rustc 1.24.0 (4d90ac38c 2018-02-12)
      nightly-x86_64-unknown-linux-gnu update failed - rustc 1.23.0-nightly (d0f8e2913 2017-11-16)
    

    BTW, "share/doc/rust/COPYRIGHT" is a missing file in the toolchain, not a directory...

    $ rustup show
    Default host: x86_64-unknown-linux-gnu
    
    installed toolchains
    --------------------
    
    stable-x86_64-unknown-linux-gnu
    nightly-x86_64-unknown-linux-gnu (default)
    
    active toolchain
    ----------------
    
    nightly-x86_64-unknown-linux-gnu (default)
    rustc 1.23.0-nightly (d0f8e2913 2017-11-16)
    
    $ rustup --version
    rustup 1.11.0 (e751ff9f8 2018-02-13)
    

    I'm curious here... why the removal of a component fails because the absence of a directory (and in this specific case, a doc/copyright one)? Isn't it safe to just warn (if it is not expected) and keep going?

  3. hbobenicio commented on Feb 20, 2018

    @hbobenicio

    Well... after I removed my toolchains manually with:

    $ rm -frv ~/.rustup/toolchains/*
    $ rustup show
    # ... downloaded some stuff
    

    and then it worked.

    This is what I think that happened:
    I think something went wrong during the download of the initial toolchains. Then, rustup update got confused because some files were missing during removal of components (should it be?). After a cleanup on the toolchains directory, rustup fresh installed it all again and it worked fine.

    Does rustup do integrity check after the download/installation of the toolchains already? If it does, then the corruption occured after that.

    Anyway, wouldn't it be better to differentiate which error occurred during component removal? It's ok to abort the proccess when a permission error happens, but if it was an ErrorKind::ComponentMissingFile or ErrorKind::ComponentMissingDir error, I think the component removal shouln't be affected because of that).

    https://github.com/rust-lang-nursery/rustup.rs/blob/master/src/rustup-dist/src/component/components.rs - at "// Remove parts" on lines 277

  4. danielpclark commented on Mar 5, 2018

    @danielpclark

    Same issue:

    rustup update stable
    info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
    info: latest update on 2018-03-01, rust version 1.24.1 (d3ae9a9e0 2018-02-27)
    info: downloading component 'rustc'
    info: downloading component 'rust-std'
    info: downloading component 'cargo'
    info: downloading component 'rust-docs'
    info: downloading component 'rust-std' for 'armv7-unknown-linux-gnueabihf'
    info: downloading component 'rust-std' for 'arm-unknown-linux-gnueabihf'
    info: removing component 'rustc'
    info: rolling back changes
    error: failure removing component 'rustc-x86_64-unknown-linux-gnu', directory does not exist: '"share/man/man1/rustdoc.1"'
    

    I've deleted ~/.rustup/toolchains/* and now it works.

  5. theGeekPirate commented on Jul 21, 2018

    @theGeekPirate

    Probably belongs here, worked after I did what @danielpclark said above on Arch Linux.

    > error: failure removing component 'rustc-x86_64-unknown-linux-gnu', directory does not exist: '"share/doc/rust/COPYRIGHT"'

  6. ra0x3 commented on Aug 30, 2018

    @ra0x3

    Similar problems when trying to update. error: failure removing component 'rust-std-x86_64-apple-darwin', directory does not exist: '"lib/rustlib/x86_64-apple-darwin/lib/liblog-34f173aa5845f490.rlib"' using rustc 1.25.0 (84203cac6 2018-03-25)

  7. kinnison commented on Dec 29, 2019

    @kinnison
    Contributor

    Closed in favour of #1480, please comment there if you have further information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions