Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

validate target triples before resolving crates #33329

Closed

Description

@brson

I stared at this for a while

$ rustc --target=x86_64_unknown-linux-musl src/main.rs
error: can't find crate for `std` [E0463]
error: aborting due to previous error

before realizing I had typod the target triple. If the target had been validated earlier the error would be more obvious.

Activity

  1. added
    A-diagnostics
    on May 2, 2016
  2. japaric commented on May 2, 2016

    @japaric
    Contributor

    So, I checked this and

    If the target had been validated earlier the error would be more obvious.

    we are already doing this. See:

    $ rustc --target foo bar.rs
    error: Error loading target specification: Could not find specification for target "foo"
    

    i.e. validate the target before looking for crates.

    The issue here is that x86_64_unknown-linux-musl (with underscore) is accepted as a valid target (as x86_64-unknown-linux-musl) because of this function -- it s/-/_/g the target name so it can compare it to the module name, which can't have dashes in it.

    The fix seems simple because that function is defined in a macro and it also has access to the target names (the ones with dashes). So we have to tweak it to use that instead of the module names (the ones without dashes). I'll look into it.

  3. added 5 commits that reference this issue on Jul 22, 2016
    756564a
    a373b84
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

    A-diagnostics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions