Skip to content

Discussion: Reconsider target parsing #1317

Open
@madsmtm

Description

I'm beginning to regret the decision we took in #1225 (comment) to pre-generate a static list of target information from the current nightly, instead of trying to guess it from the target name.

The gist of the issue is that static data doesn't help us much when using a custom target - but when using custom targets, we usually still need to default to some value (example: the LLVM target). Also, I don't like that you can sometimes use cc in a build script, but not outside.

And yeah, rustc target names are a mess, and they're impossible to parse correctly in general, but we can do a fairly good job at it (that's what I implemented in that PR initially) - especially if we have CI that verifies the parsing code against the latest rustc specs. Of course, manual parsing code is more tedious to update, i.e. the automated GitHub PRs would've instead been turned into a CI failure that we'd have to fix.

Idk., still don't know how I feel about it, but I do know that I was unhappy with #1315, as I felt I kinda had to get the default relocation model guessing correct, and once it was correct, there wasn't any point in the pre-generated data.

Related issues:

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