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

librustc_metadata::locator: Properly detect file type. #75548

Merged
merged 1 commit into from
Aug 18, 2020

Commits on Aug 17, 2020

  1. librustc_metadata::locator: Properly detect file type.

    Make sure to test for file types against the non-canonicalized name
    to avoid detecting the wrong type.  Some systems save build artifacts
    into associative file stores that do not preserve extensions, and
    then link to those using conventionally-named symbolic links that
    are the arguments to `rustc` et al.  If we canonicalize before
    testing the type, we resolve the symlink, the extension is lost and
    we might treat rlibs and rmetas as dylibs.
    
    The fix is to introduce a temporary to hold the canonicalized name,
    compare against the non-canonical name, and add a comment
    explaining what's going on for the would-be maintainer who sees a
    potential cleanup.
    
    Signed-off-by: Dan Cross <dcross@google.com>
    Dan Cross committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    6ad6d8c View commit details
    Browse the repository at this point in the history