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

Convert built-in targets to JSON #34980

Merged
merged 5 commits into from
Jul 29, 2016
Merged

Commits on Jul 27, 2016

  1. librustc_back: expose all target options via JSON

    Not all TargetOptions are exposed via the JSON interface to create
    different targets. This exposes all the missing items and reorders them
    to match the structure so that it is easier in the future to identify
    missing items.
    
    Signed-off-by: Doug Goldstein <[email protected]>
    cardoe committed Jul 27, 2016
    Configuration menu
    Copy the full SHA
    9c83fa4 View commit details
    Browse the repository at this point in the history
  2. librustc_back: add ToJson trait to Target

    Target's can already be built up from JSON files as well as built into
    librustc_back so this adds the ability to convert any Target back into
    JSON.
    
    Signed-off-by: Doug Goldstein <[email protected]>
    cardoe committed Jul 27, 2016
    Configuration menu
    Copy the full SHA
    c7b6ed2 View commit details
    Browse the repository at this point in the history
  3. librustc_back: convert fn target() to return Result

    Change all the target generation functions to return a Result<Target,
    String> so that targets that are unable to be instantiated can be
    expressed as an Err instead of a panic!(). This should improve rust-lang#33497 as
    well.
    cardoe committed Jul 27, 2016
    Configuration menu
    Copy the full SHA
    eafecbf View commit details
    Browse the repository at this point in the history
  4. librustc_back: json tests for builtin targets

    Expand the supported_targets!() macro to also generate a set of
    JSON encode/decode tests to verify that the parser will encode
    and decode all of the fields needed for all of the builtin targets.
    Additionally, add PartialEq to Target and TargetOptions in support
    of the tests.
    jcreekmore authored and cardoe committed Jul 27, 2016
    Configuration menu
    Copy the full SHA
    bd194a7 View commit details
    Browse the repository at this point in the history
  5. librustc_back: filter targets for only valid ones

    Since we can know which targets are instantiable on a particular host,
    it does not make sense to list invalid targets in the target print code.
    Filter the list of targets to only include the targets that can be
    instantiated.
    jcreekmore authored and cardoe committed Jul 27, 2016
    Configuration menu
    Copy the full SHA
    54c61ff View commit details
    Browse the repository at this point in the history